My Fake Stencil Shadow System

Community Forums/Showcase/My Fake Stencil Shadow System

seyhajin(Posted 2005) [#1]
Yop,
its a simple test of Stencil Shadow on big Terrain Mesh.
Please test and report your impressions.

Screen :


DEMO : http://bond357.free.fr/down/Seyhajin_ShadowSystem.zip

Thnaks a lot :)


mongia2(Posted 2005) [#2]
link not work


seyhajin(Posted 2005) [#3]
oups sorry, it's work fine now :)


L_Draven(Posted 2005) [#4]
Hi, It looks nice, but its possible move the light to move the shadows??

Great job Seyhajin.


seyhajin(Posted 2005) [#5]
i'm work it, for try realtime shadow ;) (move light, move entity)

thanks to try it


BlackD(Posted 2005) [#6]
Nice.. ~435 fps. I have no idea how this works.. stencil on terrain? But terrain doesn't have vert data.. :o


puki(Posted 2005) [#7]
This looks interesting. The output seems to suggest that it is a faked effect (ie not affected by light - purely because of how the shadows point - seems like the light source is very much closer than it is) but I like it. Wouldn't bother me if it didn't work with realtime lighting.


Braincell(Posted 2005) [#8]
These shadows look textured to me. Stencil shadows usually have nothing to do with textures, you could only use a similar method to create them (overlapping objects) but i wouldnt call it "stencil".

They look cool, but i doubt they can be updated real time? Might be useful for level creation etc, unless such textures take up too much memory.

In some games (Battlefield 2) i think they use the same thing only that they calculate how far the shadow is and the further it is the less quality it has and thus uses less memory. That system is nice but only works on newer gfx cards. Real stencil shadows work on older ones also.... anyway.... nice


Matty(Posted 2005) [#9]
I am guessing it is a similar method to what I use for my gauntlet remake - make terrain as normal with ground texture, create another texture and apply it on top using multiply blending and simply place the camera where the light source is, render to a smaller viewport the same size as the texture the scene with all shadow casting objects painted black while hiding the terrain and having the cameraclscolor set to 255,255,255 then copyrecting from the backbuffer to the texture buffer of the 'shadow texture' which is multiply blended with the terrain.


Damien Sturdy(Posted 2005) [#10]
@Matty

what as what with what, create another what and apply it on top using what and simply place the camera where the light source is, what the what with what painted black while Whatting the what and whating the what set to 255,255,255 then Whating from the whatbuffer to the texture buffer of the eh? which is multiply blended with the terrain????!!!!


Im going to have to try that!


Sledge(Posted 2005) [#11]

I am guessing it is a similar method to what I use for my gauntlet remake -



I'd guess that too, only there's some odd glitching if you move the camera away from the terrain, with shadows on the wrong side of the trees fading in. I wouldn't expect that with the described method.

Speaking of the trees - is that palm model available for nabbing? It's quite nice.


Zmatrix(Posted 2005) [#12]
@Matty
I would think thats the way its being done here,
Same thing I Did for a project, except I moved the uv of the shadow texture with the players view. this works(lets you use a smaller texture ,but keep a decent res)...but theres major wobble of the shadows if you use any perspective at all.

course this apears to map correctly with point light angles, I never got that far , I only got it to work directionaly and even then a few degrees from -90 only.

Zmatrix


Sweenie(Posted 2005) [#13]
But the shadows look very detailed.
Shadowmapping usually produces very blocky edges when used on a large area such as a terrain.


Zmatrix(Posted 2005) [#14]
good point Sweenie,

even at 1024 , it would look far blockier than that when scaled to fit the terrain.

I noticed the glitching also at far distance.

maybe Seyhajin will let us know.


Zmatrix


Wayne(Posted 2005) [#15]
Do you want to share the method your using ?

Looks like a seperate mesh towel to me.

8)


D4NM4N(Posted 2005) [#16]
stencil on terrain? But terrain doesn't have vert data.. :o


Does if its a mesh terrain

Please Seyhajin, can you give us an insight?


Hujiklo(Posted 2005) [#17]
How about a flattened mesh with alpha maps?


Wayne(Posted 2005) [#18]
Maybe a cube shadow map?


Zmatrix(Posted 2005) [#19]
Maybe(the res seesm very high for a cube map).
Aso I doubt its a flattend mesh as it conforms to the terrain.
Towel mesh is possible , since all the tree's are the same...you would only have to render one shadow, apply it to the meshes and position it according to the light.
I tried to see if there was a gap..not that i can tell.


Zmatrix


Paolo(Posted 2005) [#20]
First, hold down "space" for a wireframe view,

the shadows "seems" to be textures, I would say
he is using one high-res texture for each quad in the scene I mean
one texture for every two polys ... don't know for sure,

Seyhajin, bring us some light about this :)
great work so far although looking at the shadow-precal time,
I don't think it could work realtime but seems excellent for static shadows ....

by the way, if you go far away you start seeing some
"lines" over the terrain, don't know what it could be (?).

Paolo.


Zmatrix(Posted 2005) [#21]
That time when I ran it , it was all messed up..lol
the shadows were not aligned with the tree's
and you can see the edge of the quad.

Still not sure how its done.

Zmatrix


Dock(Posted 2005) [#22]
I ran this on my laptop, and the terrain was almost entirely black, with only a few edges at the corners which were still green. I think this is using a lot of video memory and it breaks on my laptop.


seyhajin(Posted 2005) [#23]
Hi,

i used a textures of size 256*256 :), for the demo.
clear, it's not a real stencil method, but it's a same effect (without a shadow volume, i'm work for it).

a simple method :

- Set Caster, Receiver, Light (in to type)
- Capture silouhette to texture (called 'shadow z-buffer' method) with auto zoom object
- Apply texture to mesh with recalculate UV to receiver mesh.

It's simple not ? :)

Sorry for my poor english.


seyhajin(Posted 2005) [#24]
i worked on real time shadow,
i have a poor performance for many objects ( >10 objects ) :o( but it's very good for real time shadow 3nd person player. for try new demo, download to same link http://bond357.free.fr/down/Seyhajin_ShadowSystem.zip

@+


BlackD(Posted 2005) [#25]
Wow. :) Not quite as good as sswift's, but certainly getting there! I had a problem in some places, with the textures not being captured correctly and stretching to infinity:



Other than that, great - and fast! :)

+BlackD


seyhajin(Posted 2005) [#26]
the flags texture used ClampUV, or an error of calculate UV


seyhajin(Posted 2005) [#27]
BlackD, the error is fixed now :), you can redownload archive


Wayne(Posted 2005) [#28]
The shadows on the first version looked better, except for the radial lines.

The new version doesn't have the radial lines, but this new version creates a morier pattern at some angles and distances.

Will you post the source so we can play with it some ?


Svenart(Posted 2005) [#29]
the first version was running very good and fast, but the second was not running on my computer (geforce 6600). However, really interesting work, I would (of course) be interested in the source, too.


Zmatrix(Posted 2005) [#30]
15 objects Run about 65-85 fps here.
adding 3 more 18 object plummets framerate into the single digits.
looks nice , Nice work Seyhajin :)

Zmatrix


KimoTech(Posted 2005) [#31]
Nice Work there! And very fast too! :)


Paul "Taiphoz"(Posted 2005) [#32]
just had a go with it... what exactly is fake about it ?

Seems to do what it's meant to and at a nice pace.

Could you add some code to add random tree's and shadows id like to push the system a bit and see what the fps drops to.


Regular K(Posted 2005) [#33]
Static - Started to feel sluggish around 1,000
Dynamic - Started around 25, but I probably couldve had about 50.

Specs belows

Very nice !


seyhajin(Posted 2005) [#34]
@ Yavin : "what exactly is fake about it ?", i don't use stencil buffer, and the shadow have a great precision :)

I go soon poster the code, but it is not to optimize, I espere that you could optimize it :)

sorry for my poor english, I must speak like a nut :)


seyhajin(Posted 2005) [#35]
Code source available on my website :)


Red Ocktober(Posted 2005) [#36]
really nice work Seyhajin...

--Mike


OJay(Posted 2005) [#37]
what the?!? we have to call a phonenumber (2euros/min) to get the source? you're kidding right?


LineOf7s(Posted 2005) [#38]
Um... this whole phone thing is on the bizarre side.

Australia isn't even listed. New Zealand is. Nothing against NZ, but WTF?

WTF in so many different ways.

Shame - nice shadows to look at. :o)


seyhajin(Posted 2005) [#39]
2€ isn't so expensive if you look at the swift shadow system or another shadow system :o). It's only a phone call to get the acces code.

@LineOf7s : sorry, i will try with paypal system if you want.


OJay(Posted 2005) [#40]
if its worth it, you will get your money. but not by phone...thats nonsense.


seyhajin(Posted 2005) [#41]
ok i look a paypal system.

@ OJay : i've you try a demo first ?


Stevie G(Posted 2005) [#42]
I know it's cheap and looks good but your demo doesn't really tell me much about what features the system has?

From the example it seems that you can only set a terrain or terrain style mesh as the receiver which makes the system fairly limited.

Can you render the shadows onto other reciever objects ... for example ... the shadow of a tree correctly projected onto a wall? .


Filax(Posted 2005) [#43]
I think that Seyhajin have made a good system for terrain
shadow ! i think buy it to integrate this stuff under
terraed.

Good job seyhajin

PS : But i agree with payement system, it's a little bit
heavy. Think share-it or paypal :)


OJay(Posted 2005) [#44]
yes i've tried the demos, pretty impressive speed, although there's a large frame drop with more than 25 dynamic shadows...looks like a memory problem.

could you advance the demos to show the available memory? 'cause if your shadow-system eats up all my memory, there wouldn't be so much left for the rest of the game, right? ;)

also, a brief description of how the system works and what it can and what it can't would be nice!


seyhajin(Posted 2005) [#45]
Hi,

it's not a generic shadow system for mesh.It's only for Terrain and it's preferable to use it for static shadow on terrain.
I think, you don't understand it's not a shareware program but it's a shareware source code.

@ OJay :

i will to try make un new Demo with some features of my system :)
but if you want more functionnality, i fixed new price to :), but his price stayed small, it's my philosophy :).

Actual Features :
Casters : All meshes
Receivers : for the moment, i tested only on terrain mesh

Futures Features :
Casters : All meshes type (tree, primitive, player,...)
Receivers : Works with all meshs (terrain, wall, ...)
Shadow Volume Static and Dynamic
and your features like :)


Barton(Posted 2005) [#46]
your shareware system do'not work. please check your email inbox.


seyhajin(Posted 2005) [#47]
i tested, he work fine Barton,
your web explorer must accept cookies, and your codes don't have space.


Barton(Posted 2005) [#48]
cookies are enabled and Firewall disabled. I have soon called 2x and Buy money. Check my Codes in Email.


seyhajin(Posted 2005) [#49]
sorry, your codes work fine :o), if you have another problem, i will send the archive from your mailbox ?


Barton(Posted 2005) [#50]
please send my from Mailbox. Thanks. :)
1x for texture splatting and 1x shadow system. :)

I have tested the codes on 2 computers. cookies always enabled, no firewall...but it does not work.

Allways the Message: Code non aviable


seyhajin(Posted 2005) [#51]
you have just call for Texture Splatting, if you have code for Shadow system, then send me your codes for Shadow System :)

I just send "Texture splatting", check your mailbox


Barton(Posted 2005) [#52]
but i have Buy 2x the Texture Splatting ? because it did not work. 2 products are payed.


seyhajin(Posted 2005) [#53]
check your mailbox for "Texture Splatting" source :o)

thanks to buy it :)

PS : Yes 2x codes per source.


Barton(Posted 2005) [#54]
no mails still :)

PS: aahhhh 2x calling per Source and type in format xxxxxxxx xxxxxxxx ??

Edit: have tested now. it works now !! :)