Mikal's Forum Posts

  • I am not sure why the behavior is different between C3 and C2, but in C3 the wrong skend behavior shows up when there are more sprites in the project (and when sprites are packed into some large textures.) To resolve this I normalized the delta x offset based on srcStart/SrcEnd and also switched back to pixelSize.y. See comments in the effect.fx code below.

    I updated the c3addon in the OP with this new version, bilgekaan please try it again.

    I tried a few tests with a different number of other sprites and checked for how the textures were packed using the chrome debugger, the effect worked across a few cases, but watch for the skend effect changing as you change the number of sprite objects (not instances) and size of the sprite source texture (animation).

    Also the more you skend, you may need to 'pad' in your original texture or you'll get clipping and perhaps sampling neighboring textures in the case of packed textures.

    Here's the new code:

    /////////////////////////////////////////////////////////
    // Skend effect
    varying mediump vec2 vTex;
    uniform lowp sampler2D samplerFront;
    
    uniform lowp float pixelWidth;
    uniform lowp float pixelHeight;
    uniform lowp float Skend;
    uniform mediump vec2 pixelSize;
    uniform mediump vec2 srcEnd;
    uniform mediump vec2 srcStart;
    uniform mediump vec2 srcOriginStart;
    uniform mediump vec2 srcOriginEnd;
    uniform mediump vec2 layoutStart;
    uniform mediump vec2 layoutEnd;
    
    void main(void)
    {	
    	mediump vec2 tex = vTex;
    	mediump vec2 texOffset = tex - srcStart;
    	
    	// Original from C2 effect, did not work with sprite packing in C3 and pixelHeight did not seem to work
    	// tex.y -= (pixelHeight*Skend)*pow(tex.x,2.0);
    	// Instead, calculate the normalised position n of vTex in the foreground rectangle and use that for Skend amount
    	mediump vec2 n = (vTex - srcOriginStart) / (srcOriginEnd - srcOriginStart);
    	tex.y -= (pixelSize.y*Skend)*pow(n.x,2.0);
    		
    	gl_FragColor = texture2D(samplerFront,tex);
    }[/code:1a37uoab]
  • Ok, I see the same error when I add more sprites. Hmmm, let's see if there are some new C3 effect uniforms that can adjust for this.

  • Glad it's working and that's a cute little game, fun to play. Did you only do the ad on game start? Do you have ads play at other times?

  • Mikal That's weird. It looks like this in my template.

    I think it tries to skew whole sprite sheet as mOOnpunk mentioned.

    bilgekaan that looks pretty strange, can you share your *.c3p project, so I can try it also and take a look? It also does not appear to 'Skend' the way I expect (where the amount changing depends on Y coord of the texel/sprite.) Instead, it looks like the entire image is shifting.

    If you use the SkendTest.c3p project I posted above, do you see the same issue?

  • Looks promising. Quick check if the C2 to C3 functionality works (can't load/convert *.fx file on the C2 to C3 fx tab.)

    I did a couple conversions, I'm finding it tricky to find shadertoys that work in C2, got one working ok (mandlebrot). Any guidance on which shadertoys shaders will work well (I am assuming no multi-pass, simpler to not use iChannel textures.)

  • Nice demo, what tool are you using to create your normal maps, RodBraga?

  • Similar issue - it seems to work on r75:

    https://editor.construct.net/r75/

  • I had a similar issue with r76.2, so I went back a rev to r76 and it worked.

    Try this link to use r76:

    https://editor.construct.net/r76/

  • Added SkendTest.c3p to original post for LaurenceBedford

    - good question, not sure, I'll leave that as an exercise for the reader. It seems like if there was a concern, you could pad your sprite that you are skending, so the shader would not touch other sprite data in a sprite sheet. The simple SkendTest does work with Remote Preview on an IPhone with Safari.

  • This one is for bilgekaan

    Converted over skend effect.

    Skend.c3addon

    Result below.

    SkendTest.c3p

    New effect (modified version of Skend):

    SkendPow.c3addon

    Also includes parameter to adjust the exponent of the skew variation (originally started at 2.0 for the Skend effect, higher makes the base skew less, lower makes the base skew more.)

    SkendPowTest.c3p

    bilgekaan let me know if it works for you.

    [Changes needed to make the effect work are in subsequent posts.]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks! Looking forward to using this for source control (I use bitbucket / git). Just last week I lost a day of work due to a user (i.e. me) cloud save / local *.c3p mixup that source control could have saved for me.

    I do still like the browser option of working anywhere I have chrome, so will still use that sometimes too.

  • Here's an auto convert of the plugin if you want to try.

    However, I could not load my sample up to the gamedistribution.com website to test (seemed to hang in the upload state, I was uploading an html5 zip file renamed to <gamename>.hmtl5.)

    Perhaps someone else can try (it does not seem to work in C3 preview mode due to CORS issues, which kind of makes sense, it may need to run on their website with appropriate CORS permissions, etc.)

    gamedistribution.c3addon

    Please let me know your results.

  • This.Is.Perfect.

    Do you have any documentation on this? Like how to change the values within the event sheets?

    I'm not sure how to actually have it dynamically change like you are doing! I've done this in the past in other engines not sure how to get this effect in Construct 3.

    Check out the original thread normal-map-extended for more details.

    Here's an example C3 project for the image at the start of this thread. NormalExtendedNoSF.c3p

    For 'correct' rotating normal maps using this effect and changing parameters in events, see my posts in the original thread.

  • Nicely done and thanks for the pointer back to Expedition, it looks like a cool tabletop RPG also. How was it to implement this in C3? Any learnings that came out of it?

  • Relaxed over the holidays, but also got a present for game development: a Blue Yeti Mic for doing some voice over / scratch audio! First test is below, myself and my Son (with some good direction from Mom who is also a film director IRL, our first takes without her were pretty poor.) I like including voice, but am also considering just doing the Nintendo Zelda/Mario style emoting mumbles and exclamations which also seem to work OK (and require a lot less recording.)

    Recorded with Audacity, some filtering, normalization and compressor used to clean up the audio. Background music from Kevin MacLeod.

    Scratch Audio - Video