Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (OptimusPrime, AndrewAMD), 14,580 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 6 1 2 3 4 5 6
Re: How do you display shadows on invisible surfac [Re: frazzle] #135989
07/18/07 01:32
07/18/07 01:32
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
@Heelx: That looks like the right track, although shouldn't the non-clipping be taken care of if you place the 2D sprite that represents the block at the correct point in the level to match up with the invisible hull? The wall and floor would be the background layer and the small block a sprite that is in front of it.

I'll play around with this code this week when I have time and am not so tired. I'm too exhausted right now and am going to sleep at a normal hour for once. Thanks to you and everyone else (XxX snapshot method sounds intriguing but would eliminate a huge chunk of the target market for the genre given the advanced shaders).


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] #135990
07/18/07 04:54
07/18/07 04:54
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
There should be no reason you can't simply solve this problem. Make sure sure the model or geometry has NO alpha channel in its texture. Turn on zwriteenable and zenable. Turn off alphablend and alphatest. Then turn off color writes like this colorwriteenable=alpha

This ought to achieve what you want. Let me know if you try it and it works.


Sphere Engine--the premier A6 graphics plugin.
Re: How do you display shadows on invisible surfac [Re: Matt_Aufderheide] #135991
07/18/07 09:37
07/18/07 09:37
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
This works on the geometry, right. But the problem is, that the the lower part of the warlock in my testcase (see images above) are NOT clipped. I don't get the reason why it is'nt clipped, although the geometry writes into the zBuffer. I also tried to fiddle with zFunc and so on, but it doesn't help.

Misteriously, the self shadowing parts of the warlock behind the box aren't rendered..

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 Offline
Expert
frazzle  Offline
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
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

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 Offline
Expert
frazzle  Offline
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
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

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 Offline
Expert
frazzle  Offline
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
Re: How do you display shadows on invisible surfac [Re: frazzle] #135997
07/18/07 19:04
07/18/07 19:04
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Quote:

The realtime model, which isn't actually rendered because it's invisible plus additionally non-transparent should cast out a stencil shadow right ??




Yep, but if it can be set so that the engine reads it as visible but can be made to not render to the screen that would be ideal. This way it should, in theory, still be able to display the stencil shadow since it isn't technically in any state of transparency (with invisible being totally transparent). I wonder if using the new z-fail method would eliminate artifacting if there is any?


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] #135998
07/18/07 19:34
07/18/07 19:34
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I suppose since the 2D animated sprite should always be in front of the 3D model and match its movement that it I could put a single colored texture on it (dark for dark scenes and light for light scenes) and keep the model visible. Unless, there's some clipping issues, you shouldn't ever see the model; thus this could work.

Quote:

Btw, you really are unorthadox plus contradictorical




Yes and no. I'm simply trying to come up with methods that aren't readily apparent or native to the engine. Wintermute can do all of this out of the box, but it's made esp. for this style of gameplay.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Page 4 of 6 1 2 3 4 5 6

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1