Custom rendering

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
_Bardor_
Posts: 5
Joined: Fri Feb 20, 2009 2:43 pm
Location: Germany

Custom rendering

Post by _Bardor_ »

Hi, i hope i will get some help here.

In my game i use diffrent viewports.
One for the main window and another one for a inventory window.

In the main window i can draw easily scene nodes by calling smgr->drawall().
In my inventory window i have to draw single objects.
here are the steps i have made in the rundevice() loop:
1. change the viewport
2. set the active camera ( to inventory)
3. render the camera
4. make an object visible
5. render the object
6. make this object invisible again.

All objects are drawn in the inventory, but i still have two problems:

1. It seems render() doesn't take care of the rotation of the object. There is something missing which is included in smgr->drawall() which updates the rotation.
2. Additionally i want to use a lightscenenode in this inventory to light the objects. Somehow it doesn't work. Where in the sequence above do i have to render the light ? (before or after the camera/objects ?)
And what additional commands are needed to light the objects ?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

The source for smgr->drawAll() is available to you so you could just look at how it's done ;)

Or you could use a secondary scenemanager for the objects in your inventory and call drawAll on that when you want them rendered
Image Image Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Would the CGUIViewport that I wrote a while ago work for you? It was originally written for Irrlicht 1.3 or so, but updating it should be fairly easy.

The CGUIViewport is just a standard IGUIElement that renders an Irrlicht scene in the space it covers. The scene could have a camera, lights, and all that stuff. You don't need to write any rendering code, just the code to initialize and configure and the CGUIViewport and then call gui->drawAll() just like you normally would.

Travis
_Bardor_
Posts: 5
Joined: Fri Feb 20, 2009 2:43 pm
Location: Germany

Post by _Bardor_ »

Thanks for the replies.

Using a second scene manager sounds easy i never thought of that.
And the class IGUIScenemanager does the same.

I'll try out the second scenemanager, because i have already a window with objects inside.
Post Reply