Sign in to follow this  
etsuja

Vertex clipping?

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote]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.

Share this post


Link to post
Share on other sites
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.

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