TSL Shader - using positionLocal

Here is a different approach, but you would need more data (this is what I meant by revised algorithm). Imagine stacked layers with variable thickness. And then the actual ground surface cuts through these layers. So for every pixels that you draw, you have a “column” of corresponding intersections with the layers, so it is easy to find in which layer the pixel is, and thus set its color.

https://codepen.io/boytchev/full/yyaewxa

image

4 Likes