I'm following a tutorial on some stylised grass, and it just says to have the normals always facing upwards with a vector compose node. But when I look at it from above they get darker as the angle gets closer to looking at it from above, which does not seem to be happening in the tutorial. Is there any way to have them be consistent even when the viewing angle changes? thanks for any help
#Need some help with shader normals
1 messages · Page 1 of 1 (latest)
Hi @turbid void. I'm no shader guru, but looking online, it seems others have faced this issue as well.
This appears to be the solution in code "NORMALMAP = tex(normalMapTexture, UV).xyz * vec3(2.0,2.0,1.0) - vec3(1.0,1.0,0.0); NORMALMAP_DEPTH = normalMapDepth; //float" and with a little help from AI, this is the step-by-step that was given:
First part tex(normalMapTexture, UV).xyz * vec3(2.0,2.0,1.0):
Add a Texture2D node and connect your normal map texture
Connect it to a UV input
Add a Vector3Compose node to create vec3(2.0, 2.0, 1.0)
Add a VectorOp node set to Multiply to multiply these together
Second part - vec3(1.0,1.0,0.0):
Add another Vector3Compose node set to (1.0, 1.0, 0.0)
Add a VectorOp node set to Subtract
Connect the result from step 1 as the first input
Connect the vec3(1.0,1.0,0.0) as the second input
For the NORMALMAP_DEPTH:
Add a FloatConstant node
Set its value to your desired normal map depth
Connect it directly to the Normal Map Depth output
Connect the final vector result to the Normal Map output port.
I'm not using a normal map texture for this, so how would i go about the first step without it?