1 registered members (AndrewAMD),
972
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
problem with animated sprite shadows
#454727
09/16/15 12:46
09/16/15 12:46
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
Hi I have just created a sprite animation shader using a few images (one for idle, one for walk) in grid arrangement: Nearly everything works fine, except shadows, they are casting the shadow of the whole image: I did not set the NOSHADER flag of the shadowmapping depth view, d3d_instancing is 0, so what could be the problem? Thanks!
|
|
|
Re: problem with animated sprite shadows
[Re: sivan]
#454729
09/16/15 13:24
09/16/15 13:24
|
Malice
Unregistered
|
Malice
Unregistered
|
Malice floats a guess, File name not correct, file has no frame number, engine assumes a non-animated sprite because of files set-up and file name. So animated sprites have to be horizontal strips with a frame number attached to name. If these are missing the engine should assume a none animated sprite. Then cast the shadow of the full image
Thanks for letting me guess. And I have no idea if that correct. Mal
|
|
|
Re: problem with animated sprite shadows
[Re: ]
#454730
09/16/15 13:45
09/16/15 13:45
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
yeah, indeed I could use 64*4096 (4096=64*8*8) pixel sized image strips... single row sprite output is supported by Fragmotion but buggy (I use it to convert the animated 3D model into animated sprites simply), maybe I can merge the 8 rows...
Last edited by sivan; 09/16/15 13:55.
|
|
|
Re: problem with animated sprite shadows
[Re: Superku]
#454734
09/16/15 20:06
09/16/15 20:06
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
thanks all. I was simply surprised that it does not work as I expected, I just guessed some tricks are missing from the depth view... and what do you think, would the same happen with a billboard model with an animated (shifted) skin? I think I start with the simplest fastest version, i.e. using a one row animation per state (finally I figured out that I can export from Fragmotion an animation sequence corresponding to one angle fine in uniform arrangement, then a little script I just made can merge the 8 png/tga files), and I can set the entity->frame to desired animation and camera compensated angle easily. but I'm happy with that I could make this animation shader of the grid sprite anyway that OVERRIDE flag also looks interesting to play with, but I'm not really familiar with material events...
|
|
|
Re: problem with animated sprite shadows
[Re: Superku]
#454741
09/17/15 11:56
09/17/15 11:56
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
1st test: with a +64.tga sprite strip I get the same result, both with or without a entity shader (in case of the shader I set both the ent.frame and do proper UV animation in the shader).
I still have no idea how I could solve it by a material event, but I'm sure I want to avoid to use 2 depth views because it is a performance sensitive situation. indeed the billboard lod itself is made because of performance gaining.
the strange thing is that as I remember earlier with a simple +10 sprite sometimes I got good, sometimes similarly bad results...
moreover imo it should be supported by the engine without workarounds. maybe jcl can give a simple answer...
p.s. I exceeded the file name length limit of 20 characters, but the same happens now with a short named file placed in the game folder.
Last edited by sivan; 09/17/15 12:22.
|
|
|
Re: problem with animated sprite shadows
[Re: sivan]
#454744
09/17/15 13:28
09/17/15 13:28
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I can make you an example later today or tomorrow. EDIT: Something like this (obv. untested):
VIEW* depth_view =
{
...
}
MATERIAL* warrior_depth_mat =
{
effect = "warrior_depth.fx";
flags = AUTORELOAD;
}
MATERIAL* warrior_tex_mat =
{
event = "warrior.fx";
flags = AUTORELOAD;
}
var warrior_mat_event()
{
if(render_view == depth_view)
{
mtl = warrior_depth_mat;
return 0;
}
mtl = warrior_tex_mat;
return 0;
}
MATERIAL* warrior_mat =
{
event = warrior_mat_event;
flags = ENABLE_RENDER | OVERRIDE; // maybe try a different ENABLE_... flag here
}
Then your "warrior.fx" file is your current shader and the "warrior_depth.fx" contains a regular depth shader modified with your cropping shader where you just clip if transparent, return depth otherwise. The "samples" and the "code" folders in your Gstudio installation contain examples.
Last edited by Superku; 09/17/15 13:42.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|