Re: [osg-users] Why is it that no matter what The model material properties value reset the are Always invalid?
mirro wrote: > Hi, > > //There seems to be a texture coordinate error... > > > Code: > > _eftManager->getPassStateSet(pid)->setAttributeAndModes(loadProgram( > "varying vec3 vLocalVertex;\n" > "varying vec4 TextureCoord0;\n" > > "void main()\n" > "{\n" > " vLocalVertex = gl_Vertex;\n" > " TextureCoord0 = gl_TextureMatrix[0] * > gl_MultiTexCoord0;\n" > " gl_Position = ftransform();\n" > "}\n" > "\n" > , > "uniform sampler2D default_map;\n" > "varying vec4 TextureCoord0;\n" > "varying vec3 vLocalVertex;\n" > "uniform float hdrExposure;\n" > "uniform float hdrGamma;\n" > > "vec3 decodeRGBE(vec4 rgba) \n" > "{ \n" > " float f = pow(2.0, rgba.a * 255.0 - (128.0 + 8.0)); > \n" > " return rgba.rgb * 255.0 * f; \n" > "} \n" > > "vec3 toneMapHDR(vec3 rgb) \n" > "{ \n" > "return pow(rgb * 1.0, 1.0 / vec3(2.2));\n" > "} \n" > > "vec4 textureSphere(sampler2D texture,vec3 n) \n" > "{ \n" > "const float PI = 3.14159;\n" > "float yaw = acos(n.y) / PI;\n" > "float pitch = (atan(n.x, n.z) + PI) / (2.0 * > PI);\n" > "return texture2D(texture, vec2(pitch, yaw));\n" > "} \n" > > "void main()\n" > "{\n" > " vec3 normal = > normalize(vLocalVertex.xyz);\n" > " vec3 c = > toneMapHDR(decodeRGBE(textureSphere(default_map, normal)));\n" > " gl_FragColor = vec4(c, 1.0);\n" > "}\n" > "\n" > ), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); > > > > > Thank you! > > Cheers, > Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76870#76870 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How can I post files and images in the forum?
Hi, :-* :-* :-* :-* :-* :-* Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76862#76862 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] why would The Hdr Effects disappeared from hdrExample after scene adding to the ive format model?
Hi, What are the requirements for this model format for this effect or can't be displayed because the parameter settings are incorrect? Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76861#76861 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] I don't quite understand this part of code from hdr examle, can anyone elaborate more?
mirro wrote: > Hi, >If so, what are the causes of The Hdr Effects disappeared? > Thank you! > > Cheers, > Mirro[/b] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76858#76858 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] why the "adaptedlum->addChild(brightpass)" code is doing what it does In the osgPPU hdr example
Hi, // The adapted luminance ppu do compute it. However if you // can follow me for now, you maybe encounter, that this ppu do // have to write into the same texture as it also read from. // To prevent this, we just generate an inout ppu which do // nothing than render the copy of input to the output. // We will use the output of this ppu as input for the // adapted luminance ppu. In this way we do not write to the // same texture as we have readed from. osgPPU::UnitInOut* adaptedlumCopy = new osgPPU::UnitInOut(); adaptedlumCopy->setName("AdaptedLuminanceCopy"); adaptedlumCopy->addChild(adaptedlum); // now connect the output of the adaptedlum with the rest where it is needed adaptedlum->addChild(adaptedlumCopy); adaptedlum->addChild(brightpass); brightpass->setInputToUniform(adaptedlum, "texAdaptedLuminance"); adaptedlum->addChild(hdr); hdr->setInputToUniform(adaptedlum, "texAdaptedLuminance"); Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76854#76854 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] To run this Examples osgdeferred , where to download this osgdeferred about Data Resources ?
d_a_heitbrink wrote: > They are kept in a separate repo: > https://github.com/openscenegraph/OpenSceneGraph-Data > > Do keep in mind the license for said data is different: > From GitHub: > > If not otherwise specified all files in the OpenSceneGraph-Data are provided > free for non commericial usage. Commericial users may use the data for > testing and development purposes, but may not distribute these models with > commericial products. Error reading file textures/brow.l.tga: file not found Error reading file textures/nose.tga: file not found Error reading file textures/mouth.tga: file not found Error reading file textures/eye.l.tga: file not found Error reading file textures/dark_grey.tga: file not found Error reading file textures/red.tga: file not found so,Where are these resources downloaded from? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76841#76841 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] To run this Examples osgdeferred , where to download this osgdeferred about Data Resources ?
Hi, For example ,shaders/pass1Shadow.frag Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76834#76834 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How can we make 'osg' thread and 'ui' thread send messages to each other?
Hi, How to solve the problem with UI Thread conflict Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76346#76346 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] why does the adding of lighting, colour and fusion to the "shader" model result in the opacity of its windowpane?
Hi, Code: const char* gl2_VertexFaceShader = { "vec4 directionalLight(in vec3 normal,in vec4 color)\n" "{\n" " float NdotL = dot(normal, normalize(gl_LightSource[0].position.xyz)); \n" " NdotL = max(0.0, NdotL); \n" " float NdotHV = dot(normal, gl_LightSource[0].halfVector.xyz); \n" " NdotHV = max(0.0, NdotHV); \n" " color *= gl_FrontLightModelProduct.sceneColor + \n" " gl_FrontLightProduct[0].ambient + \n" " gl_FrontLightProduct[0].diffuse * NdotL; \n" " if (NdotL * NdotHV > 0.0)\n" " color += gl_FrontLightProduct[0].specular * pow(NdotHV, gl_FrontMaterial.shininess); \n" " return color;\n" "}\n" "varying vec2 texCoord;\n" "varying vec4 vertexColor;\n" "void main(void)\n" "{\n" "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" "texCoord= gl_MultiTexCoord0.xy;\n" "vec3 normal = normalize(gl_NormalMatrix * gl_Normal);\n" "vertexColor = directionalLight(normal,gl_Color); \n" "}\n" }; const char* gl2_FragmentFaceShader = { "uniform vec3 highlightColor;\n" "uniform float transparency ;\n" "uniform sampler2D baseTexture;\n" "varying vec2 texCoord;\n" "varying vec4 vertexColor;\n" "void main(void)\n" "{\n" "gl_FragColor = vertexColor * texture2D(baseTexture, texCoord) * vec4(highlightColor.x,highlightColor.y,highlightColor.z,transparency);\n" "}\n" }; Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75616#75616 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 'EarthManipulator', how to manage to get the view of invisible underground part of the model in course of rotating operation?
Hi, In setting up the roaming scene model of 'EarthManipulator', how to manage to get the view of invisible underground part of the model in course of rotating operation? Thank you! Cheers, Mirro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75517#75517 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org