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

environment mapping

Started by raizde2 Nov 25, 2004 at 7:11 PM 1 replies 750+ views
Original Post
raizde2
raizde2
imagine a sphere reflecting a skybox and 2 small spheres rotating around it... if I remove the skybox on the render()... and build it, it still shows the skybox in the reflexion of the sphere but around the sphere no... as it should... ok... but if I remove the skybox on the GenerateEnvTexture()... and built it, the reflexion of the skybox disapears... alright...but the reflexion gets strange... like instead of the normal reflexion now it has about 5 diferente reflexions of the 2 spheres instead of just one... looking like a fly eye... with sectors... why? this happened to me in my demo... so I tried in the "Beggining OpenGL Game Programming" book source code of the 9 chapter and it happened the same... Anyone knows why does this happens and how to correct it without putting a skybox...
raizde2
raizde2
I made glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

instead of glClear(GL_DEPTH_BUFFER_BIT );

and now works...

lol so much time trying to discover... only when I post here I discovered the problem... oh well sorry about that...
Jarred Capellman
Jarred Capellman
For environment mapping of metal objects in my game I copy the screen into a 512x512 texture every frame (into the same texture) and then appy it to the metal object via multi-texturing. Obviously you have to create the texture before you render your 2D objects and weapon model or it will look really weird. On my system there isn't any performance cut doing it this way and it looks far more natural then then just applying a generic reflection map.

Topic Locked

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

Sign in to reply to this topic.