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 

shadows in an GL 3.2 / glsl 1.5 environment


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


Joined: 06 Feb 2013
Posts: 105

PostPosted: Wed Sep 02, 2015 8:42 am    Post subject:
shadows in an GL 3.2 / glsl 1.5 environment
Reply with quote

Dear all,

I need to do shadows in an GL 3.2 / glsl 1.5 environment.
I was using osgShadow with LightSpacePerspectiveShadowMapCB technique before moving to 3.2/1.5.
I tried to track down the necessary actions and I think I have to solve 3 items:
1) Assigning new shaders to the technique (StandardShadowMap
2) Setting setUseModelViewAndProjectionUniforms(true) and setUseVertexAttributeAliasing(true) to the state
3) Find a workaround for TexGen
1) is easy
2) should be possible.
3) Makes me some headache.
osg::TexGen.apply simply says: "TexGen::apply(State&) - not supported"
By searching the Internet I found at http://http://docs.gl/gl3/glTexGen
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If the texture generation function is GL_EYE_LINEAR, the function
g=p1′′×xe+p2′′×ye+p3′′×ze+p4′′×we


is used, where
(p1′′p2′′p3′′p4′′)=(p1p2p3p4)M-1


and xe, ye, ze, and we are the eye coordinates of the vertex, p1, p2, p3, and p4 are the values supplied in params, and M is the modelview matrix when glTexGen is invoked. If M is poorly conditioned or singular, texture coordinates generated by the resulting function may be inaccurate or undefined.
Note that the values in params define a reference plane in eye coordinates. The modelview matrix that is applied to them may not be the same one in effect when the polygon vertices are transformed. This function establishes a field of texture coordinates that can produce dynamic contour lines on moving objects. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
That looks like if I have the light position of the shadow casting light and the planes somehow given in uniforms
I should be able to do the necessary texture coordinate calculation in the vertex shader.
I just don't have the necessary knowledge to do it.
My first question: Is it correct that the planes are constant and not depending on camera movements?
Second question: Is it correct that the above modelView matrix is the one from the camera when shadow are created (Light view)?

Does anybody has a link where I can dig further into that or is there even a "ready to use" example implementation?

Thanks for any hints.

- Werner -

------------------
Post generated by Mail2Forum
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 How to cast shadows from different li... hbaqueiro General [forum] 0 Tue Jan 15, 2019 1:05 pm View latest post
No new posts How to cast shadows from different li... hbaqueiro General [forum] 0 Tue Jan 15, 2019 1:01 pm View latest post
No new posts How to cast shadows from different li... hbaqueiro General [forum] 0 Tue Jan 15, 2019 12:55 pm View latest post
No new posts How to cast shadows from different li... hbaqueiro General [forum] 0 Tue Jan 15, 2019 12:53 pm View latest post
No new posts How to cast shadows from different li... hbaqueiro General [forum] 0 Tue Jan 15, 2019 12:45 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