Funky Koval's Forum Posts

  • R0J0hound

    As per your posts, these seem to work:

    R int((-ColorValue/2^38)%1024*255/1023)

    G int((-ColorValue/2^24)%1024*255/1023)

    B int((-ColorValue/2^10)%1024*255/1023)

    A int((-ColorValue)%1024*255/1023)

    except when the channel value is 255 - the formula rounds it off to 0, instead of 255. Would you know how to resolve this rounding?

  • Quazi:

    Two quick questions:

    -how can I mask the reflection map? For example, making windows more reflective and the wall less, in a building facade texture

    -how can I add an emissive (self-illuminated) map?

  • R0J0hound

    Is there a layout size above which Chipmunk stars loosing precision/becomes unstable? I managed to find this thread:

    https://chipmunk-physics.net/forum/view ... f=1&t=2771

    which states that Chipmunk uses double precision, so layouts of around 100K in size should still be fine, right?

  • Actually, top left is (0,1) and bottom right is (1,0) - you can check it by visualizing the UV coords - something like:

    output = vec4(vTex.x,vTex.y, 0.,1.);

    I was confused about that as well - most sources say (0,0) and (1,1).

  • Update 24/07:

    Do re-download the effect. The only change is that the effect parameters do not start with a number anymore. Apparently, if a parameter name starts with a number, Construct will read the .capx with the effect as "corrupted"...

    If you have saved a .capx with the older version of the effect and Construct refuses to open it, do the following:

    • Leave the error message open
    • Rename the .capx to .zip
    • Open the .zip
    • Find the file referenced by the error message
    • Open it in Notepad or your XML editor of choice
    • Go the the line referenced by the error message - you'll find that these are the effect parameters' names.
    • Change the names, removing the number, fullstop and space at the beginning. ex. "1. "
    • Re-save the layout file, rename the .zip back to .capx - it will open properly now.

    Apologies for this - as far as I can see on the forums/help files, the parameter name issue is not documented anywhere...

    The numbers are now in the parameter description - their purpose is to let the user know which property has which parameter number - for control via events.

  • Gradient Map

    http://s000.tinyupload.com/?file_id=724 ... 1666677795 <- URGENT UPDATE. SEE BELOW POST FOR INFO

    Works like Gradient Map in Adobe Photoshop ( http://media.tumblr.com/tumblr_m66m4yiOs91roapsd.jpg) - it's only a six-flag gradient, because the UI gets exponentially longer the more flags there are. No limitations of this one, except one: the flag positions must be in ascending order, otherwise the out-of-order flags will be ignored.

    The parameters are numbered, so it's easier to know which parameter is which in the Event Sheet.

    Source - specifies the source of the colors to be remaped - 0 is the sprite itself, 1 are the pixels under it.

    Intensity - a uniform blend between original colors and remapped colors.

    FlagX R, FlagX G, FlagX B - color values for the given flag.

    FlagX Position - position of the flag. 0 is far left, 100 is far right. Flag0 is on the far left and Flag5 is on far right. Remember, flags 1 to 4 must be in ascending order otherwise the out-of-order flags will be ignored.

    Enjoy.

  • blurymind

    It's a .zip file. It can't compromise your system. chrisbrobs has an alternate one you may try.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:33gzisdu]its quite simple - just have the ability to assign a color that is other than black to the vignette.

    <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Download link below. Enjoy. If this is the effect you're after, I'd suggest changing the thread title so people know there's a solution.

    http://s000.tinyupload.com/?file_id=001 ... 4537071831

  • Gigatron

    Thanks. Yup, now I understand.

  • Gigatron

    [quote:phb8iiij]instead mixing textured palette with texture ; here is mixing glsl gradient with texture..

    will send this glsl to you soon ;

    Yup. This will settle the out-of-screen sampling problem. I'm doing something similar, but the problem I have is a compact UI for more than two colors - ideally one color is 4 floats, R G B and position, so the UI gets cluttered. Unless it's possible to send vectors from C2 to the shaders... I only saw floats and percentages though...

  • 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.

  • Gigatron

    I've managed to get a full-window version of C2-DEX working well. There are still a few minor issues that do not inhibit the basic functionality of the effect which I'd like to resolve, but it is more or less ready for people to test. I'll post it in its own thread to stop spamming this one, since it's a request theread, but I am eagerly awaiting your version.

  • The forum truncated the link. Use something like TinyURL to shorten it.

  • Mattertainment

    First thought, there's something wrong with the .obj - upload it and I'll take a look.

  • I think I understand how you're doing it, but how will it handle cases whre the remap palette is not a simple two-color gradient? Like that sushi cat image I posted?

    Anyway, I'll wait for your shader and try to disect it. Thanks again.