PBR Lighting with Texture arrays

I think you are correct and that this may be the issue, I am going to try to figure out how to change that…

I guess I understand the idea here, and the difference between vertex/texture coords, but I am not sure how to make the necessary changes to the shader. Is this a simple thing to do?

You need to use triplanar mapping.

In the vertex shader a texCoord variable is defined as the vertex position. In this instance it’s converted to world coords for noise lookups.

https://github.com/jayfella/iso-terrain/blob/master/src/main/resources/Shaders/TrilinearLighting.vert#L172

And in the fragment shader, that world coordinate is sampled along all three axis.

https://github.com/jayfella/iso-terrain/blob/master/src/main/resources/Shaders/TrilinearLighting.frag#L262

It’s probably better to read an article that someone else already wrote, rather than me explain the same thing.

2 Likes