🎉 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
Hum, that sounds cool. But I have to admit that I never created mipmap levels on my own... I''ll try to find some reading stuff about that...
Thanks!!
Advertisement
Mipmapping can be disabled with
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
do this when intializing the texture. also when u use rendering to texture and mipmaps make sure u make ur own mipmaps coz GL doesnt do that auto when u do glCopyTexImage2D so u end up with strange stuff.
i dont use mipmapping at all.

also making the mipmaps is expensive. resampling a 512x512 texture to 256x256, 128x128, etc will take some time.
however i dont know if gluScaleImage2D will use the hardware to resample wich should be fast


[edited by - Ilici on August 13, 2003 9:41:42 AM]
quote: Original post by Ilici
Mipmapping can be disabled with
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
do this when intializing the texture. also when u use rendering to texture and mipmaps make sure u make ur own mipmaps coz GL doesnt do that auto when u do glCopyTexImage2D so u end up with strange stuff.
i dont use mipmapping at all.

also making the mipmaps is expensive. resampling a 512x512 texture to 256x256, 128x128, etc will take some time.
however i dont know if gluScaleImage2D will use the hardware to resample wich should be fast


a) That doesn''t disable mipmaping, just switches to linear filtering. To disable mipmaping, don''t specify any mipmap levels other than level 0 (the texture itself).

b) I''m pretty sure gluScaleImage2D is done in software... I even had an occasion where it screwed up the mipmaps for some reason.

c) Using mipmaping is usually a good idea, and can improve performance. There are exceptions, of course.



Michael K.,
Co-designer and Graphics Programmer of "The Keepers"


We come in peace... surrender or die!
Michael K.
and

d) VanKurt needs to create his own mipmap levels so he can prevent that the alpha channel gets filtered. It''ll be as fast as his 1337 coding skillz can make it

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>

When making your mipmaps only resamble the RGB channels and calculate the alpha afterwards so it doesnt get messed.

I know mipmapping improves performance but when u create textures on the fly in realtime resampling them will cause a fps crash (if u dont make your own very fast resampling function to resample chuncked data).

Isnt there a way to resample using the hardware?
To the performance thing: If I create all textures WITHOUT mipmapping, the FPS are FOUR times lower!!!
Does that mean that I have to create all mipmaplevels lets say in PhotoShop using a nearest-nighbour filter for the a-channel and then set each of these images as an mipmaplevel during load-time?
That is one method. You can also do it once during the startup of your program and build the custom mipmap generator into your texture manager.

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>

I asked this earlier, but there was no response, so if anybody knows anything about this, drop a word. Yann said he uses the wind to move his trees, but then at the second LOD they''re replaced by a texture, so the trees would stop moving unless the texture for each tree was remade each frame, which would be needed anyways to render it at different angles. I can''t see how rendering the whole thing (cuz you''re still rendering THE WHOLE THING) to a texture speeds up things, though i can see how it''d reduce face count.

--===LITHIC===--
--===WWW.Decimation.TK===--
Because you can use multiple instances of the same imposter at higher LODs. It doesn''t matter if it is animated by the wind or not because you are not going to see it (unless the wind directions are radically different in different parts of the map).

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>

This topic is closed to new replies.

Advertisement