Archived

This topic is now archived and is closed to further replies.

d000hg

culling

Recommended Posts

With d3d, you set up a camera so that it automatically clips triangles to the screen, does this mean it does other culling? Does d3d check normals to perform back-face culling for me? I guess If I have a large landscape/terrain to render, I''d still want to cull most of it myself using standard methods... or is hardware culling fast enough I can ignor it? Cheers

Share this post


Link to post
Share on other sites
er... dooohg... these are questions that are easily answered by the sdk docs.

will the hardware do backface culling? of course, as long as you tell it to

is hardware back face culling fast enough? If it isn''t then we''ve all been wasting our money buying 3d accelerator vid cards. :o

Depending on your engine type you might want to do large scale occlusion or frustrum culling, but the blatant stuff is all handled by the hardware.

Share this post


Link to post
Share on other sites
The main problem with relying on the hardware to clip vertices/faces out of your display, is that you still have to use up the card''s bandwidth to SEND the list of vertices and faces. So it''s still a bandwidth drain on the card, though most (probably all) cards with T&L will occlude backfaces and clip off-screen surfaces, but it has to know those surfaces are there to clip.

Your best bet would be to work up some sort of higher-level clipping algo, then send a subset of "potentially visible" data to the card. I.E. clip whatever you can, and let the card handle the hard-to-reach sort of things.

Hope that helps,

Josh

Share this post


Link to post
Share on other sites
Kinda what I figured. So in a terrain where you have the map split into squares for example, you''d check which squares were at least partly visible, then send all polygons within them to be figured out by d3d?
Thanks

Share this post


Link to post
Share on other sites
the question was not if hardware is fast enough culling
"out of frustrum/view" tris, but if it is fast enough culling "back-faced" tris, and the answer to that is: yes.

use quad-trees for terrain-culling.
simple and fast.
just dont go down to 1 tri/leaf resolution, stop at a reasonable amount.
lets say at least 64 or so.
maybe more.

bye,

--- foobar
We push more polygons before breakfast than most people do in a day

Share this post


Link to post
Share on other sites
I presusme d3d does intelligent clipping, not just checking if any vertices are inside the fustrum... you can easily have triangles in view where this isn''t the case.

Share this post


Link to post
Share on other sites
quote:

I presume d3d does intelligent clipping, not just checking if any vertices are inside the frustrum... you can easily have triangles in view where this isn't the case.


noooo... actually you can't since the view frustrum is defined as the volume of space in which things are visible. It's specified by the 2 clipping planes and the fov angle.


[edited by - sorrow on March 25, 2002 7:35:55 AM]

Share this post


Link to post
Share on other sites
um, yes you can.
Imagine I have 3 vertices transformed to screen coordinates. One is directly above the top of the screen ie (-100,320) and the other two are below the bottom of the screen ie (100,700) and (300,800). [assuming 640x480 resolution]
Now, none of these vertices will be in the viewing volume but the triangle SHOULD be visible. In these situations, either one or more edges pass through the viewing volume, or the viewing volume passes completely inside the triangle without touching it.
There are standard algorithms to select these tris to be drawn, my question is does d3d use these or just naively check if any vertices are inside the viewing volume

Share this post


Link to post
Share on other sites
ah... of course it's smart enough to draw the triangle properly in that case. I don't think it does any culling/clipping on a per vertex basis, it does it on a triangle basis. Otherwise it'd be pretty useless :o


[edited by - sorrow on March 27, 2002 1:04:10 AM]

Share this post


Link to post
Share on other sites