Real time reflections


I want to make an object reflect it surrounding  not just 1 texture like in environment map test

Is this possible without any knowledge of shaders ?

##edit: something like the floor reflections is what im looking for, i checked out the code from cvs but i couldn’t find anything related to the reflections

I also came across but i cant get it to work

SEVERE: Shader uniform [refractionTranslation] could not be located in shader

SEVERE: Shader uniform [normalMap] could not be located in shader

16-jun-2008 12:56:13 class com.jme.renderer.lwjgl.LWJGLTextureRenderer render(Spatial, Texture, boolean)

SEVERE: Exception


at com.jme.renderer.lwjgl.LWJGLTextureRenderer.doDraw(

at com.jme.renderer.lwjgl.LWJGLTextureRenderer.render(

at com.jme.renderer.lwjgl.LWJGLTextureRenderer.render(

at com.jme.util.ReflectRenderPass.renderReflection(

at com.jme.util.ReflectRenderPass.doRender(

at com.jme.renderer.pass.Pass.renderPass(

at com.jme.renderer.pass.BasicPassManager.renderPasses(

i only get a black semi transparent plane and mouse input is suddenly inverted.

any help is appreciated


The exception hints at you executing the code outside the open gl thread.

What you want to accomplish takes a lot of processing power in opengl. Search for render to texture.

You will have to render your scene twice, once to texture to display this on the object and once with the camera that then renders the scene.

Realtime reflections are something that is better suited with raytracing but I fear you will have to wait another year to get that on a regular computer running in real time.

i removed the reflection pass from physics fun (the link you referred to) because it was a bit buggy and used too much performance.

you can still grab the code from the svn revision 20:

Dynamic reflections are now the industry buzz so don't expect anything like that soon. Doing that requires some form of GPU ray-tracing. For now you'll have to live with cubemap samples at various locations or use plane reflection like in core-dump's code.

you can approximate it by rendering the 6 views around an object to textures and using them as a cubemap for it…

> here < is the other thread i got the reflection pass from.

its easier to get the source from there than through svn i think.

Thx for the reply, i haven't had a chance to deep digger into this… yet.

Im not looking for anything fancy just an approximate  reflection of the surrounding  on a moving sphere, something like a shiny chrome ball or something.

@mr coder

that sounds like a good idea  but is cubemapping also in jme 1 ? i think i read somewhere that it was new in jme2


cubemapping is only available for jME2. it's best to switch to jME2 now while there are not many changes in, later on you will find yourself using an old and buggy engine and switching will be a big headache.