Re: [osg-users] Reflection cube map with shader

2013-03-27 Thread Sergey Polischuk
Hi environment->set(cubemap.get()); should be environment->set(int(unit)); Cheers 27.03.2013, 18:45, "Andrea Martini" : > Hi, > i'm trying to apply a reflection effect on a sphere, using a cube map. > I'm using as vertex shader dthe following : > > Code: > > #version 400 compatibili

Re: [osg-users] Reflection cube map with shader

2013-03-27 Thread Andrea Martini
Hi hybr(), thank you. Now it works! I have to change something to update the reflected image on camera moving ... i have to check. Thank you again. Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53349#53349

Re: [osg-users] Reflection cube map with shader

2013-03-27 Thread Sergey Polischuk
in vertex shader add line ReflectDir = (osg_ViewMatrixInverse * vec4(ReflectDir,0)).xyz; after ReflectDir = reflect(eyeDir, normal); 27.03.2013, 20:27, "Andrea Martini" : > Hi hybr(), > thank you. Now it works! > > I have to change something to update the reflected image on camera