Environment mapping troubles

Post Reply
pslDev
Posts: 5
Joined: Thu Jun 13, 2013 10:40 am

Environment mapping troubles

Post by pslDev » Thu Jun 13, 2013 1:02 pm

Hi everyone,

I'm trying to implement a spherical reflection feature on a nds 3d render engine i'm working on, as a final project, but I'm having trouble to get the effect right. I based my code on the libnds example (Env_mapping) but it's not working, so i wish someone could explain me the process, to see what i'm doing wrong. I searched info about this topic but i found nothing.

What i do is to set a texture with TEXGEN_NORMAL parameter to generate the texture coordinates in that way and when i apply it, in texture matrix mode, i do a scaling operation, just like in the example, to set the range from normals [-1, 1] to texture coordinates range. I do not understand the 16 bits shift its done in the example in order to scale. Does this value depend on the texture dimensions?

The result is not good, as the mesh doesn't seem to be centered on the texture.

Finally, is it necessary to send the TexCoord command? The gbatek specs says something about that but i don't really understand it.

Thanks in advance.

pslDev
Posts: 5
Joined: Thu Jun 13, 2013 10:40 am

Re: Environment mapping troubles

Post by pslDev » Fri Aug 02, 2013 7:18 pm

No one knows?? Please it's very important! It would be great if i could fix this!! :D

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests