Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Zylann | |
Old Version | Published before Godot 3 was released. |
I need to use the normal of the model in a shader to blend a different texture depending on the steepness of a slope.
I tried to use NORMAL
, however NORMAL
is a view-space vector, and it changes when the camera moves, that’s not what I need.
There is SRC_NORMAL
, but it is only available in vertex shaders (I’m writing a fragment shader).
Is there any way to get this normal?
I also tried what the doc indicates:
vec3 world_normal = NORMAL * mat3(INV_CAMERA_MATRIX);
However this produces an error, mat3
cannot be used with INV_CAMERA_MATRIX
…