• Advertisement
Sign in to follow this  

Drawing a grid

This topic is 3956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i need to draw a grid for my level editor. Since i have four views (top, left, front and perspective), i need to draw the visible portion of my grid four times. The grid has a predefined size (in my case, 2048 x 2048) and i draw it using a LineList in Direct3D. I connect the left and right vertices, as well as the Bottom and top vertices, to draw the grid. Unfortunately, the performance ist not very good. Since each line of the grid crosses the furstum, i cannot cull any of them, and the lines are already clipped by the API. Can you give me some tipps of how i could speedup the rendering for the grid? thanks, Gamma_strahler

Share this post


Link to post
Share on other sites
Advertisement
Well, since it's a predefined size you should use display lists (if you're using OpenGL that is, I don't know about other 3D renderers). It's not at all complicated and info is easy to find.

Other than that I can only think of of one thing: lower the drawn detail; do you really need to draw the entire grid every frame?.

Share this post


Link to post
Share on other sites
4100 lines doesn't seem like enough to cause performance problems. Are you sure that is what is affecting your performance? What values do you get when you draw with and without the lines? How old is your PC?

Share this post


Link to post
Share on other sites
I have an Athlon XP 64 3200+, with 512 MB of memory and an ATI 9600 with 128 MB VRAM.

Currently i can´t tell you the framerate since i haven´t implemented measurement and don´t have a tool.

The Direct3D stuff is used within a C# forms application, and if move the window around or navigate through the pulldown menus, it is rather unsmooth.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement