The 'Stencil shadow' thread

Blitz3D Forums/Blitz3D Programming/The 'Stencil shadow' thread

bytecode77(Posted 2006) [#1]
Hello everybody!

You might remember me and DareDevil... we are the developer of the DevilShadowSystem

Worklog to the new 0.6Beta release: www.blitzbasic.com/logs/userlog.php?user=8270&log=660

So i decided to create a 'stencil shadow' thread. If you have any shadow systems in development or any questions about stencils, post them HERE!

This is the stencil shadow thread.

Regards...


mindstorms(Posted 2006) [#2]
Don't know why your link doesn't work, here is one that should.


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


bytecode77(Posted 2006) [#3]
oops, edited, sry!


mindstorms(Posted 2006) [#4]
Is there any reason why I get about 30 fps for the other demos but only 4-6 fps for the busts?


bytecode77(Posted 2006) [#5]
yes, your computer is slow, OR you have still turned the debugger on :)


mindstorms(Posted 2006) [#6]
Wow, turning the debugger off helps...;)


Picklesworth(Posted 2006) [#7]
WOW!
60 FPS for everything except the "game" one with the complicated room, which starts stays around 60 but drops to 50 on occasion.

Athlon XP 2500+ (1.8 GHz), Radeon 9600 Pro, 1280 MB RAM, and Windows XP Professional.

I think you should have a few more demos of shadows casting onto uneven surfaces in there. Currently the only ones that show that are the tank one and the Swifty clone one.
A staircase would be a nice showcase :)


Mustang(Posted 2006) [#8]
1 - 16-20 fps
2 - 16 fps
3 - 8 fps
4 - 8 fps
5 - 4 fps
6 - 10 fps

These results from my laptop with crappy integrated Intel82855/82855GM GPU (debug off). I'm amazed that demos worked flawlessly although fps was not that great :)


IPete2(Posted 2006) [#9]
Hey Devils Child, Great work (so far).

A quick question if I may, what is the shw file in this line please?

SetShadowMesh(Caster, True, "Media\Warrior.shw")

IPete2.


degac(Posted 2006) [#10]
G R E A T W O R K

@Ipete2: It uses a file .shw to save the info about the shadows as Devils said in his worklog - or I think.


bytecode77(Posted 2006) [#11]
thx for compliments :)

the shw file:

before a caster can cast a volume, he has to initialise the volum caster... this takes 20 secounds for 5.000 polys. Then he saves the 'hacked' data into a file and afterwards he doesnt have to hack the mesh again! he just reads out of this file which is 100-100.000 times faster :)


bytecode77(Posted 2006) [#12]
How about a command refferecne?

InitShadows(Camera) Initialises the shadows. The first command which should be called!
FreeShadows() deletes everything about the shadows.
SetShadowColors(alpha#, r, g, b) Alphe sets the shadow alpha and rgb decides about the shadow colors(should be between 0,0,0 and 40,40,40 at all the times !)
SetShadowLight(ent) Light caster! If you set a secon one, the old one will be automaticly deleted!
SetShadowMesh(ent, casting, path$) - set a shadow mesh. if casting = true then it is a caster and a receiver. otherwise it is a receiver only. when you set a path he writes the informations about the caster down there(this is for the InitTime faster!!!!)
Render(mode) use this instead of renderworld and updateworld. mode0 = no shadows; mode1 = shadows; mode2 = debugmode, volumes only.

do not toucxh any other functions casue the are internal functions. setshadowcaster() is an internal function(for example)

have fun:)


Sledge(Posted 2006) [#13]
Is this using the new algorithms from here?


bytecode77(Posted 2006) [#14]
yes, it is using the third one, but after initvolumecaster() he saves the caster's informations into a file(faster)!

the shadow volume algorithm is by DareDevil, and optimized by me, so i cant take all the credits :)

btw: where is daredevil again? a big part of this shadow system is by him!!!


jfk EO-11110(Posted 2006) [#15]
I guess that' s the most complete stecil shadows implementation for BLitz3D so far, is it?
Great Job!


mr.keks(Posted 2006) [#16]
Tjo, I also like your work, Devils Child! (=

By the way: What's about integrating depth fail? http://en.wikipedia.org/wiki/Shadow_volume#Depth_fail
(Oha, I just read that there's a patent on the method.. )


Naughty Alien(Posted 2006) [#17]
..this is very nice, but its still far away from real use..I hope you'll make it faster..


bytecode77(Posted 2006) [#18]
thx inarie :)
it has 60% of the speed of andreymans fx libary yet! i think we wont speed it up, we rather solve the bugs!

inarie: i cant take all the credits... DareDevil is wokring on the shadow volumes, but he is disappeared yet!?


Filax(Posted 2006) [#19]
Great job devil :) !

But i have a question ? do you plan to increase the shadow rendering on curved surface ? because stencil shadow on
a sphere draw some strange stuff :)

Continue this great lib !


bytecode77(Posted 2006) [#20]
what you mean filax is soft self shadowing. i dont know how it works, but the only thing left to do is improve shadow rendering!

but maybee i can make ENBM work in our system... :)


bytecode77(Posted 2006) [#21]
seems like stencil shadows and ENBM doesnt like each other :(


Filax(Posted 2006) [#22]
Maybe this links help you ? :)

http://www.devmaster.net/articles/shadow_techniques/

http://graphics.cs.lth.se/theses/projects/shadows/so_thesis_lq.pdf

http://www.devmaster.net/articles/shadows/

http://www.gamedev.net/reference/articles/article1873.asp

http://www.gamedev.net/community/forums/topic.asp?topic_id=133985

http://www.3dkingdoms.com/weekly/weekly.php?a=28

http://www.racer.nl/tutorial/shadows.htm


bytecode77(Posted 2006) [#23]
thanks filax, just checking them out, but i dont think i can improve shadow rendering. the only one who can, is tom!

common tom, let us see you shadow rendering algorith(i mean that one, where are no problems with the camera_inside_volume)


mr.keks(Posted 2006) [#24]
öhm, i've been trying to integrate your shadow system into a game of mine (just for a test.. ^^), but öhm, the shadow caster entities aren't rendered at all and every other entity except for my sky cube quad and some few other ones is black. öhm, i guess that you change some rendermodes in a way i don't understand. (i have no clue regarding all these renderstates xD) have you any idea what has to be changed? (the volume building seems to work... render(2) works fine)

ah, and one other thing: how to set a parallel light source? (this of course will only be of interest for me, if you can help me make the shadows working at all ^^)


Sledge(Posted 2006) [#25]

But i have a question ? do you plan to increase the shadow rendering on curved surface ? because stencil shadow on
a sphere draw some strange stuff :)


It's the self-shadowing that's a bit poppy, isn't it? It would be nice to be able to toggle that off, but this is splendid stuff regardless.


bytecode77(Posted 2006) [#26]
@inarie

every entity in the space must be at least a shadow receiver. and remember: you can set as many receivers as you want, it is no speedloss

just check out the next update which will come in 5 minutes :)
SetShadowLight(entity, parallel = False)


bytecode77(Posted 2006) [#27]
UPDATE FOR PARALLEL LIGHT:

DevilShadowSystem.bb


ShadowVolumes.bb


[b]DX7Const.bb



Tom(Posted 2006) [#28]
Here's a demo of my effort, www.tomspeed.com/ss12.zip

w,s,a,d & mouse to move camera, lmb/rmb shadow alpha value, cursors & kepyad 1,0 moves light

Works with static geometry only at the moment, I'm just now looking for a solution for skinned meshes, but I don't think it's gonna be too fast whatever I end up with :)

If you leave the mouse alone when it boots, my FPS settles at 333 fps. 3ghz 32bit XP cpu, ATI x800 gfx card here.

Had some weird results from other people, like 81fps from an amd 800mhz cpu & radeon 9600 (not bad!) ... but only 24 - 40 fps from a 64bit amd 3500 with a I think an FX 5200 card ?!?!?


bytecode77(Posted 2006) [#29]
great job man :-)

can you please make it open source, or can you at least show
me the render code, because the rendering isnt that cute at my system :(...


bytecode77(Posted 2006) [#30]
i have just replaced the fan model with the scene of the swifty sample(i got 36 fps and 200 when SPACE pressed)

your shadow volume function is slow, and my rendering is rubish... how about a deal:

you can juse whatever you want of our system and i can youse your render function?

agree?


Naughty Alien(Posted 2006) [#31]
..hey Tom..this is something what can be used in real project..its seems to be very fast buddy..I hope skinned animated mesh will be supported and then..whoa..circle is rounded..by the way, this is results on my machine..

290-320 FPS
P4, 2.4 GHz, 1 Gig RAM, nVidia 5600FX, 256MB VRAM, Win XP Pro


jfk EO-11110(Posted 2006) [#32]
As far as I know Tom released a stencil shadow source some time ago (well at least the BB source that was calling some dx stuff in a dx7test.dll). Tho I guess he improved it since then. Wasn't there a problem with some Graphicscards that are not creating a stencil buffer by default?

However, great work. This would be really nice, if you both add your work together.

The speed of stencil shadows isn't that great naturally (Of course, the faster you can make it, the better!). You have to deal with it. For example, higher poly meshes could use an invisible LOD clone for the volume creation. Additionally I'd suggest to use a priority flag for every caster: depending on the machines speed meshes with a certain lower priority won't cast shadows automaticly - or the user may choose a detail level manually.


Mustang(Posted 2006) [#33]

Had some weird results from other people, like 81fps from an amd 800mhz cpu & radeon 9600 (not bad!) ... but only 24 - 40 fps from a 64bit amd 3500 with a I think an FX 5200 card ?!?!?



R9600PRO beats FX5200 and I think that plain 9600 does that too:





Just because it has FX in the name doesn't mean it's fast :)

http://www.bjorn3d.com/read.php?cID=264


mr.keks(Posted 2006) [#34]
"every entity in the space must be at least a shadow receiver." <- oh, that's definitely a problem... if i make every entity a receiver (i actually don't want my hud to receive shadows...), i'll also have to remove the receiver-entries when i use freeentiy... and i'll have to register new receivers and so on... is there really no other way? :/


Tom(Posted 2006) [#35]
Damn it, that'll teach me to type in a long post then accidentaly lose the page :|

Anyways, I'll post an updated DLL & info later, then start updating my worklog.

Inarie: That's not always the case don't worry. It'll just be how Devil has coded his system to work, maybe an oversight in his current method.

Devil: I'll pass on some info later to you. I finaly have a way to have full control of all render states, including (when it comes to stencil workflow) the all important ZWriteEnable & ZTestEnable.

The model from Swifts demo, do you mean beethoven? That thing is near 5000 polys! It would hit the frame rate in most shadow volume systems out there.

On another note, it's NOT a suitable mesh to test with as it's isn't a closed mesh. This causes rendering errors which is a bad idea when you're trying to code stencil shadow routines, you'll be blaming your code and searching for bugs that may not exist! :)

More later.
Tom


t3K|Mac(Posted 2006) [#36]
tom, this one looks great. i have to say again: you should team up with mark ;-)


Stevie G(Posted 2006) [#37]
Great work from both of you. If it can be made to work a bit faster I'd love to try this out in my verlet engine :)))

@ Tom / Devils CHild,

As you seem to be the Shadow specialists atm, a couple of questions ...

1. As JFK mentions, is it your intention to include the possibility of the system creating proxy shadow volumes based on a lower poly version of the mesh?

2. Again, on a similar note to Jfk, one thing which I've noticed in alot of games ( even some of the next gen stuff ) is that dynamic shadows appear to be disabled on objects which are over a certain distance from the camera .. such a feature would be great for slower systems.

3. With such systems and a static light source is it possible to render a static lightmap mesh which is included in the rendering process but not the volume building?

4. Can directional light sources be used with stencil shadows?

Cheers
Stevie


bytecode77(Posted 2006) [#38]
1. yes, i tried that a certain time ago and it looks really ugly!
2. you mean that object shoul cast their shadows only a few meters far, and that the self-shadowing of spheres should be improved... that is not so easy and i think it would need shaders!
3. maybe i include static objects when i have time for it :) let's see..
4. what you mean is parallel light, and this is supported in the update a few screens above(the 3 codeboxes are the include files!). it works pretty easy! he just moves the light source very far away from the scene. so it is a 99.9% parallel light


Stevie G(Posted 2006) [#39]
Re ..

1. It probably would look ugly if they also self-shadowed 'cos your visible mesh will be different. Without self-shadowing I'm sure they'd be fine.
2. Not as low as a a few metres and not really related to self shadowing. Simply a built in lod type thing to ensure that closer objects project shadows but those further than a certain threshold from the camera don't.
3. Fair enough. Looks forward to seeing what you do.
4. Ah ... never head it being called parallel light before and haven't tried the new demo.

Cheers
Stevie


Tom(Posted 2006) [#40]
1: In my own system, I've not looked at that yet.
2: That'd be easy to implement
3: Stencil shadows render on top of whatever other light you use, lots of games do it
4: Mine just does point lights at the moment, but same answer as #2.


bytecode77(Posted 2006) [#41]
wrote you a little email tom :)


Dock(Posted 2006) [#42]
Just tried this out, it runs great - nice work! ^-^
It's a shame that self shadowing is a bit 'poppy', but otherwise the results are great.

1. Is there any way to specific a specific mesh to have no self shadowing, but still cast and receive shadows?

2. Do you think it would it be possible to make this code work with vertex animated objects in future?


Ross C(Posted 2006) [#43]
I think people are forgetting too, that alot of games don't cast shadows onto the actual geometry, but they create a less complex mesh to receive the shadows. A bit like creating a low poly version of your landscape, that is invisible and only used for collisions.

Shadow systems look great guys :o)


bytecode77(Posted 2006) [#44]
thx guys :)

@dock:
1. yes, it would be easy to impement, but nobody wants that :P
2. i guess not. i got too many problems with b3d animations!


Stevie G(Posted 2006) [#45]
@ Devils Child,

1. If it's easy then you should consider it as a user option. I for one would like to see it in 'cos some of that self shadowing can look awful on low poly meshes.

I can't deny that it had potential to be a great system though.

Stevie


Sledge(Posted 2006) [#46]
1: Ditto - if it's easy to implement then it would be appreciated.


Mike0101(Posted 2006) [#47]
This topic is very good, everybody try to make something good shadow system.
But I don't understand the author of Blitz3D why not
give help or why not give shadow system at Blitz3D.
I like Blitz and this is an opinion only.
Today every lowcost gamemaker system (free engines too) has shadow system.


t3K|Mac(Posted 2006) [#48]
i want it! no self shadowing.... as an user option. this would be great.


Mike0101(Posted 2006) [#49]
Yes, selfshadowing is a plus thing optional, but a fast , simple shadow system would be very important


bytecode77(Posted 2006) [#50]
first at all i have to improve rendering, because all i will improve now, will be overwritten by the new render algorithm! thats the meaning of why it doesnt support it yet :P


Mike0101(Posted 2006) [#51]
The must important thing is the efficiency.
I was buy adreyman system for 25 $ but is very buggy
and slow and no support no anwers from the russian.
Now in a simple TPS action game are 3-6-8 lowpoly (cca. 1.500/model ) animated models in same time on scene.
The map ( 30.000 ), other dynamic objects ( 10.000).
A good shadowsystem can (must) render this with good 40 - 50 fps.

Right?


bytecode77(Posted 2006) [#52]
yes :) but this is not that easy, our system works takes 20 millisecs on 20.000 shadow polys! to initialise 20.000 polys it takes 1:20 minutes when you disable file-saving. when you enable: 110 millisecs. so you can say it is fast enough!


sswift(Posted 2006) [#53]

The model from Swifts demo, do you mean beethoven? That thing is near 5000 polys! It would hit the frame rate in most shadow volume systems out there.

On another note, it's NOT a suitable mesh to test with as it's isn't a closed mesh. This causes rendering errors which is a bad idea when you're trying to code stencil shadow routines, you'll be blaming your code and searching for bugs that may not exist! :)



Muahahaha! That's what you get for stealing my model which I stole from a website with free 3D models and duplicating my demo exactly!

Actually I don't care. I'm more bemused than anything.

And I would like to point out that MY system handles boned vertex-animated B3D meshes, AND beethovens! :-)


Chroma(Posted 2006) [#54]
Tom, those shadows look just awesome. They'd go well with my rpg I'm working on. All the walls are very simple geometry. Can't wait to try this out.


bytecode77(Posted 2006) [#55]
sswift:andreyman stole your shadow system demo exactly, too! and i did, to compare them :)

tom: yeah, i would like to see it, too!


Xilvan(Posted 2006) [#56]
When I start a demo, I get the following error:
Function 'DX7_SetSystemProperties' not found


bytecode77(Posted 2006) [#57]
move the userlibs into your blitz userlib directory.


Carrot(Posted 2006) [#58]
Hi and well done on this fantastic contribution!

I have one problem though. You say that you've had problems using B3D files, but because MD2s aren't meshes, it means that most of my current models (all md2/b3d) are unusable with the shadow system!
I'd imagine that most people here use one or both of these for animated models and so it might be worth trying to figure out a way of getting b3d models to work with the engine...

thanks, and good luck!


mr.keks(Posted 2006) [#59]
b3d models work! but those models that vertices you cant handle with b3d might make trouble (md2, terrains, bsp)


bytecode77(Posted 2006) [#60]
carrot: i tried to figure it out, but there was no way yet!! b3d animations might be possible some day, but not md2!! because md2 models are no meshes, and they havent got any vertices or triangles which can be accessed by blitz!

for terrains you just have to use a meshterrain loader ;)

btw: andreymans stencil fw libary doesnt support b3d animations yet, too. so dont matter about that!


JustLuke(Posted 2006) [#61]
Just because another library doesn't support b3d animations does not mean that it isn't important. I've been following this thread with interest (and I'm impressed with your work), but I suspect that for many, if not most, people, support for animated b3d models is essential.


kevin8084(Posted 2006) [#62]
if you go here to look at the md2 specs, I think that perhaps the vertices and triangles CAN be accessed:
http://tfc.duke.free.fr/coding/md2-specs-en.html


Barliesque(Posted 2006) [#63]
I'll second JustLuke's comments.

I'm hoping that GrumpyOldMan's library may offer a new solution. We'll have to wait and see how that progresses, but at the moment, it appears to handle boned animation better than Blitz's own system. So perhaps, his library may also allow access to the information needed to create stencil shadows for bone-animated meshes.


Barliesque(Posted 2006) [#64]
...also, at some point in the render process, the data of an MD2 is turned into polygons, just like any other mesh. Again, it's a matter of gaining access to the necessary data.


kevin8084(Posted 2006) [#65]
After playing around with the .md2 format I came up with a little program that accesses a single vertex. I checked it against the .md2 model that I created and it is accurate. The code can be adapted to read ALL of the vertices and triangles. Pardon the mess as I left in unused types (they WILL be used, however, if you are to read the entire .md2 file). The file has only minimal error checking and you have to provide your own model (I have the filename hard coded)


**** EDIT *******
Looking back at my code I see some minor errors such as not making some variables "float". The principle, however, remains the same. This code is free for any to use, by the way.
Kevin


bytecode77(Posted 2006) [#66]
thx kevin. i will check it out now :)


kevin8084(Posted 2006) [#67]
No problem. Hope that it helps :)


Hellei(Posted 2006) [#68]
I have downloaded your DSS_Release_0.6b, but when I start the program, he sais he doesn't find the getcamrangestart. Where can I download it?


bytecode77(Posted 2006) [#69]
just added b3d animations:


now *.x *.3ds and *.b3d animated objects are supported!
the next release will be in aproxx 2 months(without garanty)


b32(Posted 2006) [#70]
he, that's nice work devil!


jhocking(Posted 2006) [#71]
This looks really interesting. However, the sudden changes in shading of polygons is really jarring. Is there any way to smooth that out?

I have downloaded your DSS_Release_0.6b, but when I start the program, he sais he doesn't find the getcamrangestart. Where can I download it?

I was getting that error to until I copied the userlibs into Blitz3D's userlibs directory.


mongia2(Posted 2006) [#72]
thanks

2 months .........


goood work!


bytecode77(Posted 2006) [#73]
i dont know how to smooth it out. maybee playing arroud with the ambient light should do it...


Dreamora(Posted 2006) [#74]
There is a bug in the Init function.

It tries to init 1024x786 instead of 1024x768 :) (wanted to see its true speed so put it into full screen, with no waittimer and flip 0 ... get up to 100 FPS in the example 5 on my 7600Go which is quite nice :)


bytecode77(Posted 2006) [#75]
oops mistyped (sry)
a wonder you got 100 fps in the stress test!
i get 30 fps, and i am using the stress test to see wether my current optimazion was good, or not...


t3K|Mac(Posted 2006) [#76]
nice work!!!


Flame(Posted 2006) [#77]
I get only 10 FPS on my end :|

Anyways, is it possible to use MD2's or will it simply not work...

If it can't, does any one know of a MD2 -> B3D converter? I would really like to use this in a game but until then, I'll use my theory: Squish everything to a pancake, move it down at the feet, then keep it there until the Y axis of the parent model is constant then move the Y of the shadow. It doesn't do Devil's stencil system, but for something that doesn't kill FPS that much and it's the only thing I know to use...


bytecode77(Posted 2006) [#78]
if you wanna get more speed, you have to turn off the debugger!!

if have studied the md2 model format, but without any result!
btw: there is no shadow system which supports md2!! (or at least no STENCIL shadow system or a better one ...)


Baystep Productions(Posted 2006) [#79]
Umm I get a missing function error for

MoveEntity ShadowPlane, 0, 0, GetCamRangeStart(ShadowCam) + .001

That GetCamRangeStart function is not there.


Flame(Posted 2006) [#80]
Well, I use MD2's alot, and I've made a shadow system... but with no name. I'll take a screen shot of what I'm using/made.

EDIT:
...AH Heck... I have no clue what the forum cmds are...


Mustang(Posted 2006) [#81]
forum codes:

http://www.blitzbasic.com/faq/faq_entry.php?id=2


bytecode77(Posted 2006) [#82]
flame: is this a stencil shadow system or a texture shadow system?


Carrot(Posted 2006) [#83]
Devil: Do we need to wait for the next release in 2 months before we can use the new code for the b3d models?

Also, it seems that using the sample code provided Kevin above should make md2 models possible at some stage.

Again, great work.


bytecode77(Posted 2006) [#84]
b3d models are not supported in the 0.6 beta above^^
but you can implentate your shadow code, and let the b3d models be receivers only until in 2 months!

also i cannot promise that b3d models will work perfectly. my ant is working seamless, but all my other models are doing strange things!

we'll see whether b3d models will work seamless! if not, don't be angry at me :)


Tom(Posted 2006) [#85]
@Devils Child: I'll be on Irc at 7pm GMT if you wanna catch up on this stuff ok :)

but all my other models are doing strange things!


I've had problems with skinned meshes too. This is what I think is the cause.

To get a transformed vert from a skinned mesh, I store all vertices positions in the local space of the bone which has major influence on them. I'm discarding blended weighting for now in the hope it speeds things up a bit.

Bones in a mesh have a 'rest pose'. You must do the above routine when the bones are in this rest pose, else their recorded local bone offset will be wrong, which will cause your TFormB3DVertex() function (or DLL or whatever method you're using) to return bad values.

When creating a skinned mesh, record the rest pose at frame 0, this seems to work ok for me.

You can just see the errors this causes on this robot2.b3d mesh, look closely at the gun/hands and the antenna, there's what looks like ghost geometry. This mesh has no keyed rest pose at frame 0!

In fact, as a quick test, load 2 versions of your mesh, one using LoadMesh() and the other using LoadAnimMesh()

If they don't look exactly the same... you're going to have problems.




bytecode77(Posted 2006) [#86]
i'll be there!


bytecode77(Posted 2006) [#87]
here is another screenshot to keep you entertaining :)



Flame(Posted 2006) [#88]
Sry I didnt' respond in a long time. No, my system doesn't use either... well, It's not a true stencil system, and it's not texture based... so I'm not sure what to put it under as...

All that happens is I do some tweeking with the model that has to be shadowed so it creates a shadow of itself... Is that stencil, because if it is, then I might have the only MD2 compatible Shadow system...


bytecode77(Posted 2006) [#89]
as far as i understood, you are squishing the md2 mesh down to the floor, right?

this is no stencil shadow system. and it is not very compatible :/


Flame(Posted 2006) [#90]
For something that barely hurts FPS and is understandable, it works fine with me... sure, it's not the BEST thing out there, but again... for something that requires no brain surgery or headaches...or both...


bytecode77(Posted 2006) [#91]
i can understand you, and now i wanna tell you the story of my life:

one year ago, in the thread "stencil shadow volume demo" by tom, if found my idea to make a stencil shadow system.
i tested the code, but at first it was ATI unfirendly! But then he made a fix, and i tried harder on it!
then i made a function which creates volumes from each polygon. not just from the edges! that means a caster with 100 triangles would cast 600 shadow polys. just *6! this looks weird with toms old stencil demo, so i improved it to the carmacks reverse by braincell!
well, for a long time i frozen all researches, cause i thought, i never make a good shadow system :D.
2 months ago, daredevil made a stencil shadow system, too. he had a good volume system, but a slow software-stencil-buffer. so we decided to move together. so we put his volume function optimized into my current system! then, i made some samples and we published the first alpha version of this shadow system! 3 weeks after it he made a new algorithm for shadow volumes...and when he was ready, i checked out that aglorithm. it took a lot of time to initialise the casters, so i build a *.shw caching file.
then i was playing arround with bona animation, and found out, that they can easily be set to a shadow caster by recursive setting each bones!
then i published it to this 0.6 beta!
not b3d models are barely working and the system was more flexible ever :)

this was the time of my life!
between all that sentences were hundrets of ours of research!

bye


Dock(Posted 2006) [#92]
Great work Devil's Child. You and Tom and Daredevil have achieved amazing things with this system.

I'd love to see an EXE demo of the ant test you have there, even if there is no source. I'd still like to be able to disable self-shadowing on certain objects if at all possible.


bytecode77(Posted 2006) [#93]
first tom and i have to improve the rendering, before i can improve all other wishes :) but i will do it!


DareDevil(Posted 2006) [#94]
Good .... Good Work!!


DareDevil(Posted 2006) [#95]
Hi Devils Child

Hi All


This is a light optimization , in the "sample 5 " is increment 10-15%




the system is improve create a check for control object in range light, if object in range calculate, if not jump

;)

Bye


bytecode77(Posted 2006) [#96]
allright dare :)
just improved it!
cya


Panno(Posted 2006) [#97]
cool

can i disable the self shadows ? i mean if i will have shadows
only on grounds or walls ?


bytecode77(Posted 2006) [#98]
no, i said not yet! it will be supported in the next demo!


bytecode77(Posted 2006) [#99]
~CLOSED~

this shadow thread is now ready to burst.
please write ahead in the new stencil shadow thread 2!!!
http://www.blitzbasic.com/Community/posts.php?topic=62809


@any moderator: close this thread please!