Re: [osg-users] osgShadow texture problem
nothing? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=37290#37290 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow texture problem
In attachment osg file that doesn't work. When I activate osgShadow, I can't see texture. In osg file there's field textureUnit 0 {}. If I remove this and change, texture works. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36550#36550 PositionAttitudeTransform { name Collada visual scene group nodeMask 0x cullingActive TRUE StateSet { DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT } referenceFrame RELATIVE position 0 0 0 attitude 0.707107 0 0 0.707107 scale 1 1 1 pivotPoint 0 0 0 num_children 1 MatrixTransform { name Strada_Dritta_01 nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 } num_children 1 Geode { nodeMask 0x cullingActive TRUE num_drawables 1 Geometry { DataVariance STATIC name lambert4SG StateSet { DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT GL_CULL_FACE ON Material { ColorMode OFF ambientColor 0 0 0 1 diffuseColor 1 1 1 1 specularColor 0 0 0 1 emissionColor 0 0 0 1 shininess 0 } textureUnit 0 { } textureUnit 1 { GL_TEXTURE_2D ON Texture2D { file C:\\Documents and Settings\\All Users\\Documenti\\ARGame\\Texture_DEF\\Strada_Dritto.jpg wrap_s REPEAT wrap_t REPEAT wrap_r CLAMP min_filter LINEAR_MIPMAP_LINEAR mag_filter LINEAR maxAnisotropy 1 borderColor 0 0 0 0 borderWidth 0 useHardwareMipMapGeneration TRUE unRefImageDataAfterApply TRUE internalFormatMode USE_IMAGE_DATA_FORMAT resizeNonPowerOfTwo TRUE shadowComparison FALSE shadowCompareFunc GL_LEQUAL shadowTextureMode GL_LUMINANCE } TexEnv { mode MODULATE } } } useDisplayList TRUE useVertexBufferObjects FALSE PrimitiveSets 1 { DrawElementsUInt TRIANGLES 132 { 0 3 6 6 3 8 40 43 49 49 43 46 10 12 14 14 12 17 36 38 1 1 38 4 5 39 9 9 39 30 37 2 33 33 2 7 55 52 61 61 52 58 15 26 11 11 26 23 16 18 27 27 18 28 20 29 13 13 29 19 34 31 24 24 31 21 26 37 23 23 37 33 27 28 36 36 28 38 30 39 20 20 39 29 6 8 41 41 8 44 9 30 45 45 30 47 32 35 48 48 35 50 33 7 51 51 7 42 25 22 56 56 22 53 20 13 54 54 13 59 12 10 60 60 10 62 11 23 63 63 23 57 } } VertexArray Vec3Array 64 { 0.999613 0 0.999415 0.999613 0 0.999415 0.999613 0 0.999415 0.999613 0 -0.999398 0.999613 0 -0.999398 0.999613 0 -0.999398 0.999613 0.00739819 0.999415 0.999613 0.00739819 0.999415 0.999613 0.00739819 -0.999398 0.999613 0.00739819 -0.999398 -0.999199 0.00739819 0.999415 -0.999199 0.00739819 0.999415 -0.999199 0.00739819 -0.999398 -0.999199 0.00739819 -0.999398 -0.999199 0 0.999415 -0.999199 0 0.999415 -0.999199 0 0.999415 -0.999199 0 -0.999398 -0.999199 0 -0.999398 -0.999199 0 -0.999398 -0.807709 0.00739819 -0.999398 -0.807709 0.00739819 -0.999398 -0.807709 0.00739819 -0.999398 -0.807709 0.00739819 0.999415 -0.807709 0.00739819 0.999415 -0.807709 0.00739819 0.999415 -0.807709 0 0.999415 -0.807709 0 0.999415 -0.807709 0 -0.999398 -0.807709 0 -0.999398 0.807909 0.00739819 -0.999398 0.807909 0.00739819 -0.999398 0.807909 0.00739819 -0.999398 0.807909 0.00739819 0.999415 0.807909 0.00739819 0.999415 0.807909 0.00739819 0.999415 0.807909 0 0.999415 0.807909 0 0.999415 0.807909 0 -0.999398 0.807909 0 -0.999398 0.999613 0.0239958 0.999415 0.999613 0.0239958 0.999415 0.999613 0.0239958 0.999415 0.999613 0.0239958 -0.999398 0.999613 0.0239958 -0.999398 0.999613 0.0239958 -0.999398 0.807909 0.0239958 -0.999398 0.807909 0.0239958 -0.999398 0.807909 0.0239958 -0.999398 0.807909 0.0239958 0.999415 0.807909 0.0239958 0.999415 0.807909 0.0239958 0.999415 -0.807709 0.0239958 -0.999398 -0.807709 0.0239958 -0.999398 -0.807709 0.0239958
Re: [osg-users] osgShadow texture problem
I find the problem: some models (made in Maya and exported in Collada then in osg), in osg file have texture 0 empty. Perhaps in shadowed scene this is an important value. If I remove empty texture and I change other texture numbers it works. Have you got some ideas about this? thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36529#36529 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow texture problem
I notice that with some models textures works. What could be the problem? thanks!!! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36486#36486 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow texture problem
Hi, with some shadow techniques they take base texture unit value, try setting that value. Maybe that will help out. Are you rendering in Shaders or Fixed function pipeline? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36488#36488 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow texture problem
Hi, I put sm-setTextureUnit(1); but it doesn't change. I don't know if it's rendering in Shaders or Fixed, how do I check it? I can't understand why some models works and others not. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36496#36496 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow texture problem
Hi Daniele, It could be that some models are using multi-texturing or are the state in the models doesn't work well with the shaders used by osgShadow. The best way to work out what the different models are doing is to export then to .osg or .osgt (if you are using 2.9.x or svn/trunk) and then have a look at the resulting ascii file as it will list all the state that is being setup, and what texture units are active. Robert. On Wed, Feb 9, 2011 at 2:53 PM, daniele argiolas arj...@gmail.com wrote: Hi, I put sm-setTextureUnit(1); but it doesn't change. I don't know if it's rendering in Shaders or Fixed, how do I check it? I can't understand why some models works and others not. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36496#36496 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://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
Re: [osg-users] osgShadow texture problem
I'll add that (at least in version 2.8.3) changing the texture unit for the shadows does not update the shadow technique's shader code. You'll have to override the default shader code to align with whatever texture unit you choose to use for the shadows. Cheers, Steven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36509#36509 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org