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 

disabled lighting after migration


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


Joined: 02 Mar 2016
Posts: 55

PostPosted: Wed Jan 17, 2018 12:54 pm    Post subject:
disabled lighting after migration
Reply with quote

My scene contains a node, a RTT drawable with custom camera like in the osgprerender example.
The drawable is initialized and rendered after i set up the compositeviewer/mastercamera during runtime via a osgDB::ReaderWriter plugin.

After migration from osg 3.0.1 to 3.4.1 my whole scene is rendered with disabled lighting
and when i try to reactivate lighting by pressing "L" only a very small part of my scene is affected.

I have already fixed culling problem by calling setGlobalDefaults() for my custom cameras, but i don't how to fix this. Maybe it has something to do with changes in render states/orders.
(In the drawable's drawImplementation() function i do lot of gl... calls.)

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1


Last edited by Meldryt on Wed Jan 17, 2018 2:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Wed Jan 17, 2018 2:09 pm    Post subject:
disabled lighting after migration
Reply with quote

Hi Sebastian,

It's not possible to determine what is wrong from the details given.
The best I can do is provide some general pointers.

What can happen when upgrading is that more recent version contain
fixes/tighten up ambiguities such that things that worked by fluke in
older releases now behave differently because the OSG is now doing
exactly what the scene graph is telling it to do.

Another possibility to look is what is happening in any custom code
you have - could it be leaking state?

Robert.




On 17 January 2018 at 12:54, Sebastian Schmidt <> wrote:
Quote:
My scene contains a node, a RTT drawable with custom camera like in the osgprerender example.
The drawable is initialized and rendered after i set up the compositeviewer/mastercamera during runtime via a osgDB::ReaderWriter plugin.
In the drawable's drawImplementation() function i do lot of glEnable/glDisable calls.

After migration from osg 3.0.1 to 3.4.1 my whole scene is rendered with disabled lighting
and when i try to reactivate lighting with pressing "L" only a very small part of my scene is affected.

I have already fixed culling problem by calling setGlobalDefaults() for my custom cameras, but i don't how to fix this. Maybe it has something to do with changes in render states/orders.

------------------------
OSG Version: 3.0.1
OS: OpenSuse Leap 42.1

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72769#72769








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 55

PostPosted: Wed Jan 17, 2018 3:28 pm    Post subject:
Reply with quote

@robertosfield
thanks for your reply. I cannot provide any code samples yet.

I forgot to mention that i have multiple pre rendered drawables,
each in seperate parent node.

After some testing it seems that only one of the parent nodes causes the problem.

Another weird thing: when i set the camera render order to POST_RENDER and push "S" for the first debug mode (StatsHandler), lighting gets enabled again.

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Wed Jan 17, 2018 5:20 pm    Post subject:
disabled lighting after migration
Reply with quote

Hi Sebastian,

It could be that there is some undefined state in the scene graph that
is resulting in some subgraphs inheriting that state from other
subgraphs that are rendered before it.

Make sure that all your geometries have normals/colour arrays as
required by the rendering needs you have. Same applies to other state
in the scene graph, if you want to something on/off make sure it's set
somewhere in the parental chain.

Robert.

On 17 January 2018 at 15:28, Sebastian Schmidt <> wrote:
Quote:
@robertosfield
thanks for your reply. I cannot provide any code samples yet.

I forgot to mention that i have multiple pre rendered drawables,
each in seperate parent node.

After some testing it seems that only one of the parent nodes causes the problem.

Another weird thing: when i set the camera render order to POST_RENDER and push "S" for the first debug mode (StatsHandler), lighting gets enabled again.

------------------------
OSG Version: 3.0.1
OS: OpenSuse Leap 42.1

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72771#72771








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 55

PostPosted: Fri Jan 19, 2018 3:45 pm    Post subject:
Reply with quote

Found a dirty solution. Had nothing to with lighting.
It was easier for me to check for specific opengl calls inside drawable's drawImplementation().

I had to reset this:
Code:
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

with:
Quote:
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, osg::Vec4(0.0,0.0,0.0,0.0).ptr());


Don't know why it happens with 3.4.1 and not with 3.0.1, except that i built both versions from source. (maybe i had unintentionally different flags enabled)

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Fri Jan 19, 2018 4:36 pm    Post subject:
disabled lighting after migration
Reply with quote

Hi Sebastian,

This suggest to me that an osg::TexEnv is needed somewhere in your
scene graph to make sure the state is the one you intend.

Robert.

On 19 January 2018 at 15:45, Sebastian Schmidt <> wrote:
Quote:
Found a dirty solution. Had nothing to with lighting.
It was easier for me to check for specific opengl calls inside drawable's drawImplementation().

I had to reset this:

Code:
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);


with:

Quote:
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, osg::Vec4(0.0,0.0,0.0,0.0).ptr());


Don't know why it happens with 3.4.1 and not with 3.0.1, coudln't find changes related to TexEnv.[/code]

------------------------
OSG Version: 3.0.1
OS: OpenSuse Leap 42.1

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72797#72797








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 55

PostPosted: Tue Jan 23, 2018 8:44 am    Post subject:
Reply with quote

I set this for my main camera and it works.
Code:
osg::TexEnv* texenv = new osg::TexEnv;
texenv->setMode(osg::TexEnv::MODULATE);
ss->setTextureAttributeAndModes(0,texenv, osg::StateAttribute::ON);


There was a change in SceneView::setDefaults() in line 258:
Code:
(if ((options&APPLY_GLOBAL_DEFAULTS)))

Maybe thats why it worked with 3.0.1.

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
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 Slave camera lighting with disabled m... ravidavi General 9 Tue Jan 09, 2018 1:06 am View latest post
No new posts Migration to a new forum/ML server an... robertosfield General 9 Mon Nov 20, 2017 12:32 pm View latest post
No new posts MFC mdi child windows show the scene ... rposg General 5 Fri May 26, 2017 6:37 pm View latest post
No new posts Lighting Latha Rani General 0 Tue Apr 11, 2017 1:40 pm View latest post
No new posts Scale-invarient lighting An7ares General 5 Fri Aug 26, 2016 9:13 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