Diet 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
turboferret
Posts: 49
Joined: Thu Aug 12, 2004 12:42 pm
Location: Sweden
Contact:

Diet rendering

Post by turboferret »

Hey everyone!
I'm making a plugin/extension to a multimedia creation application using Irrlicht. My plugin renders a single mesh without any fancy stuff like shaders/shadows, this procedure will then be repeated an arbitrary number of times every frame, depending on how many copies of the plugin object is used. The question is, is it possible to modify parts Irrlicht to optimize rendering for this?

Also, I use a rendertarget texture to draw the scene to a surface the application can use, is it possible to somehow draw directly to a DC much like drawing to a different window using endScene(windowid)?
This monkey is useless, it only has ONE ass!!!
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

To give detailed tips here, we need more detail on what kind of data you want to display and how much of it. How big are the individual objects and how many of these are drawn? This helps to determine the bottleneck.
Just tell us what you are trying to achieve in the end.

Possible solutions reach from buffer merging (easy) to hardware instancing (difficult)

We need to know more.
No offense :)
turboferret
Posts: 49
Joined: Thu Aug 12, 2004 12:42 pm
Location: Sweden
Contact:

Post by turboferret »

Thanks for the interest, Baal.
Ok this is what I'm doing:
  • Begin scene
    Set rendertarget
    A single mesh is drawn
    End scene
    Lock rendertarget
    Load rendertarget to destination surface
This is then repeated for every mesh used by the application.
As reference I use the sydney mesh supplied with Irrlicht and it runs smoothly up until 10-15 meshes are drawn.
This monkey is useless, it only has ONE ass!!!
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

With what you want to achieve in the end, I actually meant the effect you want to create with this. Not so much what you are doing right now, because this might not be the best in all cases.

Do you want to create impostors here to get down scene complexity?

There is not much room for improvement, if you render each mesh seperately. Question is: Do you really need to?

It might be worth to investigate the possibility of rendering multiple objects at the same time. For instance a 1024x1024 render target with four models, one model in each quadrant. Or even a 2048x2048 with 16 models.
Then leave those rendered models in this texture and setup texture coordinates in your scene accordingly. Don't cut/copy this texture to pieces and assign it individually. One big texture is much better than many smaller textures that sum up to the same size.

If you don't have to update all meshes all the time, then this proposed way needs tweaking. I don't know if Irrlicht supports viewports to subparts of a render target. If it does, then you can setup a viewport only for the part you want to update.

So the big picture is: Do batching. Rendering 1000 triangles with one scoop, it is *much* better than rendering 10 triangles in 100 portions. Same goes for textures in the scene.
No offense :)
turboferret
Posts: 49
Joined: Thu Aug 12, 2004 12:42 pm
Location: Sweden
Contact:

Post by turboferret »

There is not much room for improvement, if you render each mesh seperately. Question is: Do you really need to?
That's a good question. The problem is; as the project is a plugin there may be lots of different mesh-objects with different sizes and configurations. I'll try to elaborate on your suggestion on using viewports for drawing several meshes inside each begin/end scene.

A followup question; is it terribly slow creating and destroying a rendertarget texture every frame when it needs to be resized?
This monkey is useless, it only has ONE ass!!!
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

turboferret wrote:
A followup question; is it terribly slow creating and destroying a rendertarget texture every frame when it needs to be resized?
Yes. Very. Don't do this on a per frame basis.
No offense :)
gfxstyler
Posts: 222
Joined: Tue Apr 18, 2006 11:47 pm

Post by gfxstyler »

can't you just tell us what exactly you want to do? or is that a secret?
turboferret
Posts: 49
Joined: Thu Aug 12, 2004 12:42 pm
Location: Sweden
Contact:

Post by turboferret »

can't you just tell us what exactly you want to do? or is that a secret?
Not exactly a secret. I'll try to be as precise as possible.
There's a product called Multimedia Fusion created by ClickTeam. Simply put it is a program for creating other applications (games/mediaplayers etc). the second version, Multimedia Fusion 2, is going to be released soon. Most of the stuff MMF can do is not included in the basic package, but is added via extensions (a simple dll with the needed exported functions). This is where I come in. I'm creating this extension using Irrlicht to draw a 3D mesh to the otherwise 2D-only application. My extension will show up as an object the user of MMF can select and include in his project.
This is what it might look like:
http://www.ferretize.net/files/mmf2.PNG

As you might figure out from the screenshot and the way extensions are handled, it's difficult for me to code the rendering efficiently.
This monkey is useless, it only has ONE ass!!!
Eagle4
Posts: 3
Joined: Fri Jun 09, 2006 8:26 am
Contact:

Post by Eagle4 »

http://www.clickconvention.com/cc2004.html I've seen you make a video of a irrlicht object for mmf. This was a conversion of your engine.
then my question is: how does that advance?
(sorry for my english im a frenchies ;))
turboferret
Posts: 49
Joined: Thu Aug 12, 2004 12:42 pm
Location: Sweden
Contact:

Post by turboferret »

Hi Eagle!
The Irrlicht object will hopefully be released the same time as this Mesh object, not long after MMF2 is released. Thanks for the interest.
This monkey is useless, it only has ONE ass!!!
Eagle4
Posts: 3
Joined: Fri Jun 09, 2006 8:26 am
Contact:

Post by Eagle4 »

yeah so cool ! you make a very happy guy.... ME ;) :P

another question: is what a physical engine will be to adapt on mmf?
(sorry for my english im a frenchies ;))
Post Reply