PDA

View Full Version : Soft shadows on geforce2



tfpsly
11-29-2002, 01:35 AM
Hi,
First, can you have a look at these pictures and tell me if these are real soft shadows (Gaby?)
http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft1.jpg http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft2.jpg http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft3.jpg http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft4.jpg http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft5.jpg http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft6.jpg

Made on a Duron 500/Geforce 2MX, which explain the low fps.

davepermen
11-29-2002, 01:58 AM
they look quite okay. how about a simple white plane with a simple white cylinder on it? then you see if its sharp where the cylinder stands and gets softer the more away from the cyli the shadow is..

how have you done it?

satan
11-29-2002, 02:04 AM
I like the shadows, especially with this hardware setup. Great work.

Lars
11-29-2002, 02:49 AM
When i look at the banding in the first shot, it looks like multiple shadowvolumes per light.
Nvidia has an effect in there effectsbrowser showing this technique.

Are you darkening the areas where shadow falls, or are you doing multiple light passes with lowered intensitys.
Or are you doing something completely different, cause the framereate seems high for so much passes or is it just the dark scene and low resolution ???

But great work incorporating it in a real scene.

Lars

tfpsly
11-29-2002, 03:21 AM
Hey folks, thx for the comments

Here is a new screenshot, http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft0.jpg
where you can see better how soft it is: sharp near the girl, soft further. (Ok I know the sky stinks, but that's not the purpose =)


Originally posted by Lars:
When i look at the banding in the first shot, it looks like multiple shadowvolumes per light.

True, there are many volumes... except that displaying many volumes at the same time would be damn slow =)



Are you darkening the areas where shadow falls, or are you doing multiple light passes with lowered intensitys.
Or are you doing something completely different, cause the framereate seems high for so much passes or is it just the dark scene and low resolution ???


The idea is based on a tricky motion blur I implemented years ago in my soft engines, which was:
* fade the screen instead of clearing it.
* display new scene on top of it.



But great work incorporating it in a real scene.

Lars

Thx

Here is how it works:
* do not glclear alpha, do not use alpha for blending. Alpha is for shadows, nothing else, nah!

* display shadow in alpha using the usual stencil volume
* motion blur alpha
* display quad as usually, using alpha buffer instead of stencil buffer

Lars
11-29-2002, 05:55 AM
Sounds very interesting, i think a video could be far more interesting then screenshots in the case of motion blur.

Maybe it is also possible to do it with lighting instead of shadowing with a quad, cause you can't use bump maps and stuff with the quad approach (or at least it doesn't look good).

Lars

knackered
11-29-2002, 02:37 PM
Are you saying that the shadows change with the viewpoint motion? If so, I can't imagine it would look very good in motion...

tfpsly
12-01-2002, 07:42 AM
The volumes are casted, one per frame, and blurred together.
In fact, it does look very nice when in motion, while when the light is static, there is some flickering that I am trying to get rid of.

[This message has been edited by tfpsly (edited 12-01-2002).]

gaby
12-01-2002, 11:42 PM
>Hi,
>First, can you have a look at these >pictures and tell me if these are real soft >shadows (Gaby?)

Lol ! ;-)

Yes, look like real soft shadows ! Great job, seems to be fill critical method... but in anyway, it seems to look good (simpler test with white primitive should be more demonstrative).

Regards,

Gaby

MickeyMouse
12-02-2002, 01:10 AM
Hi!

From the screenshots it looks pretty good.
But don't you loose the shadows softness when the camera stops, because that case motion blur will make it blurred to sharp shadow?

I think that method will also give the shadow positioned slightly more on one side than on the other, since motion blur works "directionally".

tfpsly
12-02-2002, 01:46 AM
Originally posted by MickeyMouse:
But don't you loose the shadows softness when the camera stops, because that case motion blur will make it blurred to sharp shadow?

I think that method will also give the shadow positioned slightly more on one side than on the other, since motion blur works "directionally".

Hi,
when the light stop, I shake it in order to get several volumes. So this method should still work, drawing from time to time the "expanded softed volume" on one or another side.

On the other hand, this causes flickering, as the edges are:
* displayed
* blurred
* blurred
* ...
* displayed again
and so on.

I am trying to fight this, using some bits of the stencil buffer to limit the area where blurring should occur.

AdrianD
12-02-2002, 03:29 AM
i don't think this method will ever work without any flickering, just beause of the principle of this method.
btw. shadow-motionblurr without blurring anything else might be a nice effect for a little demo, but in a VR-like app it just looks like nasty artefacts.(in my opinion, ofcourse http://www.opengl.org/discussion_boards/ubb/wink.gif)

tfpsly
12-02-2002, 04:08 AM
Right now I think it's feasible. You just have to use several (currently 2) bits of the stencil buffer to mark areas that musn't be blurred yet. When displaying the shadow volume, set these 2 bits to 1. Then at each following frames, decrement these bits until they reach 0, at which case you're to blur the corresponding area.

EDIT: strangely, the delete button does not appear in Galeon, but links-g did display it. Thx davepermen

[This message has been edited by tfpsly (edited 12-02-2002).]

davepermen
12-02-2002, 05:06 AM
its an interesting idea, i hope there is no lack in it that'll show up http://www.opengl.org/discussion_boards/ubb/biggrin.gif

btw, to delete posts: just edit the post. its at the topmost checkbox, in bold: Delete
http://www.opengl.org/discussion_boards/ubb/biggrin.gif (once you deleted the post i can remove that as well)

tfpsly
12-02-2002, 06:47 AM
I got rid of the flickering, but the result is not as nice as when the light is moving: http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft8.jpg

does anyone know how to use easiely the high bits of the stencil buffer, being able to increment and decrement it, without using plenty of passes to do the computation? the GL_INCR and GL_DECR commands only work from the 0 bit, so I have to do all the computations, and it was crazy enough to get 2 bits to count the volume. I don't want to hard code more addition/soustraction, but I need more bits to be able to add more volumes.

tfpsly
12-02-2002, 10:25 PM
Ok, now it's much better for static light.
See http://tfpsly.planet-d.net/img/3d/Screenshots/SoftShadows/Soft8.jpg
I replaced the picture by a new one, much nicer.

In fact I did not need a counter but a flag, so now I can easiely use as many bits as I want (3 for the above picture).

It seems the 5 remaining bits are enough for the shadow volume. I'll check if no crap appear in several Q3 level shadowing.

I think I'll put an option for the user so that he can set up how many stencil bits he wants to use to sum volumes. After all on new cards with 10 bits or more in the Stencil buffer, we can sacrify a few of them for nice shadow I think =)