resle
06-05-2010, 10:04 AM
I am coding a terrain which doesn't even have an heightmap. It's basically just a grid of quads + an 2dTextureArray which holds the N possible textures for each quad + a 2dTexture which is nothing but an array which stores, for each quad, whose texture should be used from the texture array.
Now, when I think about this in term of vertex shader, I should be able to calculate everything without having to pass real vertex data. Actually, all I'd have to pass is an array of indices to which quads I should render (ex. [1,2,3,5,9,23,40]), because from that single index I am able to derive pretty much everything.
I've tried looking for primitive id in glsl but looks like it's something which is used in geometry shaders only, so I wonder if what I am saying makes sense at all and there's some way to implement it. Any suggestion?
Thanks
a.
Now, when I think about this in term of vertex shader, I should be able to calculate everything without having to pass real vertex data. Actually, all I'd have to pass is an array of indices to which quads I should render (ex. [1,2,3,5,9,23,40]), because from that single index I am able to derive pretty much everything.
I've tried looking for primitive id in glsl but looks like it's something which is used in geometry shaders only, so I wonder if what I am saying makes sense at all and there's some way to implement it. Any suggestion?
Thanks
a.