🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Convincing trees

Started by
95 comments, last by VanKurt 20 years, 9 months ago
That sounds good. I''ll try that... thaks!
Advertisement
I agree with those who said that it looks like a 5-5-5-1 texture. Make sure to request a 32bit texture. Also, make sure that the alpha is correctly written and blended into the destination alpha. The better solution, though, is to directly use a render-texture (render to p-buffer, bind it).

What 3D card are you using ?
I''m using a radeon9500...

I also tried setting the internal format to GL_RGBA8 and RGBA16 but that had no effect.

While browsing through the web I read something about an render-to-texture-extension (ARB_render_texture or sth.). Maybe that would work better??
It looks to me you are "alpha testing" and not "blending".

www.cppnow.com
You can see a working implementation of some of the ideas discussed here by downloading the Gscape Editor.

The Gscape trees are procedurally generated. Different parts of the geometry are ''switched off'' as camera distance increases, then eventually the tree blends into an impostor.

Thousands of tree can be put into a scene if needed, although the Gscape system is not designed for low-end graphics cards.

The sixth part of the tree editor documentation discusses the LOD system, and there is a screenshot illustrating it.

The trees currently lack self-shadowing and look far better when this is in place. This screenshot shows this, although the shadows are not properly implemented yet (i.e. they are just plain black).

@superdeveloper
I''m not quite sure what you mean...?
quote: Original post by VanKurt
@superdeveloper
I''m not quite sure what you mean...?



Another thread... See JohnnyQuest''s remark



www.cppnow.com
It has been a while since this topic was active...
I''m sorry to bump it up again, but I don''t want to ignore that ugly little problem any longer. This image shows the comparison between the real tree (left) and the rendered texture (right). And they don''t look very similar ;-)



The texture seems to be somehow translucent but I can''t figure out why. I don''t think that something with the blending settings is wrong (Background alpha = 0, Rendered tree alpha = 1) when creating the texture, but maybe it is something with the antialiazing / mipmapping during the texture creation?
(Rendering the billboard is not the problem, too, I guess)

I''ve found out that this problem is bigger if the texture used on the tree is "finer" (like this needlemap).


Would it help to turn mipmapping off when rendering the billboard''s texture? How can I do that?


Thanks again!
It looks definately like an interpolation error caused by mipmapping. You may set the alpha to 1 but it gets blended with the neighbouring pixels of alpha 0. This will give you half-translucent pixels on the final image. That''s also the reason why the problem is bigger with needles: more transparent pixels next to needles. I don''t know how to turn mipmapping off thoug, but i doubt it''ll solve your problem very well because you will get rendering artifacts (which is why mipmapping was invented in the first place).

I propose this: Switch back to alpha testing instead of blending. This will give you your old error back ofcourse (hard, thick edges). Get rid of those edges by using antialiasing to fade the edges with the background. You may need some time to tweak the alpha settings and the antialias settings. Guessing fr4om the left image you already have an anti aliasing system, but rendering the billboard trees may require different settings though (more smoothing to get rid of the edges?)

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Yeah, that nasty mipmapping... ;-)

Thanks for your reply but I don''t understand this sentence:
"Get rid of those edges by using antialiasing to fade the edges with the background."

Of course I know what you mean but what I don''t know is how to "use" antialiasing (Can I switch that on and off or something?)...

This topic is closed to new replies.

Advertisement