Request: manage which passes are drawn by smgr->drawall
Request: manage which passes are drawn by smgr->drawall
A similar variable like the OverrideMaterial.EnableFlags could be added to the scene manager, to manage which passes are drawn.
The structure for it is already there, the scene manager sections are already separated and listed in an enum.
Unlike OverrideMaterial's, it should default to "all on".
This would be useful for example to only draw the solid objects for some pass (shadows, etc).
The structure for it is already there, the scene manager sections are already separated and listed in an enum.
Unlike OverrideMaterial's, it should default to "all on".
This would be useful for example to only draw the solid objects for some pass (shadows, etc).
Re: Request: manage which passes are drawn by smgr->drawall
Good idea hendu, I too would like to see this added.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Request: manage which passes are drawn by smgr->drawall
Agreed, I have a similar way of enabling/disabling render passes in my engine and it's really helpful in a lot of situations
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Request: manage which passes are drawn by smgr->drawall
Ok, I think I understand the idea. Sounds simple and easy to integrate. Moving to open discussions for possible further discussion.
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Re: Request: manage which passes are drawn by smgr->drawall
Yeah, that would be really nice. It would make deferred rendering a lot easier too.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Request: manage which passes are drawn by smgr->drawall
And debugging for that matter3DModelerMan wrote:Yeah, that would be really nice. It would make deferred rendering a lot easier too.
Re: Request: manage which passes are drawn by smgr->drawall
I second this. For us it would be a great addition to improve our code for imposter rendering and the rendering of reflecting surfaces.
And I can imagine multiple other uses for this. Good idea Hendu!
And I can imagine multiple other uses for this. Good idea Hendu!
Re: Request: manage which passes are drawn by smgr->drawall
Hybrid, are you going to do this or should I? If me, how would you like the interface?
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Request: manage which passes are drawn by smgr->drawall
Easy way would be an enum and a method, together with an internal variable in the scene manager. I think this is enough here, as the scene manager has other problems with add methods, but not with those control API. Name should probably be enableRenderStates()
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Re: Request: manage which passes are drawn by smgr->drawall
It should probably be: disableRenderPass(E_SCENE_NODE_RENDER_PASS pass) and that way you would call it before smgr->drawAll(); instead of disabling it once and having all smgr->drawAll calls ignore those render passes.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Re: Request: manage which passes are drawn by smgr->drawall
Heh, and what I had in mind was a public u32 just as in OverrideMaterial Perhaps we need to discuss the interface more, with so different ideas?
With a function that takes a single enum you would need several function calls if you wanted to toggle more than one state.
With a function that takes a single enum you would need several function calls if you wanted to toggle more than one state.
Re: Request: manage which passes are drawn by smgr->drawall
Please don't use unnamed u32 type, define an enumeration.
Personally i would suggest define enum E_RENDER_STATE (use values 0x1, 0x2, 0x4, 0x8, 0x10, and so on) and the mehods:
Also ISceneManager::drawAll() still doesn't have any arguments, so we can add it like:
Personally i would suggest define enum E_RENDER_STATE (use values 0x1, 0x2, 0x4, 0x8, 0x10, and so on) and the mehods:
Code: Select all
private:
E_RENDER_STATE currentRenderState = ERS_flag1 | ERS_flag2 ... ; // some default render state combination OR simply 0xFFFFFFFF (which means "all turned on")
public:
inline void setRenderStates(E_RENDER_STATE flags) { currentRenderState = flags; }
inline E_RENDER_STATE getRenderStates() { return currentRenderState; }
inline void enableRenderState(E_RENDER_STATE flag) { currentRenderState |= flag; }
inline void disableRenderState(E_RENDER_STATE flag) { currentRenderState &= 0xFFFFFFF ^ flag; }
Code: Select all
void drawAll(E_RENDER_STATE flags = 0xFFFFFFFF);
Re: Request: manage which passes are drawn by smgr->drawall
Adding arguments to drawAll is probably one of the best options.
That way we can either just call drawAll to render all passes, or easily disable render passes.
That way we can either just call drawAll to render all passes, or easily disable render passes.
Re: Request: manage which passes are drawn by smgr->drawall
@greenya
The enum is already defined for use in OverrideMaterial?
While having it wrapped with a set function would remove the objection of many function calls, it's ugly having to cast it then for every setRenderStates call.
The enum is already defined for use in OverrideMaterial?
While having it wrapped with a set function would remove the objection of many function calls, it's ugly having to cast it then for every setRenderStates call.
Re: Request: manage which passes are drawn by smgr->drawall
@hendu
Yes, i see E_SCENE_NODE_RENDER_PASS http://irrlicht.sourceforge.net/docu/na ... bb8200d67f
Maybe simply adding an overloadig to "ISceneManager::drawAll(E_SCENE_NODE_RENDER_PASS pass = (u32)-1)" will fulfill all needs.
Yes, i see E_SCENE_NODE_RENDER_PASS http://irrlicht.sourceforge.net/docu/na ... bb8200d67f
Maybe simply adding an overloadig to "ISceneManager::drawAll(E_SCENE_NODE_RENDER_PASS pass = (u32)-1)" will fulfill all needs.