I think it uses shadow texture as if it's in worldspace, but looks like it's not. I'm not sure why, since I used light view matrix inverse to translate to worldspace as I did for other deferred textures: http://goo.gl/JRRq6Y But if we consider images on the left as worldspace, the images on the right are clearly not in worldspace. But I really don't get why.
2013/10/11 michael kapelko <korn...@gmail.com> > (Repeating since I erroneously replied to Sebastian only). > > Thanks. I used osg::Matrixf explicitely, and it doesn't complain anymore. > However, I get misplaced shadows now, they're always facing the main > camera: http://youtu.be/2pyE1G0752k > This is my: > 1) 1 pass light camera VS: http://goo.gl/JRRq6Y > 2) 1 pass light camera FS: http://goo.gl/fIYeze > 3) 2 pass main camera FS: http://goo.gl/nBdWwr > > > What am I doing wrong? > Thanks. > > > 2013/10/11 Sebastian Messerschmidt <sebastian.messerschm...@gmx.de> > >> Am 11.10.2013 08:39, schrieb michael kapelko: >> >> Hi. >> Thanks for the info. I'm now using shaders to process depth: >> 1) vertex: http://goo.gl/G9ehmB >> 2) fragment: http://goo.gl/bAutb1 >> As you see, I'm trying to output depth texture in world space using 'vmi' >> (view matrix inverse) which I apply later in the 2nd pass. >> vmi setup: http://goo.gl/n3A84N >> However, when I start the program, it prints 2 errors: >> 1) Cannot assign between Uniform types dmat4 or mat4 and int >> at: >> uniform->set(osg::Matrix::inverse(pass1LightDepthSRTTCamera->getViewMatrix())); >> call >> >> The types are not matching. I'm usually doing the same call. Basically >> you cannot auto pass double matrix to float matrix uniforms. >> Try to call it like this: >> osg::Matrix MVPT = ( ... ); >> mStateSet->getOrCreateUniform("vmi", osg::Uniform::FLOAT_MAT4)->set(MVPT); >> >> Also you are setting the matrix only once here. It should be updated in a >> callback if your light position changes. >> >> >> >> >> 2) Warning: detected OpenGL error 'invalid operation' at After >> Renderer::compile >> at: mat4 modelMatrix = vmi * gl_ModelViewMatrix; >> >> I took the uniform setup code from osgUtil::SceneView: >> http://goo.gl/6OvdLr >> So I really don't understand what I'm doing wrong. Any help? >> >> Thanks. >> >> >> >> 2013/10/10 Marcel Pursche <marcel.purs...@student.hpi.uni-potsdam.de> >> >>> Hi, >>> >>> your other buffers use the rectangle format. This texture format can be >>> accesed with unormalized coordinates [0, texturesize]. Regular 2D textures >>> need to be accessed with normalized texture coordinates [0, 1]. >>> >>> Thank you! >>> >>> Cheers, >>> Marcel >>> >>> ------------------ >>> Read this topic online here: >>> http://forum.openscenegraph.org/viewtopic.php?p=56731#56731 >>> >>> >>> >>> >>> >>> _______________________________________________ >>> osg-users mailing list >>> osg-users@lists.openscenegraph.org >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >>> >> >> >> >> _______________________________________________ >> osg-users mailing >> listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> >> >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org