Tree Culling
I was wondering about how much of a performance gain will I get if I supply normals to all my trees in GL Golf, here is a screenshot
Any ideas? Is it worth doing, I am concerned about people on older computers (<500MHZ) because of the old video cards that come with them.
Any ideas? Is it worth doing, I am concerned about people on older computers (<500MHZ) because of the old video cards that come with them.
You don't supply normals for your trees!? No wonder they've always looked so weird!
Normals have nothing to do with culling. Culling is determined by winding order. Provided you have GL_CULL_FACE enabled, and draw all of your polygons in counter-clockwise order, the appropriate things will get culled. But you should definitely provide normals for your trees in either case; it should give you a nice visual improvement.
- Alex Diener
Normals have nothing to do with culling. Culling is determined by winding order. Provided you have GL_CULL_FACE enabled, and draw all of your polygons in counter-clockwise order, the appropriate things will get culled. But you should definitely provide normals for your trees in either case; it should give you a nice visual improvement.
- Alex Diener
I wouldn't worry about the performance hit either of sending normals along with vertices. I've *never* seen a performance hit, even with terrain with something like 15k triangles. So long as you're not drawing in immediate mode ( e.g., display lists, vbos ) it's not a big deal. And you'll get lighting.
I've always thought it would be a huge improvement if, when you played glgolf, you were part of the larger course... i.e. in the flyby it would show the other holes laid out in a "golf course" manner. I've always thought it was a bit weird that you're playing this hole in the middle of this huge green world, and I thought it was because you didn't have enough trees, but I think it's the fact that there's no "location." Also, have you thought about adding different varieties of trees? Different shades of grass? Also, your water seems to lack "depth." It would be neat if it shaded deeper blue based on the depth of the terrain...
Don't get me wrong - I think glGolf is awesome, a terrific game. Just some ideas.
Don't get me wrong - I think glGolf is awesome, a terrific game. Just some ideas.
ThemsAllTook Wrote:You don't supply normals for your trees!? No wonder they've always looked so weird!
Normals have nothing to do with culling. Culling is determined by winding order. Provided you have GL_CULL_FACE enabled, and draw all of your polygons in counter-clockwise order, the appropriate things will get culled. But you should definitely provide normals for your trees in either case; it should give you a nice visual improvement.
- Alex Diener
I guess I never really had the time back when I was learning about 3D program to try to add normals to the trees, but now from experience I know that will be very easy and will do it soon.
WHAT??? Am I really confused on what culling is? I thought you specified what direction a triangle is facing, and then after the translation if it is facing away it gets skipped and isn't drawn. What is this winding thing you are talking about, and is my way right because it works in my motorcycle game and in the terrain for GL Golf.
TomorrowPlusX Wrote:I wouldn't worry about the performance hit either of sending normals along with vertices. I've *never* seen a performance hit, even with terrain with something like 15k triangles. So long as you're not drawing in immediate mode ( e.g., display lists, vbos ) it's not a big deal. And you'll get lighting.
I was saying a performance BOOST, because the video card can skip over half the polygons on the trees, which should reduce the fill per frame alot
Thanks for the suggestions about GL Golf, but it is a side project that is my primary income, I am working on my other games now and only spend a few hours a week on GL Golf.
Yeah: It's a little counter-intuitive that culling is done by winding and not by normals. but so it goes. As long as your windings are consistent, you can call something like:
And about half of your polygons won't be drawn.
Anyway, I was just mentioning the normals because your golf game looks like lighting isn't really happening.
Code:
glFrontFace( GL_CCW ); //right handed
glEnable( GL_CULL_FACE );And about half of your polygons won't be drawn.
Anyway, I was just mentioning the normals because your golf game looks like lighting isn't really happening.
So how about a build of that new motorcycle game? That one looks terrific.
Jake Wrote:WHAT??? Am I really confused on what culling is? I thought you specified what direction a triangle is facing, and then after the translation if it is facing away it gets skipped and isn't drawn. What is this winding thing you are talking about, and is my way right because it works in my motorcycle game and in the terrain for GL Golf.Um, the winding order is how you specify which object face is the "front" (per face)
Global warming is caused by hobos and mooses
Check out the redbook...
Global warming is caused by hobos and mooses
Jake Wrote:WHAT??? Am I really confused on what culling is? I thought you specified what direction a triangle is facing, and then after the translation if it is facing away it gets skipped and isn't drawn. What is this winding thing you are talking aboutCulling is removing polygons from the rendering pipeline that don't need to be rendered, to save time.
Like BinarySpike said, vertex winding (again, see red book) is used by the renderer to determine which face is which, which is commonly used for *back-face* culling in OpenGL. IOW, OpenGL won't waste time trying to render faces that would not normally be seen.
You can (and should) also do *object* culling, where you determine whether or not an entire group of polygons (an object) is even within the viewing frustum. That has nothing to do with whether or not a face is showing, but whether a polygon is even within view. OpenGL does not do that for you, you have to calculate that yourself. Basic frustum culling is not very difficult to do, so look into it if you've never heard of it. Object culling can offer *huge* speed benefits if you never knew you were suppose do it.

Normals are normalized vectors (IOW, scaled to be between 0 and 1 in magnitude and centered at the origin) that tell the renderer how to calculate which direction is "outward" from a vertex or polygon. It's used for determining things like light shading on an object for specular highlights and stuff.
AnotherJake Wrote:You can (and should) also do *object* culling, where you determine whether or not an entire group of polygons (an object) is even within the viewing frustum. That has nothing to do with whether or not a face is showing, but whether a polygon is even within view. OpenGL does not do that for you, you have to calculate that yourself. Basic frustum culling is not very difficult to do, so look into it if you've never heard of it. Object culling can offer *huge* speed benefits if you never knew you were suppose do it.
Normals are normalized vectors (IOW, scaled to be between 0 and 1 in magnitude and centered at the origin) that tell the renderer how to calculate which direction is "outward" from a vertex or polygon. It's used for determining things like light shading on an object for specular highlights and stuff.
I do my own object culling, it renders only a 90 degree slice of the trees. I need to learn open gl sometime instead of just reading a few NeHe tutorials and coding
How come when I use just normals for my terrain surface only the ones pointing towards the camera are rendered, is this a coincidence? I used a few cull commands in Open GL.
blobbo Wrote:So how about a build of that new motorcycle game? That one looks terrific.
Shivers is working on a rider model, right now there is a stick figure made of cylinders
. I hate showing an unpolished product, but what the hell, after I get a few more buildings and a few mile of road I will, ask me again in two weeks, I have to have something to show for my graduation project then.
Jake Wrote:I do my own object culling, it renders only a 90 degree slice of the trees.That's gotta be way better than nothing. Frustum culling would narrow that down, but judging by the screenshot you have, maybe not much. I'm sure somebody around here has a good link or two. I wish I could remember where I learned it from originally.
Jake Wrote:How come when I use just normals for my terrain surface only the ones pointing towards the camera are rendered, is this a coincidence?Most certainly not coincidence, but I don't understand your question enough to divine a response, although it seems like I've seen that before somewhere...
TomorrowPlusX Wrote:Yeah: It's a little counter-intuitive that culling is done by winding and not by normals. but so it goes.Of course it has to be that way, because you are free to perturb your normals however you like: face normals, averaged face normals, bumped normals...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Help With Procedural Tree Algorithm | Nick | 1 | 3,260 |
Jul 26, 2006 10:56 AM Last Post: unknown |
|
| Alternate Back face culling | Sohta | 6 | 4,124 |
Aug 6, 2004 06:10 PM Last Post: Sohta |
|
| tree rendering | NYGhost | 9 | 3,822 |
Jan 9, 2004 02:43 PM Last Post: NYGhost |
|
| Math problem involved in culling | DJBlufire | 5 | 2,889 |
Feb 4, 2003 06:35 PM Last Post: NYGhost |
|
| BSP tree compiler | ClarustheDogCow | 3 | 3,410 |
Jul 4, 2002 09:30 AM Last Post: ClarustheDogCow |
|

