Stencil Shadow Volume demo

Blitz3D Forums/Blitz3D Programming/Stencil Shadow Volume demo

Tom(Posted 2004) [#1]
The new SystemProperty$() commands has opened up Blitz to stencil ops, here's an example of shadow volumes. The guts of the code is from one of the DX 7 SDK examples.

NOTE! This is very raw! No pixel format checking at all, and some of the guys in Irc (all with ATI cards it seems) get a garbage display instead of eye candy so PLEASE don't complain if it's screwed up, I'm a crap coder and I've only been looking at the DX 7 SDK since v1.88 :) But that can be fixed with some checking.

anyways, just wanted to post to show a hardware shadow solution is possible since v1.88, alongwith maybe some other tricks.

http://www.tomspeed.com/ShadowVolume.zip



Oh yeah, if the demo works (hehe) the sphere represents a shadow volume, which in game terms, would normaly be produced 'on the fly', that could be costly, and unfortunately building a shadow volume from an animated mesh could be near impossible because we can't access deformed vertex position right now, but you never know :)

Cya
Tom


mongia2(Posted 2004) [#2]
thanks for demo...
work fine

Mongia


Damien Sturdy(Posted 2004) [#3]
oh, freakin' wow man! freaking WOW!!!!!!!!!!

i mean...

YEEEAAAHHHH! :D


Shambler(Posted 2004) [#4]
OMG it almost makes me feel like coding again! ;O


Eric(Posted 2004) [#5]
How did you do this? Can we see the code?


Tom(Posted 2004) [#6]
http://www.tomspeed.com/shadowvolume/
Use at own risk!

Remove the texture references.

It's definately ATI unfriendly at the moment.

Don't forget, v1.88 needed.


Bot Builder(Posted 2004) [#7]
Screenie is sweet :D

This is basically the problem for ati cards:
Graphics3D 640,480,32,2
cam=CreateCamera()
PositionEntity cam,0,3,-6
RotateEntity cam,30,0,0

shadowplane=CreateCube()
ScaleMesh shadowplane,10,10,.1
EntityColor shadowplane,256,256,256

CameraClsMode cam,False,False

While Not KeyHit(1)
	Cls
	RenderWorld
	RenderWorld
	Flip
Wend


Double render world apparently throws up a bunch of odd artifacts 0_o. This snippit doesnt work on anyones card as far as i can tell. Probably what's happening is since the zbuffers are the same between frames it thinks only a little if any should be drawn... Dunno why it clears the color buffer if this is the case though.


Tom(Posted 2004) [#8]
www.tomspeed.com/shadowvolume/

Updated, looks a bit better now with semitransparent blending. Now to fix this ATI thing and add some pixel format checking.




Eric(Posted 2004) [#9]
This has the making for a nice shadow library... I'd pay money for a simple to use shadow system.


.rIKmAN.(Posted 2004) [#10]
Nope, doesn`t work here either... 128Mb Radeon 9600 as in sig...


BODYPRINT(Posted 2004) [#11]
Yep Radeon 9800 Pro here comes up corrupt as well.


TartanTangerine (was Indiepath)(Posted 2004) [#12]
This is sweet :)


Jeroen(Posted 2004) [#13]
ATI 9700 fails. Nice screens though


bruZard(Posted 2004) [#14]


ATI 9600


fredborg(Posted 2004) [#15]
Tom baby, you rock!


_PJ_(Posted 2004) [#16]
Umm.. Just a thought - sorry I cannopt test this or do anything myself atm...

What if you had two shadow-volume spheres?

Would the overlap be darker????


HNPhan(Posted 2004) [#17]
this i really nice man, I wonder what else can be done,
mind explaining us what are all those commands o_0


Beaker(Posted 2004) [#18]
Malice - the overlap wouldn't be darker.


Dreamora(Posted 2004) [#19]
Really nice
although the shadow stuff does not work, the command itself is very usefull to activate other states :)


Neochrome(Posted 2004) [#20]
-


Difference(Posted 2004) [#21]
I made it work on my Radeon 9600XT.

I put this in the top of the loop, assuming it was a problem with clearing the z buffer.

While Not KeyHit(1)
CameraClsMode cam,True,True
RenderWorld	
CameraClsMode cam,0,0
.start



Ion-Storm(Posted 2004) [#22]
Works dandy.

on my GF2 Gf4


Dreamora(Posted 2004) [#23]
has someone a mistake free version of the source code that gives the right result?


BODYPRINT(Posted 2004) [#24]
Peters fix works for me too :-)

Looks good.
[edit]
except the sphere doesn't fade in the background.
[/edit]


Difference(Posted 2004) [#25]
except the sphere doesn't fade in the background.
Yeah, I know, but I'm on irc with Tom right now, and he's looking into it


BODYPRINT(Posted 2004) [#26]
Replace
ShowEntity sphere
with this line
If sv Then ShowEntity sphere
just before the last renderworld to hide the sphere.


Panno(Posted 2004) [#27]
cool


Tom(Posted 2004) [#28]
I think the ATI problems are something to do with theway Blitz clears the Zbuffer, it needs to be False,False else every RenderWorld will clear them, and we don't want that.

The DeviceClear() should be clearing everything as needed at the beginning of each loop.

Here's a rough rundown of how all this works b.t.w (let's see if I got it right :)


Clear all buffers & render target

Show scene items

Enable Z writes, Disable Stencils

Renderworld (Color & Zbuffer is written)

Disable Zbuffer writes, hide scene, show shadow volume

Set stencil OPs, now the next RenderWorld affects Stencils only

RenderWorld (check each pixel Z value against old Zbuffer, write to Stencil on result)

Flip shadow volumes to now test back faces

Renderworld (check each pixels Z value against old Zbuffer, write to Stencil on result)

At this point, the Stencil Mask would only show pixels in the Scene, that are inside the shadow volume!

Now Disable Stencils & Zbuffer Writes, put a Shadow Plane in front of the camera, and set Stencil OPs to only render parts of the Shadow Plane where the Stencil = 1 (draws shadow color!)

Simple when you think about it, but the code looks messy :)


Paolo(Posted 2004) [#29]
Tom,
this is excellent.
I can't believe how fast you worked this out.

This community never stop impress me :)

Now it is time to start testing... testing ... testing ... oh yeah :)

Paolo.


Difference(Posted 2004) [#30]
New fix that does not add a renderworld:
Use Phil74's "If sv Then ShowEntity sphere" too.

Replace the first renderworld with this, commenting out the DeviceClear:
	DeviceClear(Direct3DDevice7, 7,$00008080,1,0)
	CameraClsMode cam,True,True
	RenderWorld
	CameraClsMode cam,False,False


[EDIT]: tests show that you should keep the DeviceClear on Nvidia cards. Since it works ok on ATI too, I'll leave it in for now.


jfk EO-11110(Posted 2004) [#31]
Now this is something truely revolutionary.


poopla(Posted 2004) [#32]
For blitz anywho :).


Tom(Posted 2004) [#33]
It will be if it can be put to good use :)

For shadow volumes there are issues to think about:

1: Building shadow volumes on the fly could be costly

2: Deformed animated meshes, we can't get deformed vertex positions! Blood suggested recording deformed data from your 3D app, but, what about render tweening? (verts are then interpolated! :/ )

3: Is it faster than a software solution?

The software solution would be something like sswifts shadow system, but that uses shadow mapping.

With the new access to core of DirectX, maybe a RenderToTexture() function could be made, which would speed up a software shadow mapping solution?

Food for thought!

There are other things possible of course, decals, fades, torch lights...


To sswift if he reads this:
What would you say was the biggest slowdown in your shadow system?

Tom


sswift(Posted 2004) [#34]
"With the new access to core of DirectX, maybe a RenderToTexture() function could be made, which would speed up a software shadow mapping solution?"

In some instances, it would.


"What would you say was the biggest slowdown in your shadow system?"

Both rendering shadows and culling polygons to generate shadow meshes are costly. My system is culling limited when working with complex levels and lots of casters. But if you run my shadow demo, and crank up the shadow resolution and use two lights you will see the shadow map rendering can kill the framerate in some cases.

Rendering directly to a texture would greatly speed up the shadow map rendering. In most games that might translate to a gain of several FPS. I have optimizations in place to reduce rendering which speeds things up, but that doesn't work on animated meshes which are what most people use.

A stencil shadow system is likely to be a lot faster than my system. But the stuff we've seen so far is only the tip of the iceberg as far as making one. You still need a way to generate the shadow volumes. I'd have to read up on how doom does that but I know it involves deforming the mesh on the video card. And it may require vertex shaders.

I think the current state of stencil shadows in Blitz would allow one to have theor levels cast stencil shadows. Static ones at least. Dynamic would be possible but probably too slow in software.

I think you need vertex shaders to do dynamic stencil shadows.


Braincell(Posted 2004) [#35]
Oh this is strange, but nice. I just figured out a software way of doing stencil shadows and then this guy puts this on. No need for me to share my ideas now, this is probably faster. We still have the problem of making shadow volumes for animated meshes, but NOT for solid ones.


Regular K(Posted 2004) [#36]
Looks nice :)

This may open doors to more possible B3D users.


eizdealer(Posted 2004) [#37]
It's interesting to see how fast this idea developed. It seems to work ok on my ATI card as well (with Peter Scheutz' 'fix').
But the question is: Is it fast enough for complex dynamic shadows (assuming you know the vertices' coordinates)? I get about 500 FPS with the scene, which sounds a lot, but you have to recall that it's just a simple sphere shadow volume casting the shadow, rendered with other basic objects.
What if I take some dynamic 1000-polies-meshes? After the normal render you would have to build shadow volumes, render them, and finally render the shadow itself. Maybe my thoughts are wrong but I doubt you'll get acceptable frame rates this way in Blitz. But feel free to cinvince me that it's fast enough :)
Anyway it IS fast enough for simple static objects, as the example shows.


BODYPRINT(Posted 2004) [#38]
Tom:Can you explain please what the new DeviceClear2 should be used for.

It seems to act the same as the first version, but needs the BBrect types. I assume it is some culling options?

I'm trying like mad to get animated meshes to work.


BODYPRINT(Posted 2004) [#39]
OK I got animated meshes working. Was easier than I thought :-)

I have modified the layout of the Demo a fair bit, so it may be easier just to link to my version.

http://members.iinet.net.au/~pmerwarth/Stencil_SHadows.zip


Beaker(Posted 2004) [#40]
I think you might be missing the point a little. The idea is to get animated objects with correctly projected shadows, not an animated shadow on its own!

Nice try tho.


BODYPRINT(Posted 2004) [#41]
Yeah, I realised that after !!

I'm working on that side of it now...don't hold your breath but :-)


Tom(Posted 2004) [#42]
Phil: DeviceClear2() takes a BBRect type which just tells what part of the screen to clear.

Stuff to think about:

Making volumes 'on the fly' is what's needed next, but also consider that you could precalc volumes for each light for your levels, useful for static lights & geometry.

There's the problem that if your camera goes into a shadow volume the shadows won't get rendered correctly, the solution is the so called 'carmacks reverse' stencil method which I haven't tried.


Braincell(Posted 2004) [#43]
I'll also be trying to figure out some solutions for building shadow volumes, if not for animated .B3Ds then at least for static objects whoose vertices we can access. It's on my list is what i can tell you for sure. Cos this is what we need, and i have a feeling it will be satisfactory speed even at higher details.


Tom(Posted 2004) [#44]
Stenciling is quite fast, I don't think shadow volume polycount affects the speed as much as the screen resolution does (bigger the resolution, the more stencil checking to be done)


This is a cool demo done with Delphi & GL, there's some 42 shadow volumes, I think they're all created on the fly. 2 of the items casting shadows are of reasonable poly detail (the hour glass shaped mesh, and the boolean cut cube), so that's a fair amount of on the fly math.

http://www.delphi3d.net/download/stencilshadows.zip


eizdealer(Posted 2004) [#45]
Tom: Is 'carmacks reverse' flipping the mesh (or rendering the tris both CCW and CW) and rendering for the stencil buffer again? If not, what's the purpose of this in your example? Because it seems to work OK without that second render.


Paolo(Posted 2004) [#46]
@ Tom,
It does not work properly when the shadow volume is made by more than one entity (or one entity with more than one surface) that are overlapping on the screen.
If you can fix this I may have an idea to dynamically build shadow volumes.

Paolo.


sswift(Posted 2004) [#47]
Carmack's Reverse...

I believe the normal way to render stencil shadows is to increment the stencil buffer once for each front face, and decrement it once for each backface. If pixel ends up with a value greater than or equal to 0, then that pixel is in shadow.

Carmack's reverse is basically the opposite of this. You decrement the stencil buffer once for each front face. And increement it for each backface.

I think. You should probably look it up on Google to be sure.

Anyway I'm not sure why this solves the camera inside the shadow volume problem, as I've never really thought about it before, but I do recall that while it solves that, it also creates a new problem whereby all shadow volumes must be capped... Or extend to infinity. And they can't be clipped by the far clipping plane, I think.

Correct me if I'm worng, but these demos don't show the ability to increment the stencil for front faces and decremenet it for backfaces. If that is not possible then generating the shadow volumes themselves is the least of your worries.


Tom(Posted 2004) [#48]
The demo I posted doesn't use those particular Stencil OP modes, but they are available for use.

You have full access to stencils since v1.88 (GFX card permitting!).

;D3DSTENCILOP
Const D3DSTENCILOP_KEEP = 1
Const D3DSTENCILOP_ZERO = 2
Const D3DSTENCILOP_REPLACE = 3
Const D3DSTENCILOP_INCRSAT = 4
Const D3DSTENCILOP_DECRSAT = 5
Const D3DSTENCILOP_INVERT = 6
Const D3DSTENCILOP_INCR = 7
Const D3DSTENCILOP_DECR = 8


sswift(Posted 2004) [#49]
"The demo I posted doesn't use those particular Stencil OP modes, but they are available for use."


Yeah but those ops don't appear to say that they do something different depending on whether or not a face is a front face or a back face.


ckob(Posted 2004) [#50]
I get an error "function Set render state not found" i copied the userlib and dll over to the userlib folder what elsecould it be?


Tom(Posted 2004) [#51]
sswift, ...example of use

SetRenderState(Direct3DDevice7, D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP)
SetRenderState(Direct3DDevice7, D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP)
SetRenderState(Direct3DDevice7, D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE)


ckob: You using v1.88?


Perturbatio(Posted 2004) [#52]
.


ckob(Posted 2004) [#53]
yeah I am


Dock(Posted 2004) [#54]
Has anyone tried projecting stencil shadows onto boned animated object yet? The ability to project shadows on to a character (even if you have to turn it off on low-end hardware) is something we haven't really had in Blitz before, and would be a fantastic benefit.

I agree that generating efficient shadow volume geometry will be tricky - it seems like something which ought to be done in a 3D modelling package if it's going to be as optimal as possible.


Dreamora(Posted 2004) [#55]
the source online is totally bugged, forget it.

there is a place where you will find

renderstate( ... )

and at another there seem to have been 2 lines deleted ( text outputs ... ) which ends with a string in a setrenderstate command


Tom(Posted 2004) [#56]
There is no projecting as such, shadow volumes will encompass ANY geometry in a scene that's been rendered with the Zbuffer on.

Dreamorama: ? :)


Dreamora(Posted 2004) [#57]
The link you put in further up with the bb source is totally useless. no mather if you ever checked what you actually put there, but I would bet: no


MSW(Posted 2004) [#58]
Very cool :)

There is a way to do this in DX7 with multitextureing on a quad in front of the camera.


Tom(Posted 2004) [#59]
Dreamorama: Code 'snippets' I've posted here in this thread are not full demos, they're a reply to sswift on how renderstates are used.

Source for demo is here:
http://www.tomspeed.com/shadowvolume


Dreamora(Posted 2004) [#60]
seem like you replaced the bugged one that was online there before ( and which I used to try to get my ATI running ;) )

take out the

"Or D3DCLEAR_STENCIL" from deviceclear2 command and it even works on ATI :) ( mobility radeon 9700 )


Tom(Posted 2004) [#61]
I'm still learning about stencils, pixelformats, buffers, blah blah, slowly but surely things are beginning to 'click' in my head with regards to the DX7 SDK (only been at it for 3 evenings or so!)

Dock: Here's an example of what I think you meant, I've encoded it to the old divx (seems to be the only format I could screencap to without stopping), 750k, Divx 5.x should play it

http://www.tomspeed.com/sv.avi

There's 3 'pre made' shadow volumes, each one in turn is shown by itself and a renderworld called to update the stencil buffer. This is neccessary for overlapping shadow volumes, and not possible to do on (older cards) with a 1bit stencil buffer AFAIK.

Loop time on my PC was 1-2ms @ 800,600 with debug on, which aint bad for (I think 6 or 7 renderworlds!)


Cya
Tom


mongia2(Posted 2004) [#62]
very good work...

Mongia


Hujiklo(Posted 2004) [#63]
Could this technique realistically be used to shadow a level in a game?...Does it use light sources that can be placed in Blitz?


Rogue Vector(Posted 2004) [#64]
This stuff should be a standard feature in Blitz 3D - i.e. a future update.

Regards,

Rogue Vector


Bouncer(Posted 2004) [#65]
Looking great tom... now just figure a quick way to build the volumes realtime and roll us a little library :)

Great work!


Mustang(Posted 2004) [#66]

Could this technique realistically be used to shadow a level in a game?



Yes, but IMO it's not very likely that anyone here can use it. And it's not somekind of "magical" way to make everything nicely (& fast) shadowed... even if you card supports it, you still must calc shadowvolumes and this will kill 95% of Blitz3D projects trying to use stencils... unless someone makes a universal code module that calcs those volumes, but it will slow to calc them still.

More about the subject:

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

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


JoshK(Posted 2004) [#67]
Write a good command set and let people calc their own vols.


BODYPRINT(Posted 2004) [#68]
Well thats what I have been doing for myself.

If you download my file from my post above you can see an extremely basic version of what I started.

Now my volume models stretch and rotate around lights.

Trouble is my game has nearly 200 objects on screen.
Major slowdown.
I ended up going back to sswifts system and fake shadows because at least I can select which objects are in the shadow routines.


Hujiklo(Posted 2004) [#69]
Phil74 - How about simply precalculating these shadows and not rotating them realtime simply in order to shadow a level, and have them react correctly to realtime lighting as opposed to shadow maps?
For me and probably a lot of other people around here, that would be better than no shadows at all!


Mustang(Posted 2004) [#70]
not rotating them realtime simply in order to shadow a level, and have them react correctly


Ummm... that's impossible... you want static but moving shadows? :)


sswift(Posted 2004) [#71]
I think he wants to light his level without using lightmaps. The shadows would be static but they'd be sharp, and they would affect characters who walk through them.

They'd greatly limit how high poly your levels can be though... You can't have every pipe and railing and such casting stencil shadows, unless you limit yourself to very few pipes and railings. The shadow volumes increase the polygon count a lot, and the overdraw also would hurt the framerate.

Also I wonder how one would handle multiple lights? With one light you can generate a shadow volume for each object it casts a shadow from. But what if an object is in shadow from one light, but lit by another? How do stencils handle that? You must have to render the scene once for each light? That'd be pretty expensive.


Hujiklo(Posted 2004) [#72]
Yes thanks SSwift I did mean only have the shadows react to lighting in their contrasts not change their orientation in any way.
Now that you mentioned limiting geometry for a level I don't think it would be a problem - just use a seperate mesh of basic blocks to caste the shadows for an outside city level for instance..i think nobody would really notice that shadows are not 100 percent accurate. The volume effect itself would more than compensate in my opinion.


BODYPRINT(Posted 2004) [#73]
@Hujiklo : If I knew how to precalculate real time shadows I would. Working out the angle from the light to the model was easy and then I simply stretch and rotate the volume model around my characters.

I had the system working perfectly in game, but like I said, with 200ish models getting rendered 4 times each update was a major slowdown. I cut out any renderworlds I could from the shadow routines because I didn't need the backface part. But it was still slow as hell.

At least with sswifts system I can say, OK this object is within shadow distance of my players, so they will receive shadows this update. So I may have 8 models in the shadow system as apposed to all 200.

Does this make sense or am I dribbling?

Me and 3D maths don't get along too well but!! :-)

I still can't get my head around realtime texture shadows, hence why I paid sswift to do it for me :-)

@sswift:You pretty much got it except the shadows are from my players onto the world. They are not static as such as they do follow the player around and the angle does change to the lighting angle.
It's no high class FPS I'm writing here by the way (It's a Bomberman clone in 3D topdown view), but I still want my shadows to look nice.

Also, when I use blur on your shadow system my shadows disappear?? Any ideas why this is?


sswift(Posted 2004) [#74]
"Also, when I use blur on your shadow system my shadows disappear?? Any ideas why this is?"

Yes, because the blur function is broken. Click my name and look back through my posts a week or so and there's a thread with a new blur function and another fix.


BODYPRINT(Posted 2004) [#75]
Cheers :-)


eizdealer(Posted 2004) [#76]
It would be great if someone posted an algorigthm to create a shadow volume, or maybe give a link where it's demonstrated. No matter, how fast it is.
Imagine you take simplified meshes to create the volumes on load and hide the ones that are not visible when rendering. Wouldn't this be fast enough for static objects?


Paolo(Posted 2004) [#77]
Once, I read something about shadow volumes, and it said
that sometimes it could be better to cast each polygon
independentely instead of doing the shadow volume
calculations.

I ended up doing this:

http://tecno-itb.coloniesonline.co.uk/imgs/Volumes.zip

you can use the CreateShadowVolume() function
with any model, the only thing needed is that
the light object must have a child at the
position 0,0,1 (this is only to retrieve a vector).
Then, the function will create a shadow volume for
each polygon of each surface.

I tried to implement this in the DX7 code from Tom,
but I found that when there are more than one volume
in the screen the shadow is not correct
at all ... may be someone can fix it ..

later!
Paolo.


Mustang(Posted 2004) [#78]
It would be great if someone posted an algorigthm to create a shadow volume, or maybe give a link where it's demonstrated.


Already did, few posts up:

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


eizdealer(Posted 2004) [#79]
Is it possible to create triangles with c++ dlls in Blitz? If so then it would be best to write a c++ dll that creates the volumes themselves, if it is not possible maybe it could return the positions of all the volume's triangles. This way it should be a lot faster.

EDIT2 - correction:
What would have to be done (correct me if I'm wrong):
- go through all of the occluder's triangles and drop the ones not facing the light
- go through all these triangles and save the edges that are not in common with one other triangle's edge
- now extrude every edge as far away as possible
- done

I wrote the dll right now if I had ever coded in c++ but I haven't. If someone would like to write it, contact me whenever you have a question. I could also write it as a Function in Blitz but that would be very slow.


Braincell(Posted 2004) [#80]
Eurythmia how about a demo of how this works with boned b3d meshes?? ;)

You know that IS the issue now.


Doiron(Posted 2004) [#81]
After looking a while at the code, I must say that this technique could be a lot more flexible for *lights* than shadows.

Just change the "EntityColor shadowplane" to 255,255,255 to see what I mean: using a torchlight as an example, it just needs a cone which has it's base which is projected where the torch points to. Even using a small vertex deformed grid for scenery/character collision with the projected cone, you would obtain a very convincing effect. Though such a concept could be easily used for diffuse light effects as well, as a ceiling mounted neon which tilts slightly.


ozzi789(Posted 2012) [#82]
please dont lynch me for reviving this thread.
is there anybody that still owns the dll?

thank you so much,
ozzi


Yasha(Posted 2012) [#83]
is there anybody that still owns the dll?


Yes: http://dl.dropbox.com/u/46635275/DX7libs.rar (hopefully this works)

That there is a mess of several very similar things, including the demo for this (I think).


Kryzon(Posted 2012) [#84]
http://devil-engines.dev-ch.de/devil-shadow-system

EDIT: But stencil shadows are a no-go nowadays. Part of the method if patented by Creative Labs.
And modern meshes are so dense that making the shadow volume for them would be very slow - much faster to render them with shadowmaps, which FastEXT supports and in a very efficient way I might add.

Last edited 2012


ozzi789(Posted 2012) [#85]
Wow thank you so much Yasha :)
Also to you Kryzon, this is a interesting link & tipp!


Rroff(Posted 2012) [#86]
"EDIT: But stencil shadows are a no-go nowadays. Part of the method if patented by Creative Labs."

^^ This unfortunatly - although you can change the method slightly (if you have the DLL source) as Carmack did with the GPL release of the Doom 3 source and it doesn't conflict with the patent.

If your producing a free/shareware app with a limited audience you could chance it but if you put a lot of effort into building a product around stencil shadows using a system similiar to "carmack's reverse" there is a chance you'll fall foul of creative's lawyers.


I'm still playing around with ICU based dynamic lightmapping - its no alternative for stencil shadows but I think with a bit more playing it has potential for some useage - mostly a case of finding all the limitations to stop artifacting happening and working out some kinda work around (probably something of the style of PSSM) to handle surfaces which are axial or close to axial to the angle of the light.

Last edited 2012