Hi,
I want to know if the irrlicht engine has implemented state sorting?
I saw the code and it looks as if only textures are sorted.
If the state sorting is not done fully, is there any plan in near future?
Please suggest.
Irrlicht State Sorting
I haven't heard of any plans on changing the sorting for the draw order.
If you want you can put things with distinct materials in a seperate render pass in the scene manager, this should render them together regardless of the texture.
If you want you can put things with distinct materials in a seperate render pass in the scene manager, this should render them together regardless of the texture.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 50
- Joined: Thu Aug 13, 2009 7:16 am
- Location: India
I am actually new to state sorting.
However I saw the Aviatrix3D code, and this scenegraph sorts all the states of an object as a collection.
For example all the states like materials, textures, lineAttributes(width , antialiasing) , and more are bundeled together in a Appearance object.
it is the Appearance object, which is a collection of all possible states, is finally sorted.(in fact sorting appearance is nothing but sorting all states).
Whether such a plan feasible in Irrlicht?
However I saw the Aviatrix3D code, and this scenegraph sorts all the states of an object as a collection.
For example all the states like materials, textures, lineAttributes(width , antialiasing) , and more are bundeled together in a Appearance object.
it is the Appearance object, which is a collection of all possible states, is finally sorted.(in fact sorting appearance is nothing but sorting all states).
Whether such a plan feasible in Irrlicht?
No need to repeat this post every few hours, if you don't get more answers then because no one has an answer. I've removed the other threads now.
If you want to know more about current render ordering in Irrlicht then please take a look at the sources. CSceneManager::drawAll() in CSceneManager.cpp is a good place to start looking. Also patches can be proposed, though you need good arguments to get changes right into the heart of the engine. Refering to some other code of which probably no-one here knows anything about won't get you too much answers as we miss any information about it.
If you want to know more about current render ordering in Irrlicht then please take a look at the sources. CSceneManager::drawAll() in CSceneManager.cpp is a good place to start looking. Also patches can be proposed, though you need good arguments to get changes right into the heart of the engine. Refering to some other code of which probably no-one here knows anything about won't get you too much answers as we miss any information about it.
Last edited by CuteAlien on Mon Oct 12, 2009 5:18 am, edited 1 time in total.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
I had a look how Irrlicht sets states to fix a rendering issue on the iphone last night.
Although I can't say for sure if it does any state sorting, it does make an effort to place nodes in the scene graph to minimize the impact of state changes.
for example in COctTreeSceneNode:
Also the video driver implmentation does a few checks to minimize some changes.
I know OpenSceneGraph is pretty good with its state sorting but it's not as easy to use as Irrlicht.
Bino
Although I can't say for sure if it does any state sorting, it does make an effort to place nodes in the scene graph to minimize the impact of state changes.
for example in COctTreeSceneNode:
Code: Select all
//! returns the material based on the zero based index i. To get the amount
//! of materials used by this scene node, use getMaterialCount().
//! This function is needed for inserting the node into the scene hirachy on a
//! optimal position for minimizing renderstate changes, but can also be used
//! to directly modify the material of a scene node.
virtual video::SMaterial& getMaterial(u32 i);
I know OpenSceneGraph is pretty good with its state sorting but it's not as easy to use as Irrlicht.
Bino
Here's one nice reference for implementing efficient state sorting, if somebody wants to try optimizing that stuff...
http://realtimecollisiondetection.net/blog/?p=86
http://realtimecollisiondetection.net/blog/?p=86
-
- Posts: 50
- Joined: Thu Aug 13, 2009 7:16 am
- Location: India
-
- Posts: 50
- Joined: Thu Aug 13, 2009 7:16 am
- Location: India
This is a useful link for understanding state sorting:
http://opengl.j3d.org/tutorials/statesorting.html
http://opengl.j3d.org/tutorials/statesorting.html