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 

RenderBin understanding


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Peter Wraae Marino
Guest





PostPosted: Mon Nov 03, 2008 9:44 am    Post subject:
RenderBin understanding
Reply with quote

Hi Users,

trying to clarify some specs on the renderbin, perhaps someone could help:

what I'm assuming:
-there are two default renderbins created at startup "RenderBin" and "DepthSortedBin"
-"DepthSortedBin" is always render after "RenderBin"
-"DepthSortedBin" sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states

what I'm asking:
-if an object has a parent osg::Group that has been set to "RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?
-an .osg file can have renderbin values too? so if I load an .osg file and set it to have "RenderBin" 10 do I override the renderbin values
in the file? or are they pushed relative to my given value 10? sometimes the .osg file consist of many renderbin values.

--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site

------------------
Post generated by Mail2Forum
Back to top
Wang Rui
Guest





PostPosted: Mon Nov 03, 2008 12:06 pm    Post subject:
RenderBin understanding
Reply with quote

Hi Peter,

Quote:
what I'm asking:
-if an object has a parent osg::Group that has been set to "RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?

I think the object should be rendered after its parent, no matter whose bin number is greater, because renderbins are generated in CullVisitor::pushStateSet(). And the CullVisitor will traverse nodes from parents to children.

Quote:

-an .osg file can have renderbin values too? so if I load an .osg file and set it to have "RenderBin" 10 do I override the renderbin values
in the file? or are they pushed relative to my given value 10? sometimes the .osg file consist of many renderbin values.

I think bin number and bin name can both be stored in .osg files. And the root node of file would also have renderbin settings if you set one.

Regards,
Wang Rui

------------------
Post generated by Mail2Forum
Back to top
Lionel Lagarde
Guest





PostPosted: Mon Nov 03, 2008 2:06 pm    Post subject:
RenderBin understanding
Reply with quote

Hi Peter,

Peter Wraae Marino wrote:
Quote:
Hi Users,

trying to clarify some specs on the renderbin, perhaps someone could help:

what I'm assuming:
-there are two default renderbins created at startup "RenderBin" and "DepthSortedBin"
-"DepthSortedBin" is always render after "RenderBin"
-"DepthSortedBin" sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states

what I'm asking:
-if an object has a parent osg::Group that has been set to "RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?

RenderBins are nested. If a node has a bin number different from the current render bin (or its StateSet render bin mode is set
to override), a new render bin is created and is added to the current render bin. It become the current render bin.

So, if a node has a bin number of 20 and it is different from the current bin number, a render bin 20 is added to the current
render bin.

Quote:
-an .osg file can have renderbin values too? so if I load an .osg file and set it to have "RenderBin" 10 do I override the renderbin values
in the file? or are they pushed relative to my given value 10? sometimes the .osg file consist of many renderbin values.



An osg file can contain render bin values. If you load an osg file and set the render bin number of the root node to 10, you don't
override the render bin numbers of the nodes (or just the render bin number of the root node). Because render bins are nested
during the scene culling, it will force the cull visitor to create a specific render bin for the whole sub-graph.

Quote:
--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site

Quote:


_______________________________________________
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
Peter Wraae Marino
Guest





PostPosted: Mon Nov 03, 2008 2:20 pm    Post subject:
RenderBin understanding
Reply with quote

thanks, this helped.

the nested makes perfect sense..
i'm on track again,

once again thanks,
peter


On Mon, Nov 3, 2008 at 3:06 PM, Lionel Lagarde < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Peter,

Peter Wraae Marino wrote:
Quote:
Hi Users,

trying to clarify some specs on the renderbin, perhaps someone could help:

what I'm assuming:
-there are two default renderbins created at startup "RenderBin" and "DepthSortedBin"
-"DepthSortedBin" is always render after "RenderBin"
-"DepthSortedBin" sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states

what I'm asking:
-if an object has a parent osg::Group that has been set to "RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?


RenderBins are nested. If a node has a bin number different from the current render bin (or its StateSet render bin mode is set
to override), a new render bin is created and is added to the current render bin. It become the current render bin.

So, if a node has a bin number of 20 and it is different from the current bin number, a render bin 20 is added to the current
render bin.

Quote:
-an .osg file can have renderbin values too? so if I load an .osg file and set it to have "RenderBin" 10 do I override the renderbin values
in the file? or are they pushed relative to my given value 10? sometimes the .osg file consist of many renderbin values.




An osg file can contain render bin values. If you load an osg file and set the render bin number of the root node to 10, you don't
override the render bin numbers of the nodes (or just the render bin number of the root node). Because render bins are nested
during the scene culling, it will force the cull visitor to create a specific render bin for the whole sub-graph.

Quote:
--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site


Quote:

_______________________________________________
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




--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site

------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Mon Nov 03, 2008 2:48 pm    Post subject:
RenderBin understanding
Reply with quote

Here's a quick example you can use to play around with RenderBin
settings; notice how you can make one object appear "on top" of another,
just by changing the binNum.

I'm not sure if this is a worth examples addition, but perhaps.

On Mon, 2008-11-03 at 15:19 +0100, Peter Wraae Marino wrote:
Quote:
thanks, this helped.

the nested makes perfect sense..
i'm on track again,

once again thanks,
peter


On Mon, Nov 3, 2008 at 3:06 PM, Lionel Lagarde
<> wrote:
Hi Peter,


Peter Wraae Marino wrote:
Quote:
Hi Users,

trying to clarify some specs on the renderbin, perhaps
someone could help:

what I'm assuming:
-there are two default renderbins created at startup
"RenderBin" and "DepthSortedBin"
-"DepthSortedBin" is always render after "RenderBin"
-"DepthSortedBin" sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states

what I'm asking:
-if an object has a parent osg::Group that has been set to
"RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?


RenderBins are nested. If a node has a bin number different
from the current render bin (or its StateSet render bin mode
is set
to override), a new render bin is created and is added to the
current render bin. It become the current render bin.

So, if a node has a bin number of 20 and it is different from
the current bin number, a render bin 20 is added to the
current
render bin.


Quote:
-an .osg file can have renderbin values too? so if I load
an .osg file and set it to have "RenderBin" 10 do I override
the renderbin values
in the file? or are they pushed relative to my given value
10? sometimes the .osg file consist of many renderbin
values.




An osg file can contain render bin values. If you load an osg
file and set the render bin number of the root node to 10, you
don't
override the render bin numbers of the nodes (or just the
render bin number of the root node). Because render bins are
nested
during the scene culling, it will force the cull visitor to
create a specific render bin for the whole sub-graph.

Quote:
--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site


____________________________________________________________









--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site




------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Mon Nov 03, 2008 3:03 pm    Post subject:
RenderBin understanding
Reply with quote

Whoops, forgot to attach.

MONDAY... *sigh*

On Mon, 2008-11-03 at 09:48 -0500, Jeremy Moles wrote:
Quote:
Here's a quick example you can use to play around with RenderBin
settings; notice how you can make one object appear "on top" of another,
just by changing the binNum.

I'm not sure if this is a worth examples addition, but perhaps.

On Mon, 2008-11-03 at 15:19 +0100, Peter Wraae Marino wrote:
Quote:
thanks, this helped.

the nested makes perfect sense..
i'm on track again,

once again thanks,
peter


On Mon, Nov 3, 2008 at 3:06 PM, Lionel Lagarde
<> wrote:
Hi Peter,


Peter Wraae Marino wrote:
Quote:
Hi Users,

trying to clarify some specs on the renderbin, perhaps
someone could help:

what I'm assuming:
-there are two default renderbins created at startup
"RenderBin" and "DepthSortedBin"
-"DepthSortedBin" is always render after "RenderBin"
-"DepthSortedBin" sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states

what I'm asking:
-if an object has a parent osg::Group that has been set to
"RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?


RenderBins are nested. If a node has a bin number different
from the current render bin (or its StateSet render bin mode
is set
to override), a new render bin is created and is added to the
current render bin. It become the current render bin.

So, if a node has a bin number of 20 and it is different from
the current bin number, a render bin 20 is added to the
current
render bin.


Quote:
-an .osg file can have renderbin values too? so if I load
an .osg file and set it to have "RenderBin" 10 do I override
the renderbin values
in the file? or are they pushed relative to my given value
10? sometimes the .osg file consist of many renderbin
values.




An osg file can contain render bin values. If you load an osg
file and set the render bin number of the root node to 10, you
don't
override the render bin numbers of the nodes (or just the
render bin number of the root node). Because render bins are
nested
during the scene culling, it will force the cull visitor to
create a specific render bin for the whole sub-graph.

Quote:
--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site


____________________________________________________________









--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site







------------------
Post generated by Mail2Forum
Back to top
Paul Martz
Guest





PostPosted: Mon Nov 03, 2008 9:06 pm    Post subject:
RenderBin understanding
Reply with quote

The way I've come to look at RenderBins...

The bin details are instructions to the CullVisitor. As the CullVisitor walks your scene graph during the cull traversal, it uses these values to build a render graph. (You could say, then, that the structure of this render graph is specified or implied by the bin details associated with each StateSet.) When the CullVisitor finds Drawables, it throws them into the current render graph bin.

Alternatively, one could imagine a different scene graph design that features an explicit, application-created render graph, with application-specified association between scene graph nodes/drawables and render graph nodes. If you can picture this type of implementation in your head, then step back a second and consider that OSG is simply creating this render graph for you during the cull traversal.

So what are the bin details?
- number: Determines relative processing order of bins in the render graph. This takes nesting into account (unless explicitly disabled), so you could imagine each render graph bin has a unique number that is a std::vector composed of all the bin numbers in a NodePath.
- name: Determines how Drawables are sorted within a render graph bin (for example, by depth, by state, by some combination of depth and state, or by some other mechanism).
- mode: Tells the CullVisitor whether or not to change the value of the current bin as it walks the scene graph.

This stuff is fairly opaque to even those of us experienced with OSG and could really benefit from some proper documentation. In my infinite amount of spare time, I'm considering writing a white paper that documents OSG's bin details scheme, plus maybe creating a NodeVisitor that creates a GraphViz .dot file to visualize the render graph.

Hope this helps.
-Paul


Quote:
From: [mailto:] On Behalf Of Peter Wraae Marino
Sent: Monday, November 03, 2008 2:44 AM
To:
Subject: RenderBin understanding



Hi Users,

trying to clarify some specs on the renderbin, perhaps someone could help:

what I'm assuming:
-there are two default renderbins created at startup "RenderBin" and "DepthSortedBin"
-"DepthSortedBin" is always render after "RenderBin"
-"DepthSortedBin" sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states

what I'm asking:
-if an object has a parent osg::Group that has been set to "RenderBin" with a value of 10 and the object itself uses
"RenderBin" with a value of 20 then which is used?
-an .osg file can have renderbin values too? so if I load an .osg file and set it to have "RenderBin" 10 do I override the renderbin values
in the file? or are they pushed relative to my given value 10? sometimes the .osg file consist of many renderbin values.

--
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site



------------------
Post generated by Mail2Forum
Back to top
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 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 openGL error 'stack overflow' at afte... nebsar General 7 Sun Dec 23, 2018 6:05 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 General Users starting questions in O... A Z General 1 Mon Oct 15, 2018 3:59 am 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