Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 972 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
problem with animated sprite shadows #454727
09/16/15 12:46
09/16/15 12:46
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline 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!


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: problem with animated sprite shadows [Re: sivan] #454729
09/16/15 13:24
09/16/15 13:24

M
Malice
Unregistered
Malice
Unregistered
M



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 Offline OP
Expert
sivan  Offline 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.

Free world editor for 3D Gamestudio: MapBuilder Editor
Re: problem with animated sprite shadows [Re: sivan] #454732
09/16/15 16:03
09/16/15 16:03
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
You will need to compute the frame in the depth shader too. But there will be troubles if the shader is a view material as usually...

Do sprites face the depth view? If not, I guess you will need a solution in order to drop shadows when the camera and the sun are at 90 degrees of pan.

In any case, two different depth views could work: one for static entities and other for sprites, mixed into another view stage before shadow computation. But not cheap at all.

Re: problem with animated sprite shadows [Re: txesmi] #454733
09/16/15 17:44
09/16/15 17:44
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The material could have the OVERRIDE flag set and use render events (ENABLE_TREE or whatever those are called) to switch to a special depth material when rendering via the depth view. Much cheaper than two separate depth views.


"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
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 Offline OP
Expert
sivan  Offline 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 laugh

that OVERRIDE flag also looks interesting to play with, but I'm not really familiar with material events...


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: problem with animated sprite shadows [Re: sivan] #454736
09/17/15 06:28
09/17/15 06:28
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Check the example 2 in the manual for material events: http://www.conitec.net/beta/amaterial_event.htm
It's rather simple yet sometimes the choice of correct flags (_TREE,_RENDER,...) can be a little confusing, or there may be stuff you cannot change in render events.


"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
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 Offline OP
Expert
sivan  Offline 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.

Free world editor for 3D Gamestudio: MapBuilder Editor
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 Offline
Senior Expert
Superku  Offline
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):

Code:
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
Re: problem with animated sprite shadows [Re: Superku] #454752
09/17/15 19:52
09/17/15 19:52
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
many thanks, I think I have an idea what to do now laugh


Free world editor for 3D Gamestudio: MapBuilder Editor
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

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