View Full Version : tuxracer ice reflection
07-11-2002, 08:05 AM
I just want to know how ice reflection works in tuxracer
(he uses a env map ) but I don't know how ...
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
is not so good as in tuxracer
07-11-2002, 09:17 AM
This is going to be some kind of arctic stategy game, I take it? http://www.opengl.org/discussion_boards/ubb/smile.gif
07-11-2002, 09:22 AM
go to www.Mountain-tycoon.fr.st (http://www.Mountain-tycoon.fr.st)
07-11-2002, 09:54 AM
The terrain looks nice. http://www.opengl.org/discussion_boards/ubb/smile.gif
On one of your screenshoots ( http://raphael.siryani.free.fr/mountain/publique/mountaintycoon/screen/images/shoot030.jpg ) I see that there is some kind of atmoshperic effect in the backgrounds mountains. How do you do this? Is that fog or something special?
It looks more like snow to me ScottManDeath http://www.opengl.org/discussion_boards/ubb/smile.gif
(You can see it blend to it on the left hand side of the image)
But I could be wrong...
07-11-2002, 11:37 AM
I don't know how Tux Racer does it.
However, I do know that Sphere Maps don't look very good, and can't be updated dynamically because of the warping needed.
I suggest using cubic environment maps, which are a standard part of OpenGL 1.3, and an ARB extension that everyone supports before that.
If all you want is a reflection in a plane (like ice) then you can also look into various mirroring portal techniques, like virtually reflecting the camera position in the ice, and putting a clipping plane along the mirror plane, and re-rendering the scene in additive mode. (Stencil helps here, too) You can also render-to-texture using the same mirrored camera set-up, and put that texture on the ice.
Hope these ideas give you something to go on. Google should be full of hits if you plug in some of these words.
07-11-2002, 11:59 AM
thanks but such techniques is too expensive I just want to do a fake effect (like in tuxracer)
and the atmospheric is just some quad with a texture with a variant alpha channel (like in fs2002 )
07-11-2002, 12:30 PM
Just use eye linear automatic texture coordinate generation.
07-11-2002, 12:57 PM
ok I will try thanks
07-11-2002, 01:01 PM
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
I don't know how I can use the eye_plane params ... wich value and why thanks
[This message has been edited by IronRaph (edited 07-11-2002).]
07-11-2002, 01:27 PM
Just try this, and let me know what it looks like...
It should just look like the ice polys are like a mirror, reflecting whatver texture you use for them.
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
I'm assuming your terrain is in the XZ plane, with Y being 'up'.
[This message has been edited by knackered (edited 07-11-2002).]
07-11-2002, 09:28 PM
No this will look awfull.
07-11-2002, 11:47 PM
Nah, it'll look alright. Cartoon stylee!
07-12-2002, 05:49 AM
Texgen linear will not look like a reflection ESPECIALLY in object space as your sample code does.
Look at what you're suggesting, you just get an incrementing s coordinate along the x axis and t along the z axis.
In otherwords you've mapped a texture flat over a horizontal plane. Congratulations, but it won't look like a reflection, cartoon or no.
Eye linear won't be much better. It'll just swim a bit in z as the modelview changes.
07-12-2002, 08:34 AM
Oh yes, sorry IronRaph, I meant EYE not OBJECT. Just replace the word OBJECT with the word EYE in my code snippet.
Dorbie, it will look ok - it won't be 'correct', but it will look ok. Tuxracer is meant to run on really old cards - even ones with only a gl subset, such as voodoo2's.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.