3 algorithms for shadow volumes!

Blitz3D Forums/Blitz3D Programming/3 algorithms for shadow volumes!

bytecode77(Posted 2006) [#1]
hello!

as you may know, i've been working on stencil shadows since ~ 7-8 months day&night. in my worklog is the system(by me and daredevil!) this system is using the second algorithm, but since a week it is using the third algo!

here are 3 algorithms for shadow volumes. they are not by me, but they are optimazed by me!
use it as yours!




[b]Use keys 1-3 to toggle the algorithms!


Stevie G(Posted 2006) [#2]
There's a bug on line 368 ...

state1 = ad1<b>

Should be

state1 = ad1[b]

Pretty fast though :)

Stevie


bytecode77(Posted 2006) [#3]
oops, mistyped it a lil bit, but ok.

ps: if you want to use these algorithms, i would reccomend the third one.


Sledge(Posted 2006) [#4]
This is cool. What's the recommended way to use it - ie to end up with an image that shows only where the shadows intersect something, rather than the entire projection?


Subirenihil(Posted 2006) [#5]
Wow! This is cool! But could you give us some code for, like Sledge said, just the actual shadow?


bytecode77(Posted 2006) [#6]
i have got problems with my upload... in a few weeks i will post the new shadow system with the algorithm no 3.
but the shadow system is using the second one yet:

it is easy to implement the other one if you wanna work with it, but i have optimazed a lot!!! for exaple, he saves the 'hacked' data about the mesh into a file and so on...

http://www.blitzbasic.com/logs/userlog.php?user=8270&log=660


jfk EO-11110(Posted 2006) [#7]
Thanks a lot! I guess it would be pretty easy to use it with one of the recent stencil demos, eg. by Tom that us using DX7 extensions, or the one that is made in plain blitz that is using some tricks.
I haven't got the links right now, but a search for "stencil" should bring them up.


bytecode77(Posted 2006) [#8]
now i got it uploaded! the third algorithm is used in our system here:
http://www.blitzbasic.com/Community/posts.php?topic=62378


b32(Posted 2006) [#9]
wow .. very nice!