by date
Trees, lot of trees. (phase 4)
Trees, lot of trees. (phase 4)
| Name: | Claude-Alain Fournier | ![]() |
|---|---|---|
| Date Posted: | Feb 24, 2007 | |
| Rating: | 4.7 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Claude-Alain Fournier |
Blog post
The mandatory screenshot :

What's new from yesterday ? Well I have redone the code that decide when to draw the top view of a tree.
In the previous version, the calculation was done per quadrant, so all the trees of a quadrant will be having top view billboard shown. The result was not that good, specially if you are at the bottom of a hill, then even tree above you get the top billboard drawn. So I grabbed a beer to build up courage and attacked the vertex shader, finally managed to force the vertex shader to do all the work for me, so now the vertex shader decide for each tree if the top billboard should be drawn or not based on the view angle.
In the screenshot you can easily see the limit where the top billboard is drawn or not. I actually use a 45 degree angle.
Here is also a small video where you clearly see the change as the orc fall into the forest, then I made it run around in the cleared path so you see the change from 2d to 3d :
Click here for the video

What's new from yesterday ? Well I have redone the code that decide when to draw the top view of a tree.
In the previous version, the calculation was done per quadrant, so all the trees of a quadrant will be having top view billboard shown. The result was not that good, specially if you are at the bottom of a hill, then even tree above you get the top billboard drawn. So I grabbed a beer to build up courage and attacked the vertex shader, finally managed to force the vertex shader to do all the work for me, so now the vertex shader decide for each tree if the top billboard should be drawn or not based on the view angle.
In the screenshot you can easily see the limit where the top billboard is drawn or not. I actually use a 45 degree angle.
Here is also a small video where you clearly see the change as the orc fall into the forest, then I made it run around in the cleared path so you see the change from 2d to 3d :
Click here for the video
Recent Blog Posts
| List: | 03/04/07 - Trees, lot of trees. (phase terminal ?) 02/24/07 - Trees, lot of trees. (phase 4) 02/23/07 - Trees, lot of trees. (phase 3) 02/01/07 - Trees, lot of trees. (phase 2) 01/26/07 - Trees, lot of trees. |
|---|
Submit your own resources!| James Bond (Feb 24, 2007 at 15:33 GMT) |
| Frank Carney (Feb 24, 2007 at 16:13 GMT) |
| Florian (Feb 24, 2007 at 16:32 GMT) |
other than that, lookin great :)
| Stephan (viKKing) Bondier (Feb 24, 2007 at 16:59 GMT) |
Another beer? ;-)
| Tom Eastman (Eastbeast314) (Feb 24, 2007 at 17:00 GMT) |
| Claude-Alain Fournier (Feb 24, 2007 at 17:27 GMT) Resource Rating: 4 |
Yes and no ;) The problem will always be that the trees are not always facing the same as the billboard pic. Also you need some skill to make the 2d pic realy match the color of in game tree, I can't, I am not an artist so this is about the best I can do, but no doubt good artists will be making something better.
@Florian
This is fully configurable, there are some variable that are currently only set in code, but I will make them visible to script so you have full control. But for performance reason you realy want to play with the settings, with 100'000 tree forest you can't have a too large area in 3d or the fps won't follow. But in less dense forest you can have a larger area covered by 3d trees. I am developping with a large forest as test, but I doubt anyone will realy want that much tree in such an area, let say that at least it will be supported ;)
| Todd Pickens (Feb 24, 2007 at 18:40 GMT) |
VERY NICE! that is good progress.
And once again, sorry for the delay in getting back to on the tree work. Once the GDC crunch time is over, I will be able to work with you in it.
| Vashner (Feb 24, 2007 at 21:09 GMT) |
| Orion Elenzil (Feb 24, 2007 at 21:57 GMT) |
Quote:
In the screenshot you can easily see the limit where the top billboard is drawn or not. I actually use a 45 degree angle.
hi Claude -
one easy way to mitigate the visibility of the boundary there
would be to use a per-tree random modification to the threshhold angle.
like +/- five or ten degrees.
| Claude-Alain Fournier (Feb 24, 2007 at 22:41 GMT) Resource Rating: 4 |
Yes that's a pretty good idea actually. but shader language does not have random generator. I would have to find another way, maybe take the second decimal of the X axis position of the tree to define the variation +- 10 degrees. That's something I will experiment.
@Todd
No problem, I am still working on getting the code do what I want, no hurry here.
| Francis (Feb 25, 2007 at 09:20 GMT) |
| Juha Eerola (Feb 25, 2007 at 15:34 GMT) |
| Jesse Kaukonen (Feb 26, 2007 at 12:33 GMT) |
I'd like to see you walking deeper into the forest. Does it affect the FPS much?
Edited on Feb 26, 2007 12:36 GMT
| Claude-Alain Fournier (Feb 26, 2007 at 16:50 GMT) Resource Rating: 4 |
Yes once I get server side collision fixed.
@Jesse
The sky is the one from water demo from TGEA. you can see video of walk in forest here
look at the whole album there are few sceenshots and 2 videos.
Performance decrease depending on the density.
Edited on Feb 26, 2007 16:51 GMT
| Marc Schaerer (Feb 28, 2007 at 17:30 GMT) |
If the billboards used the ground color similar to the way the shapes do, one would perhaps never notice the change in the latest video :-)
| Aun Arinyasak (Mar 04, 2007 at 04:03 GMT) |
Aun.

You must be a member and be logged in to either append comments or rate this resource.



4.7 out of 5


