EnvMap usage confusion

Preliminary:

I use an env map on objects in my in-development application for some months now.

When i added it, there were the EnvironmentalMapModes None, Ignore and Sphere.

First two did around nothing, sphere of course did something but it didn’t look to good on my more cube-like objects.

Until today i told myself that there surely is missing something and that i just had to wait until it is implemented.



I updated my jme build today from the CVS and now i see there are new modes.

EYE_LINEAR and OBJECT_LINEAR.



It COULD be what i need, but sadly i don’t see how to use it correctly.







I modified the TestMultiTexturePass application.

TextureState 1&2 are some nonsense textures (red with blue lines and transparent with white lines) for some alpha combine testing stuff.

As TextureState 3, i added the env map (blue natural-grid-like) with OBJECT_LINEAR (tested EYE_LINEAR as well)







As the screenshots show, it looks rather funny.

The EnvMap is just a tiny patch with a moreless fixed postion on the screen, randomly hitting the cube when the camera has the right facing.

This can’t be how it’s supposed to look, so there must be something more to it.







I thought it should look more like something the second screenshot shows.

For this one, i set the scale of the cube to 0.05 and then moved the camera closer.

Which is no real solution of course.

The “screen-fixed” state of the envMap is still there. As soon as the camera turns, the envMap slides away from the cube.

And of course i can’t scale down everything to a few percent, nor can i use a 100,000 x 100,000 texture just to get the whole screen covered with it.



So finally, the question is:



How do i get the envMap to look like something like the second picture, but for a variable object size and sticking to the object (like it does with EM_SPHERE)

(Or if i may put it that way: To get a “normal” envMap look…)





I hope you know what i mean ^^ and can help me

Sounds like you want Spherical mode, but with different texture coords (treat the corners as points on a sphere, instead of faces) on the texture unit that holds your environmental texture.

renanse said:

Sounds like you want Spherical mode, but with different texture coords (treat the corners as points on a sphere, instead of faces) on the texture unit that holds your environmental texture.

Thank you for your answer, renanse.
Sadly, i don't understand what you're talking about.

How do i treat corners as points on a sphere instead of faces? o_0



Apart from that, are there any examples available for that EYE_LINEAR or OBJECT_LINEAR modes that show how to use them properly?