[EFFECT] C2-DEX Fullscreen Version + VAlphaClip/help needed.

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • C2-DEX Fullscreen Version by Funky Koval and Gigatron, original by Tulamide.

    http://s000.tinyupload.com/?file_id=86337528332899979782 - UPDATED WITH VALPHACLIP EFFECT

    C2-DEX Fullscreen Version is a palette remapper, based on C-DEX (https://www.scirra.com/forum/effect-c-dex_t69823) for Construct Classic by Tulamide. With generous help from Gigatron, I managed to get it it working order and am releasing it to the public. The effect is in the "Fullscreen" category. Here are some captures from the demo included:

    Here are some usage instructions:

    -The most important thing to note is that the sprite containing the palette image must fit the game display area completely, otherwise incorrect colors will be sampled and artifacts will appear. That's why it's called the "Fullscreen Version".

    -Palette sprite rotation is not supported, which should be a moot point, since it has to fit the screen.

    -To remap the whole screen without any masking, all that's needed is the palette sprite stretched across the screen with the effect applied.

    -Masking the effect uses the palette sprite's Alpha channel - the only limitation is that the pixel row from which the remap palette is taken has to be completely opaque. More about this in the parameter description section...

    UPDATE Use VAlphaClip on the mask objects to clip them as they get close to the screen vertical edges. See updated demo .capx

    -A more dynamic way of masking would be applying the effect to a layer and using the Destination Out blend mode on alpha sprites to cut the layer alpha (this method is shown in the .capx file). However, the limitation above applies - the palette row has to stay opaque.

    UPDATE See above for workaround.

    And now for the parameter descriptions:

    Palette Y - the pixel row that will be used as the remap palette. 0 would be the top-most row and 1 the bottom. Inbetweens are handled accordingly. Remember that this particular row has to be completely opaque, otherwise invalid colors will be sampled.

    Invert Mask Alpha - inverts the effect masking.

    Intensity - blends the original colors with the remapped colors. If set to 0, effect has no... effect. If 1, only the remapped image is visible.

    Have fun and enjoy the effect. And now to why it says "help needed" in the subject:

    -For all shader writers: how would one write a shader that works like the "Destination Out" blend mode, but only on Alpha, preserving RGB? Using this shader on the masks would remove the limitation of having the palette pixel row fully opaque.

    Any help is most apprectiated.

  • The formula for alpha from src, dest is something like this :

    gl_FragColor = mix(vec4(dest.rgb, 1.0), vec4(src.rgb,1.0), (gl_FragCoord.x/iResolution.x-src.a)/(src.a/dest.a));[/code:r8egllez]
    
    you know now ; dest is vec4 samplerback ... and src is vec4 samplerfront ... the sprite using fx on C2.
    
    I have really no time to finish a huge list of my glsl fx list for C2. My goal is 500 Fx for C2;
    Ok make some test with this formula ... will see later ;
    
    Regards
  • Gigatron

    Thanks. Yup, now I understand.

  • Thanks, Cool FX.

    I made a nice example with it, check it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Funky Koval Please can u reupload it (dead link)

    Will be great to play with that fx. Thank u

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