Got soft stenciled shadows workin.

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
User avatar
Tabulanis
Posts: 111
Joined: Mon Jan 30, 2006 5:01 pm
Contact:

Got soft stenciled shadows workin.

Post by Tabulanis »

Image

I know this may seen simple but I got soft shadows to work after I put 3 lights up withing close proximity. Turn shadows alpha down to 25 and they look really good. I mean really good. Big problem with the player though. Pawns and player avitar have nasty artifacts all over them.

I thought of a possible fix for that though and a way to make things like this a little more usable without killing the frame rate. (The soft shadow s I am using are on Virgil and I cant use them on a pawn with a decent polycount or it kills the FPS) The artifacts can be taken away just with offsetting the shadow origin by eve a tiny bit I think.

What if the engine diddn't use the actual player avitar or pawn for the shadows? Then they could be foffset enough to avoide nasty artifacts and you could build a really low poly modlel for the shadow casting, wile keeping your nice high end actor for looks. It could be implemented in the pawn/character.ini file

stencilshadows = true
Shadow actor = lame shadow guy.act

I mean a shadow guy could use 1/4 the polys of even virgil and still work well enough. maybe even less. as long as the animations are the same it should work well shouldn't it?

BTW I finalyy got these shadows working today.

For all you out there new to RF let me save you some real trouble.

to get stencle shadows to work you must...

1. Check the new characterini to make sure your startup character has them set to true. This file overrides what you set in playersetup. If your having trouble and no answer is in site try that.

2. Do the same for all pawns that use them. (pawn.ini)

3. I used dynamic lights but I dont know if the others work or not. YEp they do and much better than the dyn ones so use them.

4. make sure your lights have a long enough radius that you can see the shadow. Kinda dumb to say becuase its so obviouse but I had it right and diddn't know it becuase of that.

5. dont expecct that any one will get that yes in fact you really havn't a clue how to get them going.

follow these steps and you will be fine.

Image

Image
User avatar
Tabulanis
Posts: 111
Joined: Mon Jan 30, 2006 5:01 pm
Contact:

Post by Tabulanis »

ok with normal ights got it to use 8 shadows at once to make nice soft shadows and am at 60 FPS on a terrain the is over 5000 polys. of course the terrain isn't casting just reciving but you get the idea. with all 8 lights casting a shadows and spread wide at a distance you get a nifty side effect it help dramaticly with the artifacts on the player. makes me wish I had a higher max for lights that cast these babies. It could probably handle 14 or so without killing the rate.

Athlon 64 1.5gig ram PCIE radeon.

I havn't treid it in the demo and that might be the kicker the demo has about 10 of these large meshes but I will stay hopefull.
GD1
Posts: 413
Joined: Tue Jul 05, 2005 2:33 pm

Post by GD1 »

that's a nifty little trick!

when we were putting in the stencil shadows, someone brought up the same question about using a different mesh to cast the shadows, but the problem is that because of the difference between the surfaces, some areas on the model would end up in shadow volume when they shouldn't be, and this would make even more self-shadowing artifacts.

If you wanna have some really smooth shadows without so much of a framerate hit, try checking out the shadowmapping/bmp shadows from the Forged in Fire demo. if i remember right though, there is about a 5* offset on the shadows from the actual direction of the light, which makes them look funny if you pay close attention, but you can get some really smooth looking shadows.
Check out my band
Tougher Than Fort Knox
Image
User avatar
Tabulanis
Posts: 111
Joined: Mon Jan 30, 2006 5:01 pm
Contact:

Post by Tabulanis »

I see what you mean but still dont agree.

if you could swithtch the modle used I coiuld make all though artifacs go away. I could make a virgil that is normal scaled 3 or four texels. The artifacts are not from self shadowing, ( Yes I know they ARE from self shadowing) I mean the are not from good self shadowing. They come up when a face MATCHES the actor too closely, not the other way around. You can see it. If you had even a biger model for the shadows it might help in that department. Having some bit s shadow incorrectly and maybe look off is perferable to the obviously uninteanded vibe that you get when you see a few faces on the actor half shadowed and blinking in and out like a DIGI ghost. Plus even with pdd self shadows you used the soft light trick it make a big diff with self shadowing. In at angle that you can actualy see it right ( arm shadows body etc) it makes mics smooth shadows and helps the transition to and angle were its all shadow.

I know I could fix the artifacts on my own if I could replace the mosel and I am almost positive I could safely and nicly cut the poly count for shadows as well. Also there is and odl trick I learned about shadows in china of all places that I think would come in handy.

Image

This guy is virgile and the carboard verson is him choped to crap but the jionts are the same. Now his shadowguy deffinetly uses alot less polys but he fits exatly and only overlaps where the seams are. he folows the animation exectly too same bones. Now this is an example os not fineshed but these shots taken with area shadows ( witch I believe work alot like stencil. ) show that it works fine. Got the idea in china from a a puppet show. now he neds lateral head and body planes for downward casting but if you make this guys edges 1 of 2 texels inside the other virgil then they will never cause artifacts and self shdowing will be perfect.

plus you could increas the actual Virgil madel to 7000 polys for nice detail and not take a hit using the shadows.

Just seems a waste to have obviously flawd shadows when they could be so nice.
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

WOW, great technique, never thought of that!
User avatar
Spyrewolf
Posts: 450
Joined: Tue Jul 05, 2005 4:53 am
Location: Wellington::New Zealand

Post by Spyrewolf »

WOW :o

You are creating some of the best visuals in RF that i have ever seen!!! and i've been here a while!

your stuff is simply breath-taking great use of texture and lighting, also i think that the technique used is great! it seems you have picked up the engine and started running with it good to see keep up the great work,

with the shadow technique you have used (cardboard virgil) is a GREAT idea and should work and yes your quite right it would fix the artifacts as they don't use the players own shadow! you just need to create him as a scripted player and teleport him to the players location, GREAT IDEA!
User avatar
Tabulanis
Posts: 111
Joined: Mon Jan 30, 2006 5:01 pm
Contact:

Post by Tabulanis »

Works awsome but I gotta put all the animation to it and I dont know have to script. It is greek to me. But I built a nice 3700 poly model and it looks good and made a shadow copy guy (530 poly) and you can't tell one shadow from the other. and soft they should work even better. Also though of a way to double up on soft shadow resolution. Two shadow guys offset by a few pixles and you have basic soft shadows however if you do it with the lights instead it makes more realistic soft shadows because the area shadow effect is there.
frather the caster is from the source light the softer the shadow.

You may notice that right next to the ground vrigies feet have a solid shadow but farther out they get softer. Indoor lights look good too but there seems to be some kind of bug in the shadows that makes them show up sometimes and blink off at others. Dont know what that is.
Post Reply