stencil shadow - is it really possible?

Posted By: CodeMaster

stencil shadow - is it really possible? - 12/04/10 23:15

I tried to use Z-pass stencil shadows, but... dam, what happened with my FPS. This i need only for a shadow of a player, not for other entites. I tried to use cast flag to eliminate shadows on the other models, but i not got anything with this. My frame rate is still low. How stencil shadows work? Whether dis the A7 is really so weak engine for this?
If there's a any trick? I repeat, everything what i need is that player shadow falls on the other models.
If this is not possible i do not know why A7, in general has that option if we can not use it in practice. I only know that my PC is not a problem.
Posted By: painkiller

Re: stencil shadow - is it really possible? - 12/05/10 00:10

the player needs to be a closed mesh, otherwise you will have problems like low FPS and shadow errors
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/06/10 20:27

I tried with closed mesh, but the same result.
What i missed?? Does it matter how long the shadow falls?
On what else i need to pay attention?
Posted By: painkiller

Re: stencil shadow - is it really possible? - 12/06/10 20:41

maybe the number of polys of the model
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/06/10 21:02

i think no, player have about 2000 vertices
Posted By: painkiller

Re: stencil shadow - is it really possible? - 12/06/10 21:12

have you tried with another model to see if fps drops?
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/06/10 21:22

yes i try everything... Is there a some demo or video in which we can see how stancil shadow works? Does anyone use stencil shadows, when I search the forum I see that others have the same problem? The only thing that is the point, i need this only for my main player not for whole level.
Posted By: JibbSmart

Re: stencil shadow - is it really possible? - 12/06/10 21:37

What version and edition of A7 do you use?

Jibb
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/06/10 21:48

commercial 7.86 + last patch, why you ask? ... did maybe i need pro to get better result???
my PC is athlon 5200+ 2gb ram, and Nvidia9600
Posted By: JibbSmart

Re: stencil shadow - is it really possible? - 12/06/10 21:59

A7/A8 supports "accelerated" stencil shadows. In A7 you need Pro, or with A8 it appears they'll be accelerated in any edition.

Jibb
Posted By: Slin

Re: stencil shadow - is it really possible? - 12/07/10 21:44

IS your shadow casting model visible? As otherwize the shadows are probably clipped away together with it.
Other than that it basicly just works. At least for me...
Posted By: badapple

Re: stencil shadow - is it really possible? - 12/07/10 23:06

lowering your alpha on the shadow should improve frame rate also
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/08/10 00:17

@Slin
yes all my models is visible and passable. Shadow is well seen on all models, but also shadow passing through my models - i do not know if this is normal and how stop this? For collision i use wed blocks under models with none flag. Perhaps the problem is that?

@Badapple
how to do it?
Posted By: badapple

Re: stencil shadow - is it really possible? - 12/08/10 00:41

i know with lite c its like this , but im not up to date with a8

mat_shadow.alpha =40;//place this line at the begining of function main

replace 40 with any value 0 - 100
Posted By: Nowherebrain

Re: stencil shadow - is it really possible? - 12/08/10 03:20

let me understand, all your models are casting shadows?, if so....that would lower your frame rate, or you are not using stencil shadows at all, but a shadow mapping post proccessing shader....again is slower than just your player having it's shadow on.
Posted By: Slin

Re: stencil shadow - is it really possible? - 12/08/10 09:57

Badapple, that shouldn't have any effect on the speed.

CodeMaster, that is a general problem with the way stencil shadows work and nothing specifically related to gamestudio. The only solution is to have all objects casting shadows, as that will of course hide the "wrong" shadow in the shadow.
Posted By: badapple

Re: stencil shadow - is it really possible? - 12/08/10 23:28

@slin it most certainly does affect your fps , the lower the value the better the boost.
Posted By: darkinferno

Re: stencil shadow - is it really possible? - 12/09/10 03:33

really doubt that laugh
Posted By: Hummel

Re: stencil shadow - is it really possible? - 12/09/10 11:04

me too -.- see no technical reason why it should...
Posted By: Slin

Re: stencil shadow - is it really possible? - 12/09/10 11:24

It is nothing but the alpha value of a black fullscreen quad...
Posted By: bart_the_13th

Re: stencil shadow - is it really possible? - 12/11/10 02:24

Create model LOD so shadow will be cast from that LOD, by default shadow will be casted from the 1st LOD, if you have more than one LOD, you can switch the shadow_lod to higher level of LOD(lower poly). Some artifact will appear if the shape difference is too high though.

If your model doesn't have any LOD, shadow will be cast right from the model, even if it has high poly. And of course it will kill your fps.

And I don't think if shadow's alpha will affect rendering speed grin
Posted By: Spirit

Re: stencil shadow - is it really possible? - 12/12/10 09:23

Yes, LOD helps with stencil shadow speed. The other thing that helps is accelerated shadows, make a test with the A8 free version. I think A8 supports accelerated shadows already in the free version, with A7 it was only in Pro. Accelerated shadows are much faster, the fps is 2 or 3 times higher.
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/12/10 12:37

Thanks for the advices, i will try something with LOD.

Spirit, did accelerated shadows work with c-script and A8?
Posted By: Spirit

Re: stencil shadow - is it really possible? - 12/12/10 12:45

They are always activated in A8, so they work also with C-Script. But the free version does not support C-Script. Only Extra or better.
Posted By: CodeMaster

Re: stencil shadow - is it really possible? - 12/12/10 13:55

Thanks Spirit, first i will try in trial how this work
© 2024 lite-C Forums