tree rendering
I didn't realize how difficult it would be rendering a tree made out of planes.
I still cannot get them to render perfectly because of the way the depth buffer works (writes the whole triangle area to depth buffer).
The best I could do was to render the tree without depth test, then render again with depth test on but not very efficient if I render hundreds of trees.
I read on the web that the best think I could do is to use the painter algorithm to sort the planes and render back-forward.
I think the solution is vertex shading??
Any suggestions?
Thanks..![[Image: a.jpg]](http://shamrock.med.nyu.edu/~garcij01/a.jpg)
I still cannot get them to render perfectly because of the way the depth buffer works (writes the whole triangle area to depth buffer).
The best I could do was to render the tree without depth test, then render again with depth test on but not very efficient if I render hundreds of trees.
I read on the web that the best think I could do is to use the painter algorithm to sort the planes and render back-forward.
I think the solution is vertex shading??
Any suggestions?
Thanks..
![[Image: a.jpg]](http://shamrock.med.nyu.edu/~garcij01/a.jpg)
I think what is meant is to disable depth writing, not depth testing, while rendering the trees. However, this isn't a good solution either since the trees are mostly opaque. That usually only works well with mostly transparent textures (although I think I remember someone saying there was a blending mode that took source alpha into account and didn't draw pixels if the source alpha was opaque. I don't remember what that is at the moment). I don't think you can get a completely accurate rendering even with sorting, since the planes can overlap in a ring and break the painter's algorithm. You would need to subdivide the geometry to overcome that problem. Instead, disable depth writing AND sort the planes, and if the case is that the planes ring overlap, then you'll get a better approximation than with a funky depth test overlap.
There is some PhD work done at my school just about tree rendering. They render thousands of polygonal trees on high-end hardware, but they use impostors instead of rendering the actual polygons for all trees.
One option you have is at distances at least, is to prerender the trees. That way, you can have one planar surface rendered rather than a combination of many.
Easy and fast way... set alphafunc to greater than .5 or so, and turn off GL_BLEND. Keep depth testing and writing.
Sharp looking trees man. I cant see the problem in the screenshots you posted and I bet most players wont either.
menace690 Wrote:prerender the trees.That would work if I never got close to the trees, but I will be flying over the trees .
JeroMiya Wrote:I think what is meant is to disable depth writinSorry, Yes that's what I meant.
That's exactly what I'm doing but popups and drawing artifacts are too distracting, I'll try another modeling approach.
Thanks for your support to all of you...
DoG Wrote:There is some PhD work done at my schoolIs there a link I can go to?
Thanks...
codemattic Wrote:I cant see the problem in the screenshots you posted and I bet most players wont either.
Thanks. Is very noticeable when the camera is moving around them
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Help With Procedural Tree Algorithm | Nick | 1 | 3,259 |
Jul 26, 2006 10:56 AM Last Post: unknown |
|
| Tree Culling | Jake | 13 | 5,312 |
Jan 7, 2005 02:44 AM Last Post: arekkusu |
|
| BSP tree compiler | ClarustheDogCow | 3 | 3,406 |
Jul 4, 2002 09:30 AM Last Post: ClarustheDogCow |
|

