#How to correctly apply normal strength

1 messages · Page 1 of 1 (latest)

fossil tusk
#

When I apply normal strength and high up the float value shadows became stronger for pixel that are far from the light. I would like that the normal strenght increases shadows only based on the normal tex and the light position

#

NormalStrength = 1

#

NormalStrength = 100

#

here we see the pixels on bottom left of the wall near the light that goes to black

#

shadergraph

#

i can work both on shadergraph and code. I miss the maths and geometry to achieve the result

crystal wigeon
#

Is the normal texture properly imported as a normal map ?

fossil tusk
#

yes

crystal wigeon
#

I'm not 100% sure, but maybe the middle value is not interpreted as 0, and applying a very high normal strength "tilts" the surface

#

I'm never sure if the "flat" normal value should be rgb 127, 127, 255 or 128, 128, 255 (I think the later) maybe you have the wrong one in the normal map

fossil tusk
#

I have the same problem without the notmal tex

crystal wigeon
#

And if you force (0,0) as input of the normal strength ?

fossil tusk
#

this is with normalStrength = 0

#

with this is all black

crystal wigeon
#

Oh, sorry, I mean't "neutral normal", so (0,0,1)

#

And high strength value

fossil tusk
# fossil tusk

same result with all values of strength and input = (0,0,1)

crystal wigeon
#

So proper lighting ?

#

It means that the issues somehow comes from the normal map

fossil tusk
#

oh. but even with the default value of "bumb" (null texture) gives the problem

crystal wigeon
#

You could :

  • try to increase the compression quality
  • Force the sampled value to (0,0,1) when the normal is close to it
fossil tusk
#

force the sampled value by shader or I can do it on the texture?

#

oh, I have to do it on shader if i want to use high value of strenght without problems!

crystal wigeon
crystal wigeon
#

Could be as easy as : if (normal.z > 0.99) normal = (0,0,1)

#

Why did you do this ????

#

Yes, but with the "Type" set to "Normal", the sample operation also automatically remaps the value to the [-1, 1] range

fossil tusk
#

How i can achieve this?