Cirrus
11-29-2002, 05:33 AM
I've been implementing a terrain engine in the past couple of weeks using Nvidia's wonderful VAR extension.
All index buffers are sent to the card via DrawElements. Right now I'm dividing the terrain mesh into a bunch of vertex buffers which get sent to AGP memory with VAR. This obviously causes vertex repetition as edge vertices are shared by multiple blocks.
I prefered doing this and wasting some agp memory as then one index buffer suits all blocks (there are actually multiple index buffers for different LODS, but still only one of each type is needed).
What would be ideal would be to send the entire mesh as a single block and tell DrawElements to add an offset to each index buffer value. This would keep memory use low, overhead low, and leave all incremental calculations to the graphics card.
For example I could pass an index buffer which suits a block and tell the card to add 256 to each value in the index buffer to render the second block (assuming each block has 256 vertices). Even better would be to tell the card that each block has 256 vertices per block once and then simply specify a multiplier for each DrawElements call.
Is this currently possible? Can it be done with vertex shaders or something of the like?
I hope I've been clear enough, if you have any questions or if something is misty please ask.
I'd really appreciate it if someone could 'fill me in'.
Thanks for the read!
___________
Luigi Rosso
Lead Developer
RealitySlip
http://www.RealitySlip.com
[This message has been edited by Cirrus (edited 11-29-2002).]
All index buffers are sent to the card via DrawElements. Right now I'm dividing the terrain mesh into a bunch of vertex buffers which get sent to AGP memory with VAR. This obviously causes vertex repetition as edge vertices are shared by multiple blocks.
I prefered doing this and wasting some agp memory as then one index buffer suits all blocks (there are actually multiple index buffers for different LODS, but still only one of each type is needed).
What would be ideal would be to send the entire mesh as a single block and tell DrawElements to add an offset to each index buffer value. This would keep memory use low, overhead low, and leave all incremental calculations to the graphics card.
For example I could pass an index buffer which suits a block and tell the card to add 256 to each value in the index buffer to render the second block (assuming each block has 256 vertices). Even better would be to tell the card that each block has 256 vertices per block once and then simply specify a multiplier for each DrawElements call.
Is this currently possible? Can it be done with vertex shaders or something of the like?
I hope I've been clear enough, if you have any questions or if something is misty please ask.
I'd really appreciate it if someone could 'fill me in'.
Thanks for the read!
___________
Luigi Rosso
Lead Developer
RealitySlip
http://www.RealitySlip.com
[This message has been edited by Cirrus (edited 11-29-2002).]