Indeed. Replacing order of sampler lookups ie swapping 2 first lines of shader gives different results as well. Looks like a Driver bug... I am using Windows 7 64 bit Ge Force driver 191.07. I am curious what will happen on ATI or XP drivers.
Wojtek Lewandowski From: Trajce Nikolov Sent: Sunday, January 24, 2010 11:39 AM To: OpenSceneGraph Users Subject: Re: [osg-users] glsl mix Hi Wojtek, when setting it like this I get the right results. When obtaing the values from textures, it doesnt. I saw in the archive someone else had the same problem. And I know, it sound odd :). I am using mix in other shaders and there it works as well. But not in this case Nick http://www.linkedin.com/in/tnick Sent from Ünalan, İstanbul, Turkey On Sun, Jan 24, 2010 at 11:42 AM, Wojciech Lewandowski <[email protected]> wrote: Nick, GLSL mix works on my GF280. And I bet it works right everywhere. I changed your code to " cube_color = vec3( 0,1,1 ); \n" " base_color = vec3( 1,0,0 ); \n" " gl_FragColor = vec4( mix(cube_color, base_color, reflect_factor).rgb, 1.0); \n" and resulting sphere color is light gray as expected. I guess your problem must be somewhere else in your code... Wojtek From: Trajce Nikolov Sent: Saturday, January 23, 2010 11:42 PM To: OpenSceneGraph Users Subject: Re: [osg-users] glsl mix Here is attached code ... Would really appreciate if some take couple of minutes to have a look Thanks a lot Nick http://www.linkedin.com/in/tnick Sent from Devlet, Ankara, Turkey On Sat, Jan 23, 2010 at 11:44 PM, Trajce Nikolov <[email protected]> wrote: I am also getting this warning Warning: detected OpenGL error 'invalid operation' at after RenderBin::draw(..) Nick http://www.linkedin.com/in/tnick Sent from Devlet, Ankara, Turkey On Sat, Jan 23, 2010 at 9:50 PM, Trajce Nikolov <[email protected]> wrote: Hi guys, this might sound stupid but., I am trying to mix two values in the fragment shader. Can not blend them together no mater what. I try "manual" blending, but still the results are as for only 1 and 0 blend factor. NOthing in between, Here is the shader. Any clue? "varying vec4 uv; \n" // "uniform sampler2D colorMap; \n" // "uniform samplerCube cubeMap; \n" // "const float reflect_factor = 0.5; \n" // "void main( void ) \n" // "{ \n" // " vec3 base_color = texture2D(colorMap, gl_TexCoord[0].xy).rgb; \n" // " vec3 cube_color = textureCube(cubeMap, uv.xyz).rgb; \n" // " gl_FragColor = vec4( mix(base_color, cube_color, reflect_factor), 1.0); \n" // "} Nick http://www.linkedin.com/in/tnick Sent from Devlet, Ankara, Turkey _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -------------------------------------------------------------------------------- _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

