Skip to main content
GameDev.net gamedev.net
🔒 Locked

Realistic Tree Optimization

Started by falkone Jul 12, 2003 at 11:14 PM 6 replies 650+ views
Original Post
falkone
falkone
I had a lot of free time on vacation, so I thought a bit about this. I have no idea if this has come up before.. but I haven't seen it. I've heard the suggestions of using lower detail models farther away.. and then eventually billboarding.. and I've wondered if there was another way. Instead of using 2D textures for billboarding, why not use 2D vertex based models? These models would be flat, and would use very few vertices.. they could be generated before runtime or at runtime by flattening the tree model, breaking the flattened version into convex polygons, then removing all the extra vertices inside inside the shapes. This way, the minimum number of vertices needed to define the tree will be used while still retaining the exact shape of the tree at a given angle. Now, any number of these 2d models could be generated for all the different directions the tree could be viewed at (and they would be much much less expensive than full sized bitmap images). The cool thing about these would be that the transition from one viewing angle to another would be fluid, as you could interpolate the vertices between the two states (though it would be linear, more angles (or circular interpolation?) could be added to increase realism.. and decreased at distance). Though i don't foresee any problems with the interpolation.. it might not work as well as I think (getting vertex ordering to look right during transition may be a pain). As for the foliage, i think it could be drawn in the lower LOD mode as it would be in the higher one, just without as much detail.. i don't think it would look very good when this applies to it. As for texturing? I'm not sure. I guess the quick hack would be to apply a texture that looked good, and then applying it with constant world space coordinates (enviroment mapping?) as opposed to object space. This would increase the realism of the illusion of the tree as you turn around it.. Of course, this would only be used on distant trees... but i think it's a viable solution. Anyone else see some glaring problem with it? I can imagine the implementation won't be quite as easy as the explanation.. but i see no reason why it can't be done. Any other pros/cons i have missed? I'm just interested on your input.. please discuss.. and be gentle . BTW, Sorry if this is a well known concept or anything.. if it is, just say so and i'll move on (or point me to some papers.. i'd be interested).. i just haven't seen it
Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
JohnBolton
JohnBolton
quote:
Now, any number of these 2d models could be generated for all the different directions the tree could be viewed at (and they would be much much less expensive than full sized bitmap images).
all the different directions? Thats a lot of models. What''s the benefit?
quote:
The cool thing about these would be that the transition from one viewing angle to another would be fluid, as you could interpolate the vertices...
You can''t interpolate because you have removed different vertices from each model.
quote:
Of course, this would only be used on distant trees...
If it is used only on distant trees then how is this better than a billboard or a very low-poly LOD?

John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
falkone
falkone
The advantage of the models as opposed to billboards would be that much less memory would be used.. say you have a model with 100 vertices.. a single one would be about (100 vertices * 3 coords * 4-byte float = 1200B.. now, 256 directions of that would be approx 300KB, yes? Seems much cheaper than a 128x128x24 bitmap, 256 of which would require over 12 MB (if i''m calculating correctly)). To take up the same amount of space as a model, the bitmaps would have to be 20x20 pixels (assuming 24bpp depth) (and again, if my math is correct).

The advantage over low poly models would be that the exact outline of the tree can be preserved.. so there would be less noticeable transition.

As for the interpolation.. yes, i realized afterward that to make it look right, vertices would be created... and i don''t see an elegant solution to it

Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
ApochPiQ
ApochPiQ
You''ve misunderstood the concept of billboards. A billboard does not have a separate image for each view direction -- that would be absurd. A billboard has (usually) two images, one for one angle, and one rotated by 90 degrees. Sometimes there are 4 or 5 different images, but I am not aware of any commercial games which use more than 2 billboard images.
falkone
falkone
I certainly didn't mean the 256 images as a practical example, just as a comparison of how much memory each one would take. In using the term 'Billboarding', i'm referring to an image that always faces the camera.

[edited by - falkone on July 13, 2003 3:09:10 PM]
Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
RomSteady
RomSteady
In general, billboards are used when you are worried about being transform-bound, or if you want a cheap special effect like a particle system (your particles can be billboards). Billboards use at most 4 vertices (or 1 if you are using a point sprite instead).

To be honest, it sounds like you are looking for a problem you can solve with your solution. Generally, that is a bad way to try to code, as when you have a hammer, all problems look like nails.

Given what it sounds like you are trying to do, you may want to check out some object LOD systems. There have been some which use billboards as the lowest LOD.
Michael Russell / QA Manager, Ritual EntertainmentI used to play SimCity on a 1:1 scale.
falkone
falkone
What i''m saying about this method is that it would not suffer the horrible popping that would occur with prebuilt billboarded images.



Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.