[osg-users] why does the adding of lighting, colour and fusion to the "shader" model result in the opacity of its windowpane?

2019-02-10 Thread Mirro Xu
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] Setup and Start OSG library questions.

2019-02-10 Thread A Z
-[I have been reading 'OpenScene Graph 3.0: Beginner's Guide'.
It mentions that OSG comes with WxWidgets integration support.
I have also obtained the example file that claims to help
on this issue, to limited avail.

Can someone please reply with a source code example in C++ with
how I can combine the output, from an OSG Camera node or equivalent
I presume, onto something like a wxPanel?]

-[I have been trying and failing to build the OSG library
for 64 bit Windows and a GNU g++ compatible library,
TDM in particular.  Built versions of the library that I have found
on the internet are for MSVC, and are not TDM compatible.
Can OSG produce a 64 bit Windows TDM build of the version
of OSG that matches the beginner's guide, 3.0, or can it
point me in the direction of a public website that hosts
v3.0 for 64 bit Windows TDM?]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org