Sign in to follow this  
szalejot

Way to display a lot of cubes

Recommended Posts

Hi all :)

I have to display a lot of cubes as visualization of some mathematics computing (in worst case even more than 100 000).
It's real time visualization of computing so I want to display this as fast as possible.
It will be only solid color cubes.
What I have before display is array contains size of cube and location (3d coordinate of center).

I thought for maybe Vertex Buffer of Triangle strips. But if I want use CUDA for generating vertex coordinates (for parallel and fast it up) I will have problem with concatenation of strips (because if I want to insert degenerate triangles to separate cubes I will need to know vertex coordinates for both of cubes and for parallel I need to generate cubes strips separately).

What is your ideas to make it fast?

Share this post


Link to post
Share on other sites
[quote name='szalejot' timestamp='1318058028' post='4870403']
Hi all :)

I have to display a lot of cubes as visualization of some mathematics computing (in worst case even more than 100 000).
It's real time visualization of computing so I want to display this as fast as possible.
It will be only solid color cubes.
What I have before display is array contains size of cube and location (3d coordinate of center).

I thought for maybe Vertex Buffer of Triangle strips. But if I want use CUDA for generating vertex coordinates (for parallel and fast it up) I will have problem with concatenation of strips (because if I want to insert degenerate triangles to separate cubes I will need to know vertex coordinates for both of cubes and for parallel I need to generate cubes strips separately).

What is your ideas to make it fast?
[/quote]

instancing?

Share this post


Link to post
Share on other sites
Could even use geometry shaders, I've done this before in my demo -> [url="http://pouet.net/prod.php?which=57299"]http://pouet.net/prod.php?which=57299[/url]

What you can do with geometry shaders, or at least how I implemented it in that demo is that I only have to send a GL Point to the GPU and it will generate cubes on that spot, means I only send 1/8th of the points to the GPU I normally have to send 8 to create a cube out of triangles. It's fully written in GSLS, what I do is use a triangle strip which I wrap around this point. Add some size variables etc, color and you'll have about what I used for the demo. In the demo I was able to draw about 450K more or less, depending on the culling.


More on the demo here [url="http://www.nisute.com/2011/08/09/igathering-2011/"]http://www.nisute.co...gathering-2011/[/url]

Share this post


Link to post
Share on other sites
[font=arial, verdana, tahoma, sans-serif][size=2]Wow, thanks for replying guys, I will look at this technologies :)

I have another question (maybe silly, but I'm not quite familiar with OpenGL. I rather create algorithms and use OpenGL to visualize results):
What will happen if I will push more data (floats) than graphic card have available ram? Will it make error or start to swap... or what? I think this situation may occur, because my computing use CUDA and it will take large part of graphics card memory.[/size][/font]

Share this post


Link to post
Share on other sites
[quote name='szalejot' timestamp='1318068144' post='4870445']
[font="arial, verdana, tahoma, sans-serif"][size="2"]Wow, thanks for replying guys, I will look at this technologies :)

I have another question (maybe silly, but I'm not quite familiar with OpenGL. I rather create algorithms and use OpenGL to visualize results):
What will happen if I will push more data (floats) than graphic card have available ram? Will it make error or start to swap... or what? I think this situation may occur, because my computing use CUDA and it will take large part of graphics card memory.[/size][/font]
[/quote]

what will happen is let's say you have 1GB of video RAM and 4GB of system RAM, and you have 3GB of data. About 1GB of it will be on the video card, and 2GB on the system ram. However this is implementation (driver) dependent, so your driver might do it differently, say it stores all the data in the system RAM.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this