Realtime raycasting in a fragment shader

Tonyo

Newcomer
I'm working on a pet project http://wildfred.dsl.pipex.com/raycast/index.html. It's still incomplete, but there are enough pretty piccies to make it public :)

I hope you'll enjoy it!
[EDIT: Added pretty pic]
sthelens_softs.jpg
 
It's good to see people use a shader for something other than water. Keep up the good works. Even as a hack the soft shadows look pretty good.
 
Nice, now how about benchmarking it against a version running on the CPU using ray to ray coherence? :)
 
µße®LørÃ￾ said:
Is that hardcoded to the P10, or just utilising DirectX?
If the latter will you be doing a public demo? I'd like to see this work on my Parhelia ;)

Hummmm ... you cannot do it in DX because DX (8.0, 8.1, 9.0) doesn't support looping and conditionals in the fragment shader. The demo as it stands needs to be able to use loops and dynamic conditionals in the fragment shader.
 
MfA said:
Nice, now how about benchmarking it against a version running on the CPU using ray to ray coherence? :)

Thanks :). Doh, too bad I know nothing about ray to ray coherence :oops:, maybe someone can do that for me and then we can compare results ;)
 
3dcgi said:
It's good to see people use a shader for something other than water. Keep up the good works. Even as a hack the soft shadows look pretty good.

Thanks for the kind comments :). I also like the soft shadows a lot: after coding them, I stared at them 10 minutes jaws dropped :eek:
 
AFAICS with the orthographic projection shown in the screenshots (no roll) you can use the same method as is used in what are sometimes known as voxel engines, sweeping a ray up a pixel column will give intersections which in turn form a straight line on the heightmap. Of course an intersection for a pixel further up the column can only occur farther along the line on the heightmap, ie there is coherence between the two rays and their intersections, so you can use the last intersection as a starting point for the search (well if you were doing it on the CPU anyway :).

BTW are you sure the hardware actually implements that break command? (Could just be some syntactic sugar.)
 
MfA said:
AFAICS with the orthographic projection shown in the screenshots (no roll) [...] so you can use the last intersection as a starting point for the search (well if you were doing it on the CPU anyway :)

Well, the demo does roll, pitch and yaw :), but I get the optimisation idea, obviously not applicable to the VPU because of data dependencies (as you suggest), but interesting nevertheless, thanks :)

MfA said:
BTW are you sure the hardware actually implements that break command? (Could just be some syntactic sugar.)

No additives here :), the hardware does support data dependent jumps (i.e. breaks).

[EDIT] I just noticed the "3D Architecture and Coding" forum is actually alive, maybe I should have posted this thread there (in fact there's a related LittlePenny thread on raycasting!). Can some admin move this thread there? (I don't think I can do it myself :?)
 
Back
Top