Sugestion for the scenemanager

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
}{ermanssoN
Posts: 37
Joined: Mon May 26, 2008 7:39 pm

Sugestion for the scenemanager

Post by }{ermanssoN »

Im quiet new ti the engine, I've learned gameprogramming on another engine create by my school. One thing that I can do with my engine in school that I can't do in irrlicht is to choose if the model i added to, in this case, the scenemanager should be rendered by the scenemanager or if it should be rendered manually.

I don't know how much trouble it would be to make such a change, but all nodes ha a render() function.

basicly what I would like is just to add on argumet to the addNode parameter,
a bool RenderManualy.

This would be very useful if you would like to make your own render functions, you could for example "instance" one node on serveral times per frame. It simply must be cheaper o take one node and render it two times instead of having two seprate nodes and render each of them.

It's also usefull if you need to do stuff with the z-buffer.
ex. you have a long riflemesh, when you walk near a wall the riflegoes trough it. If you can render it manualy, all you have to do is to render it last
and clear the zbuffer. (If i rememebr correctly)

Now the rifle will be renderd ontop of the rest of the world and itt will seem like the weapon is held infront of thw wall.

Code: Select all

scenemanager()->drawall();
PLayerWithLongRifle->DoStuffToZBuffer();
PLayerWithLongRifle->Render();
driver->endScene();
It's much easier than to create a customnode if you only wan't do do simple stuff.

There are most likley lot's of reasons why this is a bad idea for Irrlicht, but I be glad to hear them :), othevise Id be happy if some one agrees :P
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

You're totally gay for instancing. It looks to me like you're coming up with a solution to a different problem from the one that you actually have.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
}{ermanssoN
Posts: 37
Joined: Mon May 26, 2008 7:39 pm

Post by }{ermanssoN »

The point is that it would be usefull...and you would get full controll...

now the scenemanager controls in wich order and when stuff should be rendered, nothing you could do about it.

what if you need to render something to a texture. If you have a dwarf in the scenmanager and only want the dwarf rendered toa texture you would have to set the other object invisible that frame, very anoying if you need to render the dwarf ro a texture every frame....
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

What are you talking about. Almost all if not all nodes in Irrlicht as well as gui and textures got a draw() or render() function so that you can render only them...
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

}{ermanssoN wrote:what if you need to render something to a texture.
Irrlicht already provides this flexibility.

Use a custom scene node. It takes about 2 minutes to copy CAnimatedMeshSceneNode.cpp. Or you could create a custom scene node that simply encapsulates an IAnimatedMeshSceneNode.

If I sound tetchy, it's because I already provided you with an an example of how to do that. I'm wondering how many times I'll have to do so.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You can basically already do this i would think... Just create the node and then remove it from the scene manager (having grab()'d it yourself so it doesn't get deleted) and then call its render function yourself as necessary. Or if it's a custom scene node you could surely just not call its OnRegisterSceneNode() function and then it won't be added to the render list.
Image Image Image
Post Reply