Dark Bit Factory & Gravity

GENERAL => Projects => Topic started by: hellfire on August 21, 2008

Title: soft shadows
Post by: hellfire on August 21, 2008
Hey everyone,
made some tries with direct3d lately but have some doubts of the compatibility, so I would really appreciate if some of you could give it a try (might require vc redist (http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en)).

I use a 32bit-float (single component) cube-map render target and I'm not sure if those are commonly supported.
The pixel-program should compile on shader-model 2, but if it doesn't please post the error-message from the console window.
If it does anything strange, please run the CapsViewer (http://hellfire.untergrund.net/stuff/DXCapsViewer.zip), use "file"->"print whole tree to file" and attach the resulting "dxview.log".

The white box is the light source (and its' approximated area) - not a bug ;)

Many thanks in advance!


- Added some more debug-infos (see console window)
- DirectX-Update (including d3dx9_xy.dlls) can be found here (http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&DisplayLang=en).
Title: Re: soft shadows
Post by: benny! on August 21, 2008
Ok,

on my first run your program requested the library
d3dx9_35.dll - after I installed that and tried
to ran it again, I got the following exception from the
just-in-time-debugger:

"Unhandled Win32-exception in shadow.exe[5372]"

Unfortunately I am at work right now and I do not want
to install loadz of M$ packages. Will try it again at home
and report.

Screeny looks promising though ;-)

German text from debugger:
Quote
Unbehandelte Ausnahme bei 0x00401fb7 in shadow.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00000000.
Title: Re: soft shadows
Post by: Shockwave on August 21, 2008
Good news for you is that it works on my fairly humble little computer.

My Specs:
Latest DirectX, radeon X1650 256mb card, Windows XP SP2, P4 3.0Ghz and 1gb ram.

It gave a very solid 32 fps, I really love the shadows they look excellent, as do the gnarled formations inside the tunnel.

Hope that helps :)

And I hope even more that you are making something new with Haujobb? It's been a long time since I saw something released by you.. All these partys, you  could win something surely and people would love to see Haujobb back with something new.
Title: Re: soft shadows
Post by: benny! on August 21, 2008
Don't know what you changed - but now it works and it looks
great. I love that tunnel and the shadows are fantastic.

FPS is between 21-26fps.

I noticed that the cube is black in my version whereas it seems
to be white in your version (screenshot). I am running WinXP
with a NVIDIA GeForce 7600GT here at work.
Title: Re: soft shadows
Post by: hellfire on August 21, 2008
Thanks Shockwave, it's good to hear it works on ATI as well (which was usually thrilling with OpenGL).
I would like to keep some compatibility and avoid shader3 if not absolutely necessary (most older cards will lack some general horse-power though ), maybe I can somehow sort out the issue with benny's machine, too.
I have some serious plans with this one and it's already quite a bit more advanced as you can see here, but I wanted to keep a bit of suspense :)
Haven't yet decided whether it's going out under the "haujobb" label.

edit:
Benny, I silently changed the shadow-buffer from 16bit-floats (which saved some bandwidth but seems to be rather uncommon) to 32bit. Thank you very much for trying once again.
Title: Re: soft shadows
Post by: benny! on August 21, 2008
@hellfire:
np. keep us updated with the progress you make, please.

/me too wants to see another haujobb! release - are you still active btw?
Title: Re: soft shadows
Post by: mind on August 21, 2008
looks nice, but the fps is horrible on my system.. dualcore 2.4, gf9500 something, i get like 8 fps :(
Title: Re: soft shadows
Post by: AnimalMother on August 21, 2008
Runs fine & smooth here. Athlon X2 6000, 4GB Ram, 8800GTX 768MB, Vista Home Premium 64 @ 62 FPS  8)
Title: Re: soft shadows
Post by: Clyde on August 21, 2008
I have an Nvidia FX5500 w/128 Ram, Windows Vista 32-Bit w/ Service Pack 1, P4 2.66ghz with 512mb memory. And it runs at 1fps; so dont get the full benefit of the effect. the screen shot looks amazing.
Title: Re: soft shadows
Post by: Shockwave on August 21, 2008
I have an Nvidia FX5500 w/128 Ram, Windows Vista 32-Bit w/ Service Pack 1, P4 2.66ghz with 512mb memory. And it runs at 1fps; so dont get the full benefit of the effect. the screen shot looks amazing.

Ouch! Someone with an even worse gfx card than me :D  :clap:
Title: Re: soft shadows
Post by: AnimalMother on August 21, 2008
Yes it´s a real harware killer  ;)
And it reminds me of Microcosm for CD32  ;D

I made a short capture with kkapture... -> http://zeros.ath.cx/Downloads/Tools/shadow.avi
Title: Re: soft shadows
Post by: hellfire on August 21, 2008
Quote
gf9500 [..] i get like 8 fps
I somehow lost track of all the gpu mishmash.
I have a geforce 8600 (passive cooled) at work which gives stable 60fps.
Why is the 9500 that slow?

Quote
FX5500 [..] runs at 1fps
Sorry pal, it just hasn't the fillrate power (I'm doing 25 texture lookups for a single pixel), but I'm glad to hear that it *does* "run" :)

Quote
it´s a real harware killer
...it will become much worse ;)
Big thanks for the video!
Title: Re: soft shadows
Post by: Clyde on August 21, 2008
@Avi Capture: Wow the effect is awesome.
Title: Re: soft shadows
Post by: zawran on August 21, 2008
No problem running on my computer, it was maxed at the screen update of 60fps. (intel quad core 2.4ghz, 2x 8800GT SLI). The shadows looks ace, really a nice effect you made there.
Title: Re: soft shadows
Post by: Jim on August 21, 2008
100% my-pc compatible ;D.  About 35fps.  Looks good, though if you want constructive criticism there's still a lot of fairly obvious texture aliasing on the walls.

Jim
Title: Re: soft shadows
Post by: Rbz on August 21, 2008
Works fine on my Geforce 6600GT, but it runs at 17 fps, no surprise for an old 6600GT :)
Title: Re: soft shadows
Post by: hellfire on August 22, 2008
Quote
if you want constructive criticism
I certainly do :)

Quote
there's still a lot of fairly obvious texture aliasing on the walls.
I'm not quite sure which "aliasing" you mean.
First of all there's a rather edgy (and ugly) per-vertex-lighting resulting from the grid-quantization of the mesh.
The shadows on the other hand show some colour-banding. That's because the number of samples is limited and because the distance of the samples grows with distance from the light-source (thus making the colour-bands larger).
But this is barely noticable when additional texturing is enabled.
Finally there's a case where the shadow-map can't really decide if a point is shadowed or not (eg if a ray hits the outer edge of an object); a common problem with shadowmaps producing flickering pixels.

I agree there's quite some potential for improvement on all of these.
Title: Re: soft shadows
Post by: mind on August 22, 2008
well i ran it without a bunch of shit running in the background this time(like lineageII on max settings and stuff) and got a stable 30 fps which was much prettier :D
Title: Re: soft shadows
Post by: Jim on August 23, 2008
I thought it was texture staircasing I was seeing, but I suspect it's actually the per-vertex lighting.  Not a lot you can do about that mach banding 'til we all get 12 or 16bit pixels.  Even if there are 16.7million colours in the palette there are still only 256 levels of grey ;)  Is that where you were trying to use floating point textures?

Jim
Title: Re: soft shadows
Post by: hellfire on August 23, 2008
Hi Jim,
I'm rendering a cubemap at the position of the lightsource and for each pixel store the distance from the lightsource (the standard depth-buffer-shadow approach).
When doing the actual rendering I can check whether the light reaches the pixel or if there's something in between (pixel's distance > distance store in cubemap).
But this only tells if the light for this pixel is on or off, so I repeat the test for the pixel's surrounding and use the median as shadow-intensity.
Of course using 8bit of precision for the depth-information doesn't work very well.
Here 16bit (integer) works quite okay, but floating point represents the values better (smaller steps near 0).
Title: Re: soft shadows
Post by: energy on August 31, 2008
Hi Hellfire...
Nice effect...
About 8FPS on a 2.2 core duo with 2gb ram and 256mb nvidea
Cheers