Author Topic: soft shadows  (Read 11177 times)

0 Members and 1 Guest are viewing this topic.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
soft shadows
« 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).

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, 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.
« Last Edit: August 21, 2008 by hellfire »
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: soft shadows
« Reply #1 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.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: soft shadows
« Reply #2 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.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: soft shadows
« Reply #3 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.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: soft shadows
« Reply #4 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.
« Last Edit: August 21, 2008 by hellfire »
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: soft shadows
« Reply #5 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?
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline mind

  • Texture-San
  • DBF Aficionado
  • ******
  • Posts: 2324
  • Karma: 85
    • View Profile
    • boredom is a beatiful thing.
Re: soft shadows
« Reply #6 on: August 21, 2008 »
looks nice, but the fps is horrible on my system.. dualcore 2.4, gf9500 something, i get like 8 fps :(
Challenge Trophies Won:

Offline AnimalMother

  • btst #6,$bfe001
  • Atari ST
  • ***
  • Posts: 113
  • Karma: 7
    • View Profile
Re: soft shadows
« Reply #7 on: August 21, 2008 »
Runs fine & smooth here. Athlon X2 6000, 4GB Ram, 8800GTX 768MB, Vista Home Premium 64 @ 62 FPS  8)

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: soft shadows
« Reply #8 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.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: soft shadows
« Reply #9 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:
Shockwave ^ Codigos
Challenge Trophies Won:

Offline AnimalMother

  • btst #6,$bfe001
  • Atari ST
  • ***
  • Posts: 113
  • Karma: 7
    • View Profile
Re: soft shadows
« Reply #10 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

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: soft shadows
« Reply #11 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!
« Last Edit: August 21, 2008 by hellfire »
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: soft shadows
« Reply #12 on: August 21, 2008 »
@Avi Capture: Wow the effect is awesome.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: soft shadows
« Reply #13 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.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: soft shadows
« Reply #14 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
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: soft shadows
« Reply #15 on: August 21, 2008 »
Works fine on my Geforce 6600GT, but it runs at 17 fps, no surprise for an old 6600GT :)
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: soft shadows
« Reply #16 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.
Challenge Trophies Won:

Offline mind

  • Texture-San
  • DBF Aficionado
  • ******
  • Posts: 2324
  • Karma: 85
    • View Profile
    • boredom is a beatiful thing.
Re: soft shadows
« Reply #17 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
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: soft shadows
« Reply #18 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
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: soft shadows
« Reply #19 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).
Challenge Trophies Won: