Home Unreal Engine

Is there a "right" way and a "wrong" way to set up Alpha blends with Vertex Painting?

1) Is there a "good" or "bad" way to set up the alpha blend for vertex painting? Is it just preference based on aesthetics?

2) I'm trying to understand why this behaves the way it does:

wAJl9Nk.jpg

It works fine like it is, there is a 100% blend between the two diffuse textures I'm using it with. Why does it only work correctly when the original vertex shader is plugged into the 'Add' node, though? Isn't that just '1'? If I plug '1' into there I end up with the blend texture with a very light opacity at max fill. I assume it's adding the original vertex color back into the node, but how does UDK know that the vertex color isn't just '1' since it's pulled from the original Vertex Color node?

Replies

  • mister_s
    Options
    Offline / Send Message
    Let me elaborate some more about my second question.

    XhxZBBY.jpg

    That is a basic alpha blend using the red channel from my base diffuse texture.

    lcRhzXP.jpg

    This is the same alpha blend, except instead of plugging the vertex channel back into the add node, I just used a constant 1.

    I'm confused as to where the vertex color node gets its information from? I thought that each channel was already at 1.

    If I pulled that node straight from the same vertex color node and plugged it into the second half of the add node I thought I was adding 1, but I guess I wasn't. I have some sort of fundamental misunderstanding I guess.
  • mister_s
    Options
    Offline / Send Message
    I think I figured it out. Someone correct me if I'm wrong. Since I put in a constant one value it was taking the multiplied material and adding 1 to everything. When I clamped it down it locked it all at one. Since the I could only vertex paint between 0 and 1 I wouldn't ever be able to modify it since it was a constant.
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    1) Not necessarily. If it works, it works. But technically, the "right" way would be the cheapest, yet most effective :)

    2) Your vertex shader only works when it's connected to the Add because you're using a masking texture and you need to Multiply it to apply the Vertex Color to the white areas in the texture, then Add it back to the Multiply output so the Vertex Color is being recognized as the color you're using. Multiplying a color by a texture essentially adds the color into the texture in the lighter areas.

    The Vertex Color doesn't need to get information, it's kind of its own thing. It's generally used as a means of tweaking things outside of the material editor, like Mesh Paint or Cascade for particles.

    Not sure what you mean about every node being 1.
  • mister_s
    Options
    Offline / Send Message
    Yep, I had figured out where I went wrong. It's always aggravating to look at a problem you've been having and wonder how you ever got it wrong to begin with.

    I appreciate the response, though. Very informative.
Sign In or Register to comment.