Jump to content
  • Advertisement
Sign in to follow this  
raizde2

OpenGL environment mapping

This topic is 4950 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
Advertisement
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!