PDA

View Full Version : YASMQ (Yet another Shadow Mapping Question)



rgpc
09-24-2003, 03:52 AM
This might be a bit of a numpty question but how can I vary/increase the ambient when I am using Shadow mapping? I thought that perhaps I just vary the light/material ambient but neither of these appear to work. My shadowed regions are almost (if not completely) black. Any suggestions?

PanzerSchreck
09-24-2003, 05:14 AM
If your gfx-card supports it (R300 does), then you can use SGIX_shadow_ambient ( http://oss.sgi.com/projects/ogl-sample/registry/SGIX/shadow_ambient.txt ) to set the shadows "blackness".

VladStamate
09-24-2003, 05:25 AM
Or you can use the ARB_shadow_ambient if it is supported on your videocard.
http://oss.sgi.com/projects/ogl-sample/registry/ARB/shadow_ambient.txt

rgpc
09-24-2003, 03:51 PM
Hmm, I tried ARB_shadow_ambient and it didn't seem to work. Maybe I'll have another go and see if I'm doing something wrong...

Thanks.

tellaman
09-24-2003, 03:59 PM
head on to delphi3d.net to discover that shadow ambient extensions are not supported by most video boards
i had to go for multiple passes to get some ambient

rgpc
09-24-2003, 05:04 PM
You read my mind tellaman - when I tried it I just stuck in the necessary line of code and didn't check to see if the extensions was even available. I had thought that I'd seen the necessary value in the extension list but didn't stick in the code to check (and didn't confirm it). What a duffa.

I'm trying to avoid multiple passes so I might play around with the emission setting and see if that gives me any joy. I'm not terribly concerned because Shadow Mapping doesn't really suit my geometry any way - it's just a performance (and learning I guess) exercise - gives a different option for lesser cards.

tellaman
09-25-2003, 07:20 AM
please just let me know if you get some positive result using emission, though i doubt it (cant remeber whether i tried that or not)
bye!

Bert
09-25-2003, 11:45 AM
Couldn't you just add your ambient via ARB_texture_env_add? It's supported virtually everywhere.

rgpc
09-25-2003, 04:45 PM
Originally posted by tellaman:
please just let me know if you get some positive result using emission, though i doubt it (cant remeber whether i tried that or not)
bye!

Sadly I didn't have any luck. If it increased the ambient areas I couldn't see it, but the problem was the lit areas became "overbright".


Originally posted by Bert
Couldn't you just add your ambient via ARB_texture_env_add? It's supported virtually everywhere.

That thought did occur to me last night. I seem to remember having read something about combiners of some sort - but then we've already seen what my memory is like... http://www.opengl.org/discussion_boards/ubb/smile.gif

tellaman
09-25-2003, 05:25 PM
the lit areas became "overbright"

GL_ADD will cause the same problem so it will not be useful in this case

rgpc
09-25-2003, 07:02 PM
Yes, I'm thinking that the only way around it is to code a path for ARB_shadow_ambient and wait for new drivers... (And/or use a FP)

Tom Nuydens
09-26-2003, 12:56 AM
Perhaps you could use the secondary color and color sum to add in the ambient after texturing (i.e. shadowing)?

-- Tom

Obli
09-27-2003, 08:28 AM
Originally posted by rgpc:
...(And/or use a FP)...
Wow, I am quite interested in that since i was not able to make it work in my experiment program. Using FPs it is quite easy to add ambient.
Anyone played shadowmapping FPs?

SimmerD
09-27-2003, 09:07 AM
Instead of a straight add, try an 'add smooth'.

a * ( 1 - b ) + b

It acts like an add ( commutative and associative ), but it doesn't saturate as quickly as a + b.

rgpc
09-27-2003, 02:29 PM
Originally posted by Obli:
Wow, I am quite interested in that since i was not able to make it work...

From memory Humus has an article on using FPs for Shadow mapping. It includes antianliasing too. I haven't looked at FPs at all as yet but it'll be the next logical step now that I have shadow volumes and shadow maps working - simply because the shadow maps look so bad.

Korval
09-27-2003, 04:22 PM
What is an "FP"?

SirKnight
09-27-2003, 04:29 PM
Originally posted by Korval:
What is an "FP"?

Fragment Program.


-SirKnight

JustHanging
09-28-2003, 09:53 PM
Hi,

Interesting thing that add smooth, do you have any pics demonstrating the difference? That might be a good way to accumulate lighting?

As for the question, GL_ADD should be fine, just reduce the amount of diffuse light to keep the lit areas from becoming overbright.

-Ilkka

Obli
09-29-2003, 10:06 AM
Originally posted by rgpc:
From memory Humus has an article on using FPs for Shadow mapping. It includes antianliasing too. I haven't looked at FPs at all as yet but it'll be the next logical step now that I have shadow volumes and shadow maps working - simply because the shadow maps look so bad.
Yes, it has two thingies on shadows. He does a very different thing to what I do (I also "project the light" in the same VP+FP combo) and my implementation probaby looks closer to how things were done using the old fixed function pipe.

So, I guess no one has personal experience about that. Uh-oh, this is way too bad for me.

Hey I don't like shadow maps to much right now (I was a big fan of them) however, they does not look so bad http://www.opengl.org/discussion_boards/ubb/wink.gif