New raytraced shadows demo

Humus

Crazy coder
Veteran
Another demo to waste your precious time with. And I'm hardly even joking, kicking around those balls can be an incredibly fascinating thing. I've spent too much time doing that today when I should be tuning the code ... :p

Anyway, this demo is about raytracing the shadows. The shader gets a list of spheres and computes the shadows from that. No stencil volumes or shadow mapping, just a plain list of objects. Easy enough for simple object like spheres.

raytracedshadows.jpg


http://esprit.campus.luth.se/~humus/
 
Left mouse button. Press and hold, get close enough to a ball and release the button. The longer you hold the harder the kick.
 
Yeah, I've heard that from other 6800 owners too. * Waits for Ruined to pull his usual rant *
No shadows would most likely mean that the shadow shader writes 1 to alpha for some reason.
 
holy gods!

fascinating Humus, brilliant as usual. just one complaint this time, ive just spent the last 10 mins trying to get my mouse back.

i doubled clicked it, and my mouse dissappeared. any mouse movements just moved teh room around.

couldnt even CRTL ALT DELETE cos that just moved the FOV also.

that was AMAZINGLY annoying!

other than that - the gfx tech is outstanding... can you implement more complex shapes? Or more Lights? Cos it runs flawlessly on my 9800Pro, let alone my X800XT.

Edit = *d'oh* just found out that my ESC key is broken on that keyboard. WTH uses the ESC key anymore :)
 
PoGGeh said:
other than that - the gfx tech is outstanding... can you implement more complex shapes? Or more Lights? Cos it runs flawlessly on my 9800Pro, let alone my X800XT.

Heh well as long as the shapes can be expressed parametrically it should be able to be done with them. The only issue is more complex shapes take a lot longer to do. Heh spheres are so nice and easy to work with ^_^.
 
Doesn't work on a 9800XT with Catalyst 4.5 (it changed the resolution and did nothing, I had to kill it), I will try it on a GF FX and maybe a 6800U later.
 
Nice demo.

It would be nice to have some physics there - but I can see that was not the point of the demo.
 
How did you get soft-shadows with ray-tracing? I can't see shadows or the light source with this demo. It's kind of wierd seeing no shadows and light coming from no light source.

Could you use wasd instead of the arrow keys?
 
Rofl its funny knocking the balls around, why doesnt the fps change when i change AA/AF, is it cuz i have temporal aa on`?
 
Hyp-X said:
Nice demo.

It would be nice to have some physics there - but I can see that was not the point of the demo.

Well, there is some kind of physics in there, though it's not entirely correct. I only applied a one-dimenional collision model on each component. It works fairly ok, but you can see it's not correct when the collision isn't a direct frontal one.
 
pat777 said:
How did you get soft-shadows with ray-tracing? I can't see shadows or the light source with this demo. It's kind of wierd seeing no shadows and light coming from no light source.

I simply compute the point between the light and the fragment that's closest to the sphere. If that point is within the light radius, then the fragment is in shadow. But instead of doing a float(radius < dist) test, you can do saturate(softness * (dist - radius) + 0.5) to soften according to the distance to the edge. I used the same technique in the self shadow bumpmapping demo for the horizon map.

pat777 said:
Could you use wasd instead of the arrow keys?

Use the F1 menu to configure.
 
Humus said:
pat777 said:
How did you get soft-shadows with ray-tracing? I can't see shadows or the light source with this demo. It's kind of wierd seeing no shadows and light coming from no light source.

I simply compute the point between the light and the fragment that's closest to the sphere. If that point is within the light radius, then the fragment is in shadow. But instead of doing a float(radius < dist) test, you can do saturate(softness * (dist - radius) + 0.5) to soften according to the distance to the edge. I used the same technique in the self shadow bumpmapping demo for the horizon map.

pat777 said:
Could you use wasd instead of the arrow keys?

Use the F1 menu to configure.
Great work, Humus. FPSes made got me used to wasd. :)
 
Humus said:
Another demo to waste your precious time with.

NEAT!

I have downloaded all of your later demos now that I have a videocard that can show them. Only problem is I can't get the instancing demo to run. It opens the window, then pops up an error box that says:

"Couldn't initialize Direct3D
Make sure you have DirectX 9.0c or later installed."

Then comes a second error window on top of that one with no text at all other than the word "Error" in the title bar and an OK button...

Only problem with this is, I HAVE DX9.0c installed. And yes, I grabbed the latest version just now when I nabbed the shadow demo, it behaves just the same way.
 
Humus said:
Yeah, I've heard that from other 6800 owners too. * Waits for Ruined to pull his usual rant *
No shadows would most likely mean that the shadow shader writes 1 to alpha for some reason.
Change line 59 in OpenGLApp.cpp to this:

Code:
		pf.alphaBits, 0,
otherwise you won't get an alpha channel in the pixelformat.
 
On the NVNews.net forum Humus mentioned that if you have a previous (beta) version of DX9.0c, there could be a remaining conflict. . . *shrugs*

Speaking of NVNews. . . it's amazing the amount of flak Humus gets there when a demo doesn't perform better on NVidia hardware. . . (Also interesting how Ruined basically cuts and pastes his posts between forums.)

Back on topic: Neato! :D
 
Guden Oden said:
NEAT!

I have downloaded all of your later demos now that I have a videocard that can show them. Only problem is I can't get the instancing demo to run. It opens the window, then pops up an error box that says:

"Couldn't initialize Direct3D
Make sure you have DirectX 9.0c or later installed."

Then comes a second error window on top of that one with no text at all other than the word "Error" in the title bar and an OK button...

Only problem with this is, I HAVE DX9.0c installed. And yes, I grabbed the latest version just now when I nabbed the shadow demo, it behaves just the same way.

I assume you installed DX9.0c before the official release. So did I, and I had the same problem the first time I compiled anything with the DX9 SDK summer 2004 update. I had to uninstall DX9.0c, and install the official release. That still didn't install all files properly so I had to manually copy all .dll to the system dir. Beware of the evil of windows file protection which likes to undo your work ... at least for me. Loads of hassle until I got thing set up properly.
 
Back
Top