Jump to content
  • Advertisement
Sign in to follow this  
cippyboy

Enviromental Mapping

This topic is 4969 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

Uh I thought that if I do Sphere mapping I`ll do just that, but no I gotta unrotate the texture matrix, so that it shows what`s on the other side. Sphere Mapping it`s almost like eye linear, the texture keeps "looking" at you. Any quick answers ? :D

Share this post


Link to post
Share on other sites
Advertisement
What are you talking about.
For enviroment mapping, you take the eye to vertex vector and reflect it with the vertex normal.
then you convert that resulting vector to a uv cordinate(either trough cubemapping or sheremapping).
then render the enviroment texture with those uv coordinates over the previously renderd geometry.

Share this post


Link to post
Share on other sites
What he is refering to is the facet of Cube Mapping that makes the cube map "world-aligned" by setting the rotation values of the texture matrix to those of the inverse of the modelview matrix. this works for a cool linear algebra rules that I wont get into here. However, because sphere map coordinate generation uses a stranger method to apply its environment mapping, you CAN NOT use this technique to encode world wrappable environment maps on sphere map texture generation. In order to support cube mapping style functionality on hardware that does not support it, you need to either precompute the tex coordinates, compute it yourself with a custom cubemapping implementation, or make your environment maps non-dynamic...at least those are the only solutions I have come up with...maybe there are others...google might offer some solutions

Share this post


Link to post
Share on other sites
Sorry for being late :D


Well imagine you have a texture that when mapped to a sphere(no cubemap) it represents the skybox, that`s what I get from 3DS Max when I export the image with the panoramic renderer. So... I got this texture Sphere Mapped onto an object, I must rotate it based on Camera Position so it shows exactly the oposite of the side I`m looking from right ? so the texture matrix must be rotated some way right ? I tryed some implementation, but the rotation works for only 90 degrees or so, not entirely 360...

Share this post


Link to post
Share on other sites
You are absolutly correct about the necessity to change the texture matrix to remap the environment map with the camera...unfortunatly, like I said before, you can only do that with a coordinate system that is manipulatable by a matrix (i.e. uses LINEAR transformations) . Like I said before, spheremapping is nonlinear, and to my knowledge therefore simple manipulations with the texture matrix are not enough to solve this problem. There is an nVida extention called texgen_reflection that is supposed to help with this, but I think it would be a LOT easier just to use cubemaps to store your environment maps, which are really simple to code and are LINEAR. To find out a better idea of what I am talking about, go to Environment Map explanation + cubemap tutorial

good luck

Share this post


Link to post
Share on other sites
Aha... well I Guess I`ll have to add that kind of implementation to my engine so... I`ll comment more when I`ll have it done :D

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!