# Spherical Mapping queries

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

## Recommended Posts

I'm working on implementing environment mapping atm and have come across some problems with my spherical mapping. I can get an object to render a spherical environment map, but the reflection it generates is upside down and flipped vertically. I'm not sure as to why this is happening. I have cubic mapping working in the same scene and it renders fine. Here is some of the code I use for spherical mapping

// load the sphere map into the g_pSphereMap object
D3DXCreateTextureFromFileEx(g_pD3DDevice, "spheremap.jpg", 256, 256, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &g_pSphereMap);

g_pD3DDevice->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_SPHEREMAP | 0);

g_pD3DDevice->SetTexture(0, g_pSphereMap);


And then I render my object. Can anyone suggest why it might be acting like this? Just an added question, as far as I understand, a spherical map works only for one point in space. So you can't move the object around and expect it to reflect correctly. Does this one point in space also mean just one perspective, aka one direction of view at the object, or should you be able to rotate around the object and see the reflection. I'm thinking you should but i'm not sure how to pass the translations into the texture coordinate generation. Cheers for your help.

##### Share on other sites
(cough) BUMP (cough) :)
Any thoughts on this anyone?

No?

##### Share on other sites
No one has any ideas?
Sorry to bump this thread again, but i'm really stuck for an answer.

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 38
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631710
• Total Posts
3001846
×