Visualize the vertex number in GLSL

Hello to everyone,

i have a terrain generated via a GLSL TOP and i’m curious how can i generate/visualize vertex number so it looks like floating above the terrain, the similar effect you can see when you turn on points in display options tab.


thanks,
Alex

Hi Alex,

I found a few shaders that might get you started:

shadertoy.com/view/4tfSz2
shadertoy.com/view/llXSzj
shadertoy.com/view/MlXXzH

None of them are exactly what you’re looking for but at least the number rendering bit is there.

Alternatively you could use a second buffer to write vertex positions in RGB values, convert them to a chop with a TOPtoCHOP operator then use regular Geo Instancing to render a layer of just the numbers. Then you could comp that over your generated terrain.

thanks for reply Matthew,

I don’t know for sure if the second option can be implemented in my setup
(correct me if I’m wrong). I have a GLSL TOP operator with only a pixel shader passed to it, and I believe that I have no direct access for creating another buffer and store a vertex info there (I need a geo shader for that I suppose).

thanks,
Alex