1 registered members (TipmyPip),
18,574
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How do you display shadows on invisible surfac
[Re: HeelX]
#135992
07/18/07 12:13
07/18/07 12:13
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
@ Matt: Your code snippet would work on level geometry like HeelX mentioned but that doesn't solve the clipping issue. @ HeelX: I think I know a way to solve the clipping issue. Matt his code snippet doens't work on stencil shadows combined with alphablending on models so it's just a matter of finding the right balance and mix between zbuffer and stencil buffer shadows  I did some tests and it seems that when using stencil shadows, the model with alpha blending doens't clip the model's mesh behind it's own. There for, you need to set the stencil shadow variable at a global scope in your script and only enable the cast flag for your warlock itself and not for the box. The warlock has got stencil shadows so they will still contour with the level geometry but the box had got z buffer shadows because the cast flag isn't set so there will be a depth test and the result is writin to the z buffer via z write. Now combining the z buffer with alpha blending, it makes sure that the model will not be visible behind the box's mesh, voila the sorting issue is solved. I'll show it in the practical way: Code:
var shadow_stencil = on; var shadow_lod = 3; // increasing the shadows quality
material box // apply this to your box which you knew already, set the shadow flag but don't set the cast flag to avoid stencil shadows. { effect = "technique test { pass p0 { AlphaBlendEnable = True; SrcBlend = Zero; DestBlend = One; } };"; }
material geometry // Matt his code snippet { effect = "technique test { pass p0 { AlphaBlendEnable = True; SrcBlend = Zero; DestBlend = One; zwriteenable = true; zenable = true; colorwriteenable=alpha; colorwriteenable1=alpha; colorwriteenable2=alpha; colorwriteenable3=alpha; } };"; }
// Set the cast flag and the shadow flag for the warlock to enable stencil shadow which allows the shadow to contour with the level geometry.
This is the result but mind that I didn't applied any material towards the level geometry which wasn't neccesairy in these images: Btw, the problem HeelX had, could also be solved via a sprite which should match the geomety of the scene. This is the methode OB original wanted ^^ Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: How do you display shadows on invisible surfac
[Re: frazzle]
#135993
07/18/07 16:36
07/18/07 16:36
|
Joined: Aug 2000
Posts: 7,490
Orange Brat
OP

Senior Expert
|
OP

Senior Expert
Joined: Aug 2000
Posts: 7,490
|
Given my semi-technical mind (from a programmer's POV), this is all a bit overwhelming, but I get the gist of it. The entities that should be casting stencil shadows are the player or any other NPC. Any hidden geometry for the Background/foreground scenery (the level) shouldn't be casting anything in a pre-rendered/hand drawn background. I noticed in Heelx's screens that the cube seems to be casting what appears to be a stencil shadow when only Mr. Warlock should. Anyway, I think the issue is slowly or has already been resolved (not sure yet  ). It's kind of nice to see some of the greater 3DGS programming minds working on this if for nothing more than to tackle the challenge of it. I'm not sure how many of you would actually use it, but I guess I sparked some inspiration.  Quote:
Btw, the problem HeelX had, could also be solved via a sprite which should match the geomety of the scene. This is the methode OB original wanted ^^
Yeah, I think I mentioned this in my last post. Placing the 2D element at the point of that cube should cover up areas we wouldn't see anyway (because they are covered up; thus that warlock can clip all it wants).
Now, it's just a matter of applying all this to a real level.
My User Contributions master list - my initial post links are down but scroll down page to find list to active links
|
|
|
Re: How do you display shadows on invisible surfac
[Re: Orange Brat]
#135994
07/18/07 17:03
07/18/07 17:03
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Amen  Good luck applying it into your level OB !! Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: How do you display shadows on invisible surfac
[Re: Orange Brat]
#135995
07/18/07 17:10
07/18/07 17:10
|
Joined: Aug 2000
Posts: 7,490
Orange Brat
OP

Senior Expert
|
OP

Senior Expert
Joined: Aug 2000
Posts: 7,490
|
Fron another thread: Quote:
Quote:
Finally, is it possible in DirectX to make an invisible model cast a stencil shadow and if so could you add this to the todo list, too (assuming it isn't already possible...I'm away from my regular PC, so I can't check).
You already can use, or even already use normally, the LOD of your charcter for the shadow in A6. Just picked up this sentence, so it can be that this already had been mentioned.
Yep, I'm aware that we can use LOD for stencil shadows (Wintermute has this feature too); however I know that SS don't work when a model is transparent, so I was wondering if they worked if they were completely invisible (my.invisible = on;)? The manual states:
Quote:
Stencil shadows are only cast by completely non-transparent models. The model skin must not contain an alpha channel.
I wonder if there's a way to make a model cast the SS and still be completely 100% visible but not render. It sounds much like the hidden geometry issue doesn't it? If his would work, I'd use a lower poly model for the realtime model that projected shadows and attach a 2D animated character with a lot of frames (so it's smooth and looks like a highly detailed model without having to use a normalshader). I would get the visual results I'm after plus a working stencil shadow all within a 2.5ish world.
------------------------------------------------
New stuff related to the above post:
Is it possible to do something like this? I know that sounds contradictory, but the engine would think the model is visible and non-transparent, but we wouldn't be able to see it because of some flags settings.
I have reasons for wanting to combine a 2D animated character (constructed from a higher poly model or hand drawn) with a lower poly, non-rendered, realtime model. The sprite would appear at the location of the non-rendering model and all animation frames of both versions would match depending on user input. It would be easier to maintain with point and click input, but Intense Pathfinding will need some tweaking to use it (Larry is aware and one day he might resolve the issues according to a past post of his...he has bigger fish to fry right now).
1. One reason is speed and savings on poly count and lack of having to have to use a normalmapping shader. This will allow lower end systems to be able to run the game efficiently since they won't need the shaders technology plus there will be less 3D crap to render out.
2. I believe I've lost my animator. My modeler (Dan) is still onboard but having a run of bad luck, so his turnaround has been off. I'd still use his models for shadows. I have acquired a copy of Poser 7 and what I would do is create a unique character via morphing their base characters (or buying one that I like and doing it) that closely matches the characters that Dan is making for me. I'd use unique textures, of course. The program has animation features including a fantastic walk/run/talk generator (it actually works wonders) and you are allowed to use 2D renders or animated sprites for commercial purposes if you use their 3D models as the base of your art.
Anyway, it all sounds crazy, but it should work if I can get all of of these non-rendering things to work out right. The end result is a unique looking game with much less 3D mesh and geometry to render and higher visible detail to the level art but at the same time still have all the benefits and features of a realtime camera and world.
My User Contributions master list - my initial post links are down but scroll down page to find list to active links
|
|
|
Re: How do you display shadows on invisible surfac
[Re: Orange Brat]
#135996
07/18/07 18:15
07/18/07 18:15
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
So in overal, you're trying to achieve the following: The realtime model, which isn't actually rendered because it's invisible plus additionally non-transparent should cast out a stencil shadow right ?? I've did some tests with this already in the past and my results were that the stencil shadow were rendered uncorrectly/unaccurate but I'll run some more tests to give a final view. Btw, you really are unorthadox plus contradictorical  Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
|