Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (kzhao, AndrewAMD, bigsmack, 7th_zorro), 869 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Shadows on none surfaces... [Re: Orange Brat] #120566
07/16/07 21:39
07/16/07 21:39
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Those three flags can already be set through a shader. (I know, you're trying to avoid shaders), but this technically wouldn't be a shader, as it goes into the technique of the shader for compiling. Simly add these thre lines: example

Code:

technique whatever
{
pass p1
{
AlphaBlendEnable = true;
srcBlend = zero;
destBlend = one;
VertexShader = compile 1_1 VS();
PixelShader = compile 2_0 PS();
}
}



As I said before, I'm gone for 2 weeks (back 25th), so I can't test this, but this is exactly what he said to do. However, by looking at it, I don't think it'll work. Wouldn't it also be possible (though slower) to simply use a shader to draw the model with alpha=0;? Would the model not recieve the shadow even though its alpha is 0?


xXxGuitar511
- Programmer
Re: Shadows on none surfaces... [Re: xXxGuitar511] #120567
07/17/07 01:08
07/17/07 01:08
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 don't know if it'll work or not. I'm sure the Wintermute's implementation of stencil shadows is going to vary from 3DGS; however those three lines are the key to getting this feature to work. I know we can add an effect of our own and getting that effect correct is one of two possible answers to this request.

The 2nd answer is having it hardcoded into the engine and available as a flag inside WED. Here's a real world example complete with unattractive behind-the-scenes pictures of a level that needs a lot of work :



Pretend that background is the background of the game level and everywhere you see green there is hidden geometry that closely matches the shape of the visible image. In fact the green is the hidden hull and pretend like there's a textured version that can be seen over this. Also, the green parts on that building are the possible locations for the player's shadow to appear; thus the reason why the hidden geometry has to match. The complexity of the hidden hull above this area doesn't really matter.

In WED, I would like to have a new flag and for every green surface, I'd like to be able to check that flag ON. Those green surfaces will be invisible, will not cast any dynamic shadows (if within the sphere of influence of a dynamic light..remember this is ultimately going to be pre-rendered or hand drawn, so any shadows will already be present); however the stencil shadow of any shadow casting models will render onto those areas if the lighting is setup properly for the shadow to cast in the direction of the green section.

I don't think this requires anything shader related or VS1_1 or PS2_0 type stuff.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Shadows on none surfaces... [Re: Orange Brat] #120568
07/17/07 02:59
07/17/07 02:59
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
The code below does exactly as those other three lines, and WITHOUT a shader. This is simply a material setup, not a shader. I simply added the two shader compiler lines above to show placement.

Code:

material mat_none
{
effect = "
technique whatever
{
pass p1
{
AlphaBlendEnable = true;
srcBlend = zero;
destBlend = one;
}
}
";
}



This is what he sid to do, so try it! If not then.... IDK. Maybe I'm wrong, maybe he didn't give you enough info, maybe 3DGS is just different...


xXxGuitar511
- Programmer
Re: Shadows on none surfaces... [Re: xXxGuitar511] #120569
07/17/07 06:45
07/17/07 06:45
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
@jcl: Could I ask if you are leaning towards a possible implementation of this feature into the engine at some point. I'm not expecting any promises to be made, nor do I even expect a response; however an official maybe/maybe not/hell no would be greatly appreciated by both me and closet adventure game developers and/or lurkers. Also, a time frame is not an issue for me. I'm in absolutely no hurry for this feature, but knowing whether or not it's even a possibility and/or happening is a concrete factor required for future preparations on my part.

Another potential feature is allowing invisible models to cast stencil shadows. I have a crazy idea regarding a lower poly, invisible player that is controlled by the end user, and attaching an animated sprite using a higher poly version as the base art to it. This animated sprite would use a large amount of frames to give the illusion that it is a real time model. An example of a commercial franchise that does this is the Runaway series of games. The characters were all built in a 3D application and toon shaded, but they use a huge number of frames to give the appearance that they are real time. The purpose of using the lower poly invisible model would be for stencil shadow casting and collision purposes. I know transparent models cannot cast them, but is this also true for invisible models. 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).

@XxX: What do I do with this material. Do I need to play with the d3d_automaterial flag and assign this per surface as outlined in the manual? I'm more of a blocks man than a mesh one, and given A7 WED allows for concave geometry, I can build anything I want should I decide to build my levels in WED and use high resolution textures instead of hand drawing them (I believe you came up with the same idea in the other thread). For saving out specific sections of art for specific layers, I can simply "turn off" the sections that aren't needed to be rendered and vice versa. It'll also provide me with an easy to manipulate base/starting point for the invisible collision hull. Perhaps, I might even use shaders (GAAAASSPPPP!!!!!) for more high quality per pixel lighting and shadows; however I'm not sure what kind of results I can achieve with the new light mapper resolution slider, yet so only experimentation will clue me into what it's capable of.

Nah, WME probably isn't that much different, but they are apples and oranges in certain respects. They both use DirectX, and there's that real time component for 2.5D and some real time instructions in its Javascript-like OOP scripting language. WME just moved to a DirectX 9 version of the engine using the DX June update as a starting point (see my recent WME post in Tools). Mnemonic did this to prepare for the future because I think he's heading towards shadersville (toon shaders are popular in adv. games right now, as well as per pixel lighting and shadow mapping effects). I know new editors are in the future, but low priority for now. Here's a snippet from the WME 1.8 update thread Q&A which I didn't post in that tools thread:

Quote:


Q: Why Direct3D 9? What's the benefit?







A: Quite frankly, there's not much of a benefit at the moment. There should be some performance increase when using hardware T&L (see below). But mainly the Direct3D 9 version of the engine brings more possibilities for the future, such as the access to high-level shader language (HSLS), which was impossible with D3D8. Also, the "Games for Windows" guidelines require games to use D3D9.





Just for kicks, here's the latest manual (2.04 MB CHM format) if anyone wants to inspect what WME is capable of. The engine is now donationware, so some of you might want to play around with it for one reason or another. Seeing what it's capable of via reading the easy to follow manual won't hurt if there's an interest:

http://www.mediafire.com/?dbmx1lmj2yn

It contains info on the shadows procedures, so it is useful and relevant to this thread, too. Here's the official WME site if it peeks anyone's interest. To avoid any problems, you'll need to install the 1.7.3 version then then 1.8 beta, as well as the DirectX June update (provided there's no auto-install feature in the WME 1.8 installer process):

http://dead-code.org/


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Shadows on none surfaces... [Re: Orange Brat] #120570
07/17/07 18:34
07/17/07 18:34
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
As much as I love to build with blocks (trust me, I hate building levels from models), in this scenario, I'm going to have to use models. The route I plan on taking will require me to use a different shader on the level, which is too slow with blocks.

I don't remember the exact method of applying this to blocks, but here's an idea:

Save thses lines into an FX file, ex: none.fx
Code:

technique whatever
{
pass p1
{
AlphaBlendEnable = true;
srcBlend = zero;
destBlend = one;
}
}



then, run this line of code in your main function:
Code:

Function Main()
{
effect_load(mat_flat, "none.fx");
...
}



Without the manual, I'm not sure if my syntax/keywords are correct. I they are though, then this will apply the "invisible" material to all blocks with flat shading...


xXxGuitar511
- Programmer
Re: Shadows on none surfaces... [Re: Orange Brat] #120571
07/17/07 20:10
07/17/07 20:10
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.

Re: Shadows on none surfaces... [Re: Pappenheimer] #120572
07/18/07 16:49
07/18/07 16:49
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:

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.


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

Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | 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