Vertex clipping?

Started by
6 comments, last by adt7 14 years, 11 months ago
So, if I have a uniform grid of vertices in a 3D space being rendered as 1 pixel points, when I zoom out beyond a certain point some of the points won't show up on screen, and the grid will seem smaller. Would it be better for me to make some sort of algorithm to delete the vertices that can't be seen at the long view point or would XNA\GPU handle not rendering them faster? How does XNA determine which vertices get rendered when zoomed out so far?
Artist 1st - Programmer 2nd(I'll get some material linked here sometime to support these claims, haha)
Advertisement
Your far clipping plane should take care of culling things that are over a certain distance away.

Otherwise you could test if something is 1 pixel or smaller, in which case don't draw it.
I guess I used the wrong term. I don't actually want to clip the vertices, instead I just don't want to render them if they are smaller than a pixel as you said, which I guess the GPU could probably do faster than me since I'd have to modify the vertex buffer and all that.
Artist 1st - Programmer 2nd(I'll get some material linked here sometime to support these claims, haha)
Anything that is beyond your far plane won't get rendered at all.

Depending on what you are doing, setting your far plane to a lower value could be the solution.

As for culling things as they become too small, you'll need to look into occlusion queries.
I don't want all points beyond the focus point to not render, just some. Think of it like an image zoom. When viewed at 100% each pixel renders as a pixel. but what happens to the unviewable pixels when zoomed out to 50%? I guess the XNA pointlist drawing function takes care of it so I don't really have to worry about it. Was just wondering if I should make a dynamic vertex buffer to behave the same to save on memory.

EDIT: I just found out that vertex buffers can't change in size after creation, so, nevermind.
Artist 1st - Programmer 2nd(I'll get some material linked here sometime to support these claims, haha)
Unless you are drawing a massive amount of points I can't see memory being an issue.

You could always optomise your vertex structure - by using shorts instead of floats for example - if you're memory conscious. Of course you then have to work with the limitations of shorts.
Original post by adt7
Unless you are drawing a massive amount of points I can't see memory being an issue.
quote]

That was the idea, I want all my surfaces represented as a collection of uniform spaced vertices. I think I can get away with it as long as I come up with a way to disregard backface surfaces and surfaces behind other surfaces.

Artist 1st - Programmer 2nd(I'll get some material linked here sometime to support these claims, haha)
If they are uniformly spaced you way be able to get away with shorts instead of floats.

Backface culling is simple to turn on if you're indices are correctly ordered.

Surfaces behind other surfaces can be deal with using occlusion queries.

This topic is closed to new replies.

Advertisement