OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

why does the adding of lighting shader, model result in the opacity of its windowpane?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
mirro
Newbie


Joined: 16 Dec 2018
Posts: 3

PostPosted: Mon Feb 11, 2019 3:03 am    Post subject:
why does the adding of lighting shader, model result in the opacity of its windowpane?
Reply with quote

Hi,

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);\n"
"}\n"
};



Thank you!

Cheers,
Mirro[/b]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts override the texture with the gl_frag... GarfieldPig General 1 Sun Apr 14, 2019 8:31 am View latest post
No new posts culling / bounding calculation for sh... christoph General 3 Thu Mar 28, 2019 1:17 pm View latest post
No new posts Question about security of shader dev... Werner Modenbach General 5 Wed Jan 30, 2019 5:50 pm View latest post
No new posts Selecting a mesh of 3d model (say 3ds... nebsar General 2 Wed Jan 02, 2019 9:47 pm View latest post
No new posts Compiling vertext shader fails on Intel loopy General 7 Fri Dec 14, 2018 7:28 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP