[Request] Drop Shadow Plus

0 favourites
From the Asset Store
320 high-quality cinematic sound effects for trailers and game scenes.
  • EDIT: The shader works correctly now, also this needs to be applied to the layer you want to cast shadow and will works with spritesheeting, rotations and will appear in the bottom of the sprites without overlaps due Z-Order.

    -----

    This is what i'm looking for:

    Parameters i need:

    X Offset

    Y Offset

    Opacity

    Blur

    Red

    Green

    Blue

    For example the example i posted have:

    X Offset = 1

    Y Offset = 1

    Opacity = 50

    Blur = 0

    Red = 0

    Green = 0

    Blue = 0

    Optionally add "Angle Fade-Out", to select in which angle do the fade, example image:

    Also a parameter for this to select the size of the fade.

  • matriax

    Something like this one is ok ?

    example: 1 pass shadow without iteration so fast as possible ...

    We use quad in glsl quad is the sprite area ; this area must a bit greater than

    sprite size (around) . The back color must be transparent... etc.

    For blur you can use standard C2 vertical or horizontal blur those fx use

    more samples so you can simulate fade...

    http://gigatron3k.free.fr/html5/C2/FX/dsp

  • Gigatron

    WOW! Yes that works for me . The unique thing is the color, seems is added to the background? Maybe in my example was bad explained but the RGB color is for the shadow not the background sorry. Also Ok for the other things, already have the sprite with some transparent around it for some king of animations so seems will fit perfectly.

    Link to download ?

  • Gigatron

    WOW! Yes that works for me . The unique thing is the color, seems is added to the background? Maybe in my example was bad explained but the RGB color is for the shadow not the background sorry. Also Ok for the other things, already have the sprite with some transparent around it for some king of animations so seems will fit perfectly.

    Link to download ?

    I must just edit .xml file and look for the shadow colors...

    Let me 1 day please ...

    regards

  • Gigatron

    No problem!

  • matriax

    OK , let's go ;

    live demo with adjustable shadow colors and the rest x,y offset and fade color ;

    http://gigatron3k.free.fr/html5/C2/FX/dsp

    fx file :

    http://gigatron3k.free.fr/html5/C2/FX/dsp.rar

  • Gigatron

    The shadow not have opacity, please change "shadow fade" by "Opacity" and make with opacity you can see the background. Or maybe i not understand the shader but i tried various configurations and only can get one color for the shadow but i can't add opacity so i can't put to 50% to blend with the floor to get a real shadow.

    Also i found this weird thing around the player:

    My Shadow Config:

    My sprite is 36x36, the player is 28x28 with 4 or more pixels transparent around him.

  • Sorry matriax i missed the background //

    Is this ok now ?

    http://gigatron3k.free.fr/html5/C2/FX/dsp

    fx file;

    http://gigatron3k.free.fr/html5/C2/FX/dsp.rar

  • Gigatron

    Yes now the opacity works fine thanks! but still the problem with the weird thing, check:

  • matriax

    Can you post this sprite for me please ?

    don't forget this type of shader is not working for animated sprite.. why ?

    After exporting project C2 convert all picture in .png file and then you have a big picture

    with different elements like sprite and other objects in the same image...

    Solution is make each frame for different object...

    if your sprite use 6 frame you must create

    6 different object, spr0,spr1,spr2,spr3,spr4,spr5... and apply the fx for each sprite... this is the only way ...

  • Gigatron Nevermind! My Fault! I had my own shadow system when i no had shadows and was making this weird thing. NOw no weird thing around the player and the opacity works fine.

    But i found a problem, and is that the shadow rotates with the player changing the point of the light. I mean if i set XY ofset of the shadow this have to be always the same no matter the player rotation, i will give you an example:

    Now, the shadow position rotates with the player, and the shadow always should be in an offset/angle of the light that appears in the second case that is always at offset X+1 and y+1. But now when player rotates the shadow also does :S .

    Maybe i'm requesting an imposible, but can you make a "static shadow" in a offset no matter the player sprite rotation?(i guess will have to update every tick)

    Using sprites for shadow i clone the player gfx, set tint to black and every tick set the postion to player X+1 and Y+1, so no matter the player sprite rotation the shadow will always appears in the same offset, X+1/Y+1.

    Is possible do that in the shader?

  • matriax

    You can simply use switch case like javascript.

    var left,right,up,down

    if left x=.. y=..

    if right x= .. y= ..

    this is the best way , assign x,y for every player direction state...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Gigatron

    I want to use the shader to have shadows without use events. Doing what you say i will have more events like if i do in my own way using sprites.

    Also have in mind the player has 360 rotation and also using the mouse when you aim you can walk to left and the player looking to right, so i need a ways the shadow position is updated every tick to the offset i set on parameters so no matter any condition will appears in that values. I don't know if i explained well

  • matriax

    I understand well... so when the player rotate don't forget vTex rotate too (logic) , this is the reason why the shadow rotate...

    the only way for now is for this is checking the direction of player and adjust x or y offset ...

    The other way is an fx for entire static layout...not rotating and the we can place Shadow light on the left for example

    and all object placed on the right of light will have shadow at fixed position depending the light shadow... Shadow cast do this i think//

    Regards

    PS: i must explain Vtex fx and layout layer fx.

  • Gigatron So, at the moment no way to have the shadows working correctly only using the shader(without events) right?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)