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 

Render Bin, Transparency, ...


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Fri Nov 28, 2008 10:37 am    Post subject:
Render Bin, Transparency, ...
Reply with quote

Hi all,

Looking in the archive I didn't found what I need, so this is the problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :

Quote:
osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(), osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL, 1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);

But, I have some node with tranparency on the scene, and when I look the skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to managed the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Fri Nov 28, 2008 1:14 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

Sorry to insist, but I am surprised to see no answer ?
Any suggestion or idea will be very appreciated.

thanks a lot.

Regards,
Vincent

2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hi all,

Looking in the archive I didn't found what I need, so this is the problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :

Quote:
osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(), osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL, 1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);

But, I have some node with tranparency on the scene, and when I look the skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to managed the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.



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


Joined: 22 Dec 2008
Posts: 171

PostPosted: Fri Nov 28, 2008 2:29 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

Dude patience patience…

your original post was 5.37am est. and then you post at 8.14am that your upset no one has replied, give things time most people in the US for one are not even online yet and it’s a holiday for many

And you have to remember there is NO guarantee any one will answer your question…

See http://www.catb.org/~esr/faqs/smart-questions.html





______________________________________________________________________________



Capture the magic of Christmas this year see http://www.capturethemagic.com
______________________________________________________________________________
Gordon Tomlinson

(
Only registered users can see emails on this board!
Get registred or enter the forums!
)

IM: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)

www.vis-sim.com www.gordontomlinson.com
______________________________________________________________________________

From: [mailto:] On Behalf Of Vincent Bourdier
Sent: Friday, November 28, 2008 8:14 AM
To: osg
Subject: Re: Render Bin, Transparency, ...


Sorry to insist, but I am surprised to see no answer ?
Any suggestion or idea will be very appreciated.

thanks a lot.

Regards,
Vincent
2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Hi all,

Looking in the archive I didn't found what I need, so this is the problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :
osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(), osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL, 1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);

But, I have some node with tranparency on the scene, and when I look the skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to managed the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Fri Nov 28, 2008 2:45 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

Yes, you're right.

In france it was on 11.37am and 2.14pm ...

Hoping someone can help me, I'll go on something else.

Still waiting for you, and sorry for the inconvenience.

Regards,
Vincent.

2008/11/28 Gordon Tomlinson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:

Dude patience patienceâ?Š

your original post was 5.37am est. and then you post at 8.14am that your upset no one has replied, give things time most people in the US for one are not even online yet and it's a holiday for many

And you have to remember there is NO guarantee any one will answer your questionâ?Š

See http://www.catb.org/~esr/faqs/smart-questions.html





______________________________________________________________________________



Capture the magic of Christmas this year see http://www.capturethemagic.com
______________________________________________________________________________
Gordon Tomlinson

(
Only registered users can see emails on this board!
Get registred or enter the forums!
)

IM: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)

www.vis-sim.com www.gordontomlinson.com
______________________________________________________________________________

From: (
Only registered users can see emails on this board!
Get registred or enter the forums!
) [mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)] On Behalf Of Vincent Bourdier
Sent: Friday, November 28, 2008 8:14 AM
To: osg
Subject: Re: Render Bin, Transparency, ...



Sorry to insist, but I am surprised to see no answer ?
Any suggestion or idea will be very appreciated.

thanks a lot.

Regards,
Vincent
2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Hi all,

Looking in the archive I didn't found what I need, so this is the problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :
osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(), osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL, 1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);

But, I have some node with tranparency on the scene, and when I look the skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to managed the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.







_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Mon Dec 01, 2008 10:39 am    Post subject:
Render Bin, Transparency, ...
Reply with quote

Hi,

I just make a little update :

I don't remember (and I don't find) what is the order of the elements to render...

It seems to be :
1.skybox
2.transparent elements
3.orther

isn't it ?

Thanks,

Regards,
Vincent.

2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Yes, you're right.

In france it was on 11.37am and 2.14pm ...

Hoping someone can help me, I'll go on something else.

Still waiting for you, and sorry for the inconvenience.

Regards,
Vincent.

2008/11/28 Gordon Tomlinson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:


Dude patience patienceâ?Š

your original post was 5.37am est. and then you post at 8.14am that your upset no one has replied, give things time most people in the US for one are not even online yet and it's a holiday for many

And you have to remember there is NO guarantee any one will answer your questionâ?Š

See http://www.catb.org/~esr/faqs/smart-questions.html





______________________________________________________________________________



Capture the magic of Christmas this year see http://www.capturethemagic.com
______________________________________________________________________________
Gordon Tomlinson

(
Only registered users can see emails on this board!
Get registred or enter the forums!
)

IM: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)

www.vis-sim.com www.gordontomlinson.com
______________________________________________________________________________

From: (
Only registered users can see emails on this board!
Get registred or enter the forums!
) [mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)] On Behalf Of Vincent Bourdier
Sent: Friday, November 28, 2008 8:14 AM
To: osg
Subject: Re: Render Bin, Transparency, ...



Sorry to insist, but I am surprised to see no answer ?
Any suggestion or idea will be very appreciated.

thanks a lot.

Regards,
Vincent
2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Hi all,

Looking in the archive I didn't found what I need, so this is the problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :
osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(), osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL, 1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);

But, I have some node with tranparency on the scene, and when I look the skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to managed the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.









_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Paul Melis
Guest





PostPosted: Mon Dec 01, 2008 10:49 am    Post subject:
Render Bin, Transparency, ...
Reply with quote

Vincent Bourdier wrote:
Quote:
Hi,

I just make a little update :

I don't remember (and I don't find) what is the order of the elements
to render...

It seems to be :
1.skybox
2.transparent elements
3.orther
I would say
1. skybox
2. opaque geometry
3. transparent geometry in depth-sorted order

Assuming you skybox is opaque (which it probably is) you can also draw
it in 2.

Paul


------------------
Post generated by Mail2Forum
Back to top
GordonTomlinson
Appreciator


Joined: 22 Dec 2008
Posts: 171

PostPosted: Mon Dec 01, 2008 12:52 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

This is the way we do it and it works for use

1 Skybox
2 Opaque
3 Transparent

Also not you don't need to set the transparent bin to +1000 it default of
+10 will work just fine

Quote:
Hi,

So, if I do

2 skymaps with renderbin equal to -1000
opaque (no renderbin modified)
transparent renderbin equal to +1000

It would be the good result ?

Because if I do that for the moment, my transparent geometry is not
rendered
as last element... it is not visible when opaque element is behind it !
(understand : the opaque geometry is on the ground, and the transparent
geometry is up the ground. But for now, transparent geometry is not
visible
... where there is no opaque elements, I can see my tranparent geometry,
well rendered before skymaps...)

I a little bit lost with that...

For remember I use :

void setSkymapLastRenderBin(osg::Geode* myGeode, int binNum){
Quote:

osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(),
osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL,
1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that
sky can be seen throw transparency surfaces
state->setRenderBinDetails(binNum, "RenderBin");

myGeode->setCullingActive(false);
}


to set my geometries renderbin...

Any idea ?

Thanks a lot.

Regards,
Vincent.

2008/12/1 Gordon Tomlinson <>

Quote:
It should be





1 Skybox



2 Opaque



3 Transparent





________________________________________
______________________________________

*Capture the magic of Christmas this year see* *
http://www.capturethemagic.com*

______________________________________________________________________________

*Gordon Tomlinson *

**
IM: **
*www.vis-sim.com www.gordontomlinson.com*


______________________________________________________________________________



*From:* Vincent Bourdier [mailto:]
*Sent:* Monday, December 01, 2008 5:39 AM
*To:* ; OpenSceneGraph Users

*Subject:* Re: Render Bin, Transparency, ...



Hi,

I just make a little update :

I don't remember (and I don't find) what is the order of the elements to
render...

It seems to be :
1.skybox
2.transparent elements
3.orther

isn't it ?

Thanks,

Regards,
Vincent.

2008/11/28 Vincent Bourdier <>

Yes, you're right.

In france it was on 11.37am and 2.14pm ...

Hoping someone can help me, I'll go on something else.

Still waiting for you, and sorry for the inconvenience.

Regards,
Vincent.

2008/11/28 Gordon Tomlinson <>

Dude patience patienceâ?Š



your original post was 5.37am est. and then you post at 8.14am that your
upset no one has replied, give things time most people in the US for one
are
not even online yet and it's a holiday for many



And you have to remember there is NO guarantee any one will answer your
questionâ?Š



See
http://www.catb.org/~esr/faqs/smart-questions.html<http://www.catb.org/%7Eesr/faqs/smart-questions.html>












______________________________________________________________________________

*Capture the magic of Christmas this year see* *
http://www.capturethemagic.com*

______________________________________________________________________________

*Gordon Tomlinson *

**
IM: **
*www.vis-sim.com www.gordontomlinson.com*


______________________________________________________________________________



*From:* [mailto:
] *On Behalf Of *Vincent
Bourdier
*Sent:* Friday, November 28, 2008 8:14 AM
*To:* osg
*Subject:* Re: Render Bin, Transparency, ...



Sorry to insist, but I am surprised to see no answer ?
Any suggestion or idea will be very appreciated.

thanks a lot.

Regards,
Vincent

2008/11/28 Vincent Bourdier <>

Hi all,

Looking in the archive I didn't found what I need, so this is the
problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with
transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :

osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(),
osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL,
1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that
sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);


But, I have some node with tranparency on the scene, and when I look
the
skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to
managed
the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.
















------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Mon Dec 01, 2008 1:09 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

It looks good now, just using the renderbin and not all the code I past early...

And I use grad number to have code more comfortable to use... +1000 will allways be the last one...

Thanks for help, sorry for the inconvenience.

Regards,
Vincent.

2008/12/1 Gordon Tomlinson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
This is the way we do it and it works for use

1 Skybox
2 Opaque
3 Transparent


Also not you don't need to set the transparent bin to +1000 it default of
+10 will work just fine


Quote:
Hi,

So, if I do

2 skymaps with renderbin equal to -1000
opaque (no renderbin modified)
transparent renderbin equal to +1000

It would be the good result ?

Because if I do that for the moment, my transparent geometry is not
rendered
as last element... it is not visible when opaque element is behind it !
(understand : the opaque geometry is on the ground, and the transparent
geometry is up the ground. But for now, transparent geometry is not
visible
... where there is no opaque elements, I can see my tranparent geometry,
well rendered before skymaps...)

I a little bit lost with that...

For remember I use :

void setSkymapLastRenderBin(osg::Geode* myGeode, int binNum){
Quote:

osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(),
osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL,
1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that
sky can be seen throw transparency surfaces
state->setRenderBinDetails(binNum, "RenderBin");

myGeode->setCullingActive(false);
}


to set my geometries renderbin...

Any idea ?

Thanks a lot.

Regards,
Vincent.

2008/12/1 Gordon Tomlinson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Quote:
It should be





1 Skybox



2 Opaque



3 Transparent





________________________________________
______________________________________

*Capture the magic of Christmas this year see* *
http://www.capturethemagic.com*

______________________________________________________________________________

*Gordon Tomlinson *

**
IM: * (
Only registered users can see emails on this board!
Get registred or enter the forums!
)*
*www.vis-sim.com www.gordontomlinson.com*


______________________________________________________________________________



*From:* Vincent Bourdier [mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)]
*Sent:* Monday, December 01, 2008 5:39 AM
*To:* (
Only registered users can see emails on this board!
Get registred or enter the forums!
); OpenSceneGraph Users

*Subject:* Re: Render Bin, Transparency, ...



Hi,

I just make a little update :

I don't remember (and I don't find) what is the order of the elements to
render...

It seems to be :
1.skybox
2.transparent elements
3.orther

isn't it ?

Thanks,

Regards,
Vincent.

2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Yes, you're right.

In france it was on 11.37am and 2.14pm ...

Hoping someone can help me, I'll go on something else.

Still waiting for you, and sorry for the inconvenience.

Regards,
Vincent.

2008/11/28 Gordon Tomlinson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Dude patience patienceâ?Š



your original post was 5.37am est. and then you post at 8.14am that your
upset no one has replied, give things time most people in the US for one
are
not even online yet and it's a holiday for many



And you have to remember there is NO guarantee any one will answer your
questionâ?Š



See


Quote:
Quote:
http://www.catb.org/~esr/faqs/smart-questions.html<http://www.catb.org/%7Eesr/faqs/smart-questions.html>

Quote:
Quote:












______________________________________________________________________________

*Capture the magic of Christmas this year see* *
http://www.capturethemagic.com*

______________________________________________________________________________

*Gordon Tomlinson *

**
IM: * (
Only registered users can see emails on this board!
Get registred or enter the forums!
)*
*www.vis-sim.com www.gordontomlinson.com*


______________________________________________________________________________



*From:* (
Only registered users can see emails on this board!
Get registred or enter the forums!
) [mailto:
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)] *On Behalf Of *Vincent
Bourdier
*Sent:* Friday, November 28, 2008 8:14 AM
*To:* osg
*Subject:* Re: Render Bin, Transparency, ...



Sorry to insist, but I am surprised to see no answer ?
Any suggestion or idea will be very appreciated.

thanks a lot.

Regards,
Vincent

2008/11/28 Vincent Bourdier < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Hi all,

Looking in the archive I didn't found what I need, so this is the
problem:

I need to manage in the same scene : transparency nodes, skymap(s) (with
transparency or not), normal (no-transparent) nodes.

For the moment I apply on my skymaps the following code :

osg::StateSet* state = myGeode->getOrCreateStateSet();

//Set sky render after objects, not depending on frustrum
// Set texture mode to REPLACE
osg::ref_ptr<osg::TexEnv> te = new osg::TexEnv;
te->setMode(osg::TexEnv::REPLACE);
state->setTextureAttributeAndModes(0, te.get(),
osg::StateAttribute:ShockedN);

// Turn off lighting and cull face
state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LEQUAL,
1.0, 1.0);
state->setAttributeAndModes(depth.get(), osg::StateAttribute:ShockedN);

// Make pretty darn sure it is drawn first.(-1000) : it ensure that
sky can be seen throw transparency surfaces
state->setRenderBinDetails(-1000, "RenderBin");

myGeode->setCullingActive(false);


But, I have some node with tranparency on the scene, and when I look
the
skymap, I see something not expected (see Attached file)

Can you remember me what is the good rendering order ? and How to
managed
the skymaps and the transparent nodes ....

Thanks a lot,

Regards,
Vincent.





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org








_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Andreas Lindmark
Guest





PostPosted: Mon Dec 01, 2008 4:00 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

It is often better to draw the skybox last.

1. Opaque objects
2. Skybox
3. Transparent objects

ATI has published a paper called Depth in Depth, written by Emil Person aka Humus. In the paper (under paragraph: Draw the skybox last and the gun first) he explains why this order is preferable

http://developer.amd.com/media/gpu_assets/Depth_in-depth.pdf

/Andreas

------------------
Post generated by Mail2Forum
Back to top
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Mon Dec 01, 2008 4:29 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

Thanks a lot,

Skybox in second or render first is the same result...

Thanks for help.

Regards,
Vincent

2008/12/1 Andreas Lindmark < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
It is often better to draw the skybox last.

1. Opaque objects
2. Skybox
3. Transparent objects

ATI has published a paper called Depth in Depth, written by Emil Person aka Humus. In the paper (under paragraph: Draw the skybox last and the gun first) he explains why this order is preferable

http://developer.amd.com/media/gpu_assets/Depth_in-depth.pdf

/Andreas

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Skylark (Jean-SĂ©bastien Guay)
Professional


Joined: 05 Jan 2009
Posts: 2249

PostPosted: Mon Dec 01, 2008 5:02 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

Hi Vincent,

Quote:
Skybox in second or render first is the same result...

See the article Andreas linked, it's not the same. Visually it is, but
not in terms of z buffer.

Plus, if you have expensive shaders on your skybox, rendering it first
guarantees that they will be run for the whole screen, whereas rendering
it second guarantees they will be run for less than the whole screen (if
you have something else than your skybox in your scene... Smile )

Conceptually, the skybox is only there for any pixels where there is no
other object. So why not render it last, once you know which pixels are
occupied by other objects? (except transparent objects of course, they
still need to be rendered after the skybox)

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Mon Dec 01, 2008 5:07 pm    Post subject:
Render Bin, Transparency, ...
Reply with quote

2008/12/1 Jean-SĂ©bastien Guay < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hi Vincent,

Quote:
Skybox in second or render first is the same result...


See the article Andreas linked, it's not the same. Visually it is, but not in terms of z buffer.

Of course, I read it, and I just confirm that visually the render is the same

Quote:

Plus, if you have expensive shaders on your skybox, rendering it first guarantees that they will be run for the whole screen, whereas rendering it second guarantees they will be run for less than the whole screen (if you have something else than your skybox in your scene... Smile )

I totally understand and agree, but for the moment I have no shaders on skybox, so it is not a problem.

Quote:

Conceptually, the skybox is only there for any pixels where there is no other object. So why not render it last, once you know which pixels are occupied by other objects? (except transparent objects of course, they still need to be rendered after the skybox)

I am okay with that, and I am using this order for now Smile

Thanks,

Vincent


Quote:

J-S
--
______________________________________________________
Jean-Sebastien Guay (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://www.cm-labs.com/
http://whitestar02.webhop.org/

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




------------------
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 osgprerender and render to Window Trajce Nikolov NICK General 0 Mon Feb 04, 2019 2:52 pm View latest post
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 am View latest post
No new posts osg-users Digest, Vol 138, Issue 27 Zachary1234 General 0 Tue Jan 01, 2019 1:16 am View latest post
No new posts osg-users Digest, Vol 137, Issue 14 poweruserm@live.com.au General 0 Fri Nov 16, 2018 11:16 pm View latest post
No new posts Render multiple PRE_RENDER cameras to... ivar General 3 Tue Nov 13, 2018 3:41 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