So, I'm trying to figure out what the slope is in a shader so I can make changes to albedo based on that.
I assume I need to do something with the normal, but I'm really not sure what.
Determining slope in shader
Asked Answered
The slope angle is inverse cosine of the dot product of normal vector and up vector. For most things you can use the dot product directly without calculating the inv cosine. It'll vary in range 0-1.
Overdevelop works a treat, thank you!
© 2022 - 2024 — McMap. All rights reserved.