A shader function that can tell flatness?
I really like the look of the stones in torchlight. Low poly but the textures are light at the edges of the stone and darker where it is flatter. Makes things look "worn".
I am wondering if there is a function that I could use that could determine how "flat" the area I am currently using is. If I had total freedom I would think of getting the dot product of the normal at the very point I was calculating plus another point that was very close (actually a few points around and taking the mean of them or something) and that would give me a value that would give an idea of whether or not the point I am calculating is generally flat or near an edge, and use that to lerp between bright and dark as necessary. I can imagine this kind of thing would be easy in a normal blueprint but I don't seem to find that same kind of functionality in the material blueprints
Any leads would be appreciated
asked Aug 24 '14 at 09:39 AM in Rendering
In theory this is doable, I know that rendering software has those tricks. However, real-time creating that in a way that looks good and affordable by hardware is hard, plus not a thing that is shader only, you would probably need some extra data calculated on the cpu and pass it on to the shader. Or maybe some form of post processing.
However, the guys that made Torchlight just have really good artist that hand painted the whole thing. There is not much going on in the shader.
If you do want info in the shader like that, you might want to go for some cheap solution, like painting it in the vertex colors.
answered Aug 24 '14 at 10:56 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here