Home Technical Talk

Vertex Blend Shader

polycounter lvl 10
Offline / Send Message
god3ila polycounter lvl 10
Ok fellas,

I really need your help here. I've searched the forum and I've found some threads about it, even choco and drew++ have made a great one.
I've tried it, but I didn't succeed to have what I've expected.
Here is the thing I've made using ShaderFX :
ShaderFX.jpg

And here is the result :
Cube.jpg

Most of the time, the transition mask is a height map. But, what if I want something else?
As I remember, when we do it in UDK, the transition mask appears only at the transition between the two colors, not everywhere like here.
What did I do wrong?

I've tried with this one :
Drew++ wrote: »

and I've got the same result.
Is there a way to avoid this? Maybe my 3DS Max is fu**** up?

Thank you for your answers!

Replies

  • Drew++
    Options
    Offline / Send Message
    Drew++ polycounter lvl 14
    I'm not entirely what you're nodes are, since I've never really used ShaderFX...
    But I'm thinking it's either you file type, or your gamma settings on your texture import. If that's not it, in your shader: you might need to do a clamp before the lerp... You can either clamp 0 to 1, or use saturate.

    if that doesn't help... come back!

    p.s.
    - What do your blend textures look like?
  • god3ila
    Options
    Offline / Send Message
    god3ila polycounter lvl 10
    Thank you Drew,

    Sorry for the late answer ^^
    So, I've tried to put a clamp before the lerp, like you said, but it didn't help it out.
    Here is the texture blend, that I use for this test:
    TransitionMask.jpg

    And I've also made a screenshot with some notes, so it could be more understandable.

    ShaderFX_Detailed.jpg

    Thanks a lot! :)
  • god3ila
    Options
    Offline / Send Message
    god3ila polycounter lvl 10
    Up...
    Sorry for that. But if anyone have the answer, I would be grateful! Thanks. :)
  • equil
    Options
    Offline / Send Message
    if i'm reading this right what your shader is doing is simply multiplying vertex color by a mask. that means that when your mask is zero, 0*vertexcolor = 0. if you want the lerp input value to be 0 when vertex color is 0 and 1 when vertex color is 1, you're gonna have to change your calculation.

    mask + (vertexcolor* 2 - 1) is probably the easiest way to handle this. clamp that before passing it into lerp too.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    So it looks like all you are only multiplying the blend texture to the vertex color. Here is an example using UDK http://eat3d.com/free/vertex_painting

    After multiplying the blend map with the vertex color, he adds the vertex color back in (so parts that should be blended 100% are) then a power node to adjust the contrast of the blend, and eventually clamps all of that.
  • god3ila
    Options
    Offline / Send Message
    god3ila polycounter lvl 10
    Yeah! That's it! Thanks m4dcow

    Solution.jpg

    It just works fine now :

    SolutionRender.jpg



    @equil : I've tried your solution. In this case, the mask starts at the transition, but it keeps going

    AdviceGraph.jpg

    AdviceRender.jpg

    Anyway, thanks for your answers! ^^
Sign In or Register to comment.