Hi all,
This may have been asked before but I'm not finding the solution for my problem anywhere so far. I'm fairly new to UDK and working my way through a few projects.
I have a shader setup that uses the R, G, B vertex colours to paint the following details over the base diffuse:
R- Rust
G- Scratches
B- Discolouration
All three work fine independently. My problem is getting multiple vertex colour assignments working together for example painting yellow and resulting in rust + scratches but I get just scratches.
UDK seems to not like adding vertex colours. I've tried using 'ADD' nodes etc. to try and sort it but it does not just add the vertex colours it also adds the diffuse maps.
I'm sure the solution will be simple or it's a fact UDK does not allow this. Hope someone can offer some assistance.
Thanks
Replies
try playing with the "IF" node, there might be some possibilities there, i just don't know how.
You can very easily clamp the values of the RGB Vertex Colors so they stop the textures running into each other, and use CMYK value to 'mix' the textures into each other, controlled by you, and use a AO/Cavity/Displacement Map in your Normal Map Alpha slot to create the transitions effect as you see fit.
I'll post up whatever version I have when I get in later. I've been through a few I did see a post regarding the CMY method. My RGB is set up like that just without the CMY controlled lerps.
My problem is that the vertex colours don't run into each other or mix they just replace each other.
TBH I presumed UDK would mix the materials into each other automatically this is what I want to happen. If I paint yellow I'd expect to get red and green combined. Using the CMY option to force the mix sounds good. Just need to find that reply on these boards again.
Here are the materials setups I have been working through.
http://www.antodonnell.com/udk_materials_wip.jpg
Attempt 3 now allows me to blend red and green as expected. Blue still "erases" red and green when I paint.
For attempts 1 and 2 I think it was the fact I was using LERPS to create my texture before adding that to another LERP that may have confused UDK. Also each LERP had the base diffuse and the additional details. In attempt 3 the base only appeared once then everything else was adding by layering up 3 LERPS.
In attempt 3 I have reduced the number of LERPS and also used masks in conjunction with the vertex colours to get the same results as 1 and 2.
I'm a few steps closer and can continue my project with this level of functionality. Once the RED and GREENS mix I'm happy. I'll figure out why the BLUE does not someday.
Can you try just putting a different texture in each lerp? Don't use masks or anything, just connect 4 different textures in the Lerps and just use the Vertex Color as they are in the Alpha's.
Also, before connecting the Vertex Color node, Constant clamp it.
I think my first attempt created an issue where the original masks and the base being assigned to the "A" slot of every LERP caused each colour to revert to the base when painted over.
My recent attempt now allows me to paint yellow and get the red and green blends together. I'll try the clamp on the blue later. There's already a clamp on the Red and Green LERPS. I think it may be that UDK does not like many LERPS together.
I'm new to UDK but familiar with other engines. I just need to rewire my brain to work the UDK way.
What UDK could do with is a LERP node that allows triple blends and instead of an ALPHA slot to blend between them an A,B,C slot would be great, one for each map.
Could look like this:
Base texture
Texture 1
Texture 2
Texture 3
A = RED ( paints texture 1)
B = GREEN ( paints texture 2 )
C = BLUE ( paints texture 3 )