YASMQ (Yet another Shadow Mapping Question)

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?

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”.

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

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.

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

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.

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!

Couldn’t you just add your ambient via ARB_texture_env_add? It’s supported virtually everywhere.

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…

the lit areas became “overbright”

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

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)

Perhaps you could use the secondary color and color sum to add in the ambient after texturing (i.e. shadowing)?

– Tom

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?

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.

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.

What is an “FP”?

Originally posted by Korval:
What is an “FP”?

Fragment Program.

-SirKnight

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

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