Multiple render targets (MRTs)

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Multiple render targets (MRTs)

Post by Lee04 »

Hi

Mybe this is supported allready I don't know.
But it would be nice if MRTs Multiple Render Targets Was supported in Ogre..

Is it. any plans, when, if we would have to add it is it do able or impossible?


Regards

Lee04
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Unless I'm very much mistaken, it already is supported.
The Fresnel demo, for example, renders to the screen, a reflection texture and a refraction texture doesn't it?
Or do you mean something else?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Has been supported for a while. You can create multiple renderWindows as well with Root::createRenderwindow.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

I think it was about allowing shaders output in different framebuffers in the same fragment program (shader 3.0), not only about rendering in different framebuffer.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Yep, MRT is a different feature, it's very handy for things like DOF, since you can render the colour to one texture (say, R8G8B8) and the depth to another (say R32F), all in the same render. I've had it on my personal list for a while, however since I don't have a card that can do it (the FX series can't) I haven't been able to develop it. This might be a Dagon feature if I get a new gfx card :) The Radeon 9800 was the first card to do it. More info here : http://msdn.microsoft.com/library/defau ... target.asp

It's not terribly practical to rely on this feature yet though because:

1) high entry requirements (GeForce 6x00 or 9800 Pro/Xx00)
2) highly variable implementations (see the number of 'some implementations ... ' statements in the DX9 docs!)
3) I'm not sure if GL has an equivalent yet

It's another one of those 'nice for demos, not so useful for real products yet unless you want to spend a shitload of time writing vendor-specific codepaths' things.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Ah, that one. My 9600xt supports it as well

http://oss.sgi.com/projects/ogl-sample/ ... uffers.txt

That's the GL extension. I can't easily see how this would fit into the Ogre design though. Subrendertargets?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

I thought the best way was to be able to add the same viewport to more than one target, and each target can be created independently (but in practice there are limitations such as them needing to be the same resolution). This will translate down to RenderSystem::setRenderTarget taking an optional index (defaulting to 0) indicating which target 'slot' is in use. Of course, we'll have to remember to reset the targets to nothing when MRT is not going on!
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Yeah, we'd have to do some experimentation to see in how far this is possible, I don't know exactly what the limitations on the GL and D3D extensions are.
I suppose you can bind with _wglBindTexImageARB a texture to each of the AUXx buffers, then use the DrawBuffersARB to map these buffers to indices in the shader program. But I'm not sure, as GL is picky with contexts,
I'm not sure what happens if you have a FLOAT32 context and bind a RGBA8 texture to it. Maybe this is another thing we have to wait with until GL_EXT_framebuffer_object is implemented (should be any moment anyway). At least that gets rid of having to implement this for *each OS* seperatly like the other pbuffer stuff.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

MRTs and geometry instancing

Post by Lee04 »

Hi

As I figure is that if you want to render a lot of different looking objects
at once then geometry instancing is a cool feature....

But if the objects should have different shaders on different subparts then you need a texture look up for where which sub shader goes (using uber shader).

As a result of all this you would probablty end up using MRT's to fit it into one ubershader or am I wrong about this relationship between
the new geometry instancing function and MRTs???

Regards

Lee04
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Finally found a real useful MRT shader sample that would help "multiple fast stencil shadows using MRT":

http://www.ndawinteractive.com/shaderst ... sample.htm

(you'll need the freeware ShaderStudio MAX )
Post Reply