PDA

View Full Version : Multipassrendering ?



stryx
04-29-2002, 10:09 AM
Hi guys,
I want to display my world and to produce some light I want to use Lightmapping.

ARB_Multitexture is fine, but I want it to work on way old cards, too.

So I need Multipassrendering.

How to render in multiple passes ?

Take this as an example:

DrawWorld (DRAWMODE_TEXTURES);
XXXXXXX
XXXXXXX
XXXXXXX
DrawWorld (DRAWMODE_LIGHTMAPS);


Now in this piece of code, what should the XXXXXX be ???

What must I do to render in multiple passes.

Since I'm very new to OGL please write not to complicated.

Thanks anyway !



stryx

DFrey
04-29-2002, 10:35 AM
Assuming your lightmaps are simply attenuation maps, then use glBlendFunc(GL_DST_COLOR, GL_ZERO) and glDepthFunc(GL_EQUAL)

blender
04-30-2002, 05:52 AM
ARB_Multitexture is fine, but I want it to work on way old cards, too.


How old cards are you talking about?
I thought ARB_multitexture was supported since Voodoo2. I think we should forget those old cards, and focus on new ones.
I think that if a graphics card doesn't support ARB_multitexture, It is worth of nothing, and should be left behind.

stryx
04-30-2002, 06:48 AM
Hm, you're right.

But I've an Laptop with an ATI RAGE 3D MOBILITY and it doesn't support ARB_Multitexture.

By the way: I'm making my game for our schoolcomputers and there we have only sh*t cards http://www.opengl.org/discussion_boards/ubb/wink.gif

I just want to include it "TOO".
Everything else is done for new systems but always with an option for older systems.

This case (ARB_multitexture) is the most extreme case http://www.opengl.org/discussion_boards/ubb/wink.gif

Thanks anyway,
StryX

DFrey
04-30-2002, 08:41 AM
I have to seriously disagree with not supporting older cards simply because they are older. To the contrary, if you can support them with little extra effort, why not? You only increase your audience. Afraid that your program might be misrepresented on the older hardware? Then plainly put a disclaimer on it indicating that while it can run on older hardware, it is not recommended. Simple. Quake3 could run on a freaking NVIDIA Riva 128, and that didn't detract at all from the TNT2 owners.

lobstah
04-30-2002, 09:07 AM
I agree with DFrey.

Also, I believe a graphics application programmer should not have deal with extentions and hardware specifics, etc.

Anyone out there program for a specific harddrive?

I hope OpenGL will catch up! http://www.opengl.org/discussion_boards/ubb/smile.gif

lobstah...

[This message has been edited by lobstah (edited 04-30-2002).]

blender
05-01-2002, 12:57 AM
Yes yes I agree that it is good to support as many hardware as you can, but sometimes it may cost a great deal of time to make things work on every machine.
I think myself that it is good to use some extensions as the primary option, but if there is no support for it, I'll make a cheap code to be used instead, but that is usually much slower than an extension.

blender
05-01-2002, 01:05 AM
Here's something I used to use (before singlepass):

glDisable(GL_BLEND);

// Render all your polygons here with base textures

glEnable(GL_BLEND);
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);

// Render here all your polygons again, but use now your lightmap textures

Those blendfunc parameters could be something else, but I think that gives a nice overbrighting.

Ofcource, if your scene is large, that kind of multipass rendering is heavy, so it would be good to use vertex arrays.

[This message has been edited by blender (edited 05-01-2002).]