I’m looking to create a shader that would have a gradient based on the Heights that I set in the world. Rather than being set based on the surface that it’s applied to.
Example: Black would be set to the tallest point in my map and white to the lowest.
Any suggestions on how to go about this? thank you!
I would post a node graph but I’m not at home right now, hope this will be helpful. You could put that code into a custom node and set up the three inputs (WorldPositionZ, MinHeight, MaxHeight) and then hook the output up to whatever you want. The world position node may or may not use Z as up, I can’t remember if it’s Y-up or Z-up in UE4. The 1/WorldPositionZ may need changing to just WorldPositionZ also, but the code should do what you’re asking for.
I was on my tablet when I replied, but I’m at home and have made the shader, I implemented it as a post process as it would be much more flexible that way but you can do it as part of your regular materials and it’ll be the same. I prefer to defer effects like these as it’s much easier to implement global changes that way.