necromaster's Forum Posts

  • Hi,

    It's not that difficult really. Your maths must be pretty polished for this and you need to know some basics on GLSL - the shader language (which I need to brush up on myself).

    Everything I have done so far (except maybe the Oscillating Sweep) was based on something from either Heroku or Shadertoy (especially those shaders with no prohibitive license attached).

    I will be working on a tutorial soon for this. Look out for this.

    Thanks,

    Gavin

  • Will take a closer look at everything you mentioned as well as any available documentation on Heroku/Shadertoy (as well as the code internal to C2).

    The ultimate objective is to find an easy way to handle the porting of shader code to a C2 environment for the more casual users.

    Thanks,

    Gavin

  • Interesting... what was BoardGame supposed to do?

  • Suffice to say, this shall be the last effect from us for today.

    Self-explanatory... go and see this kaleidoscopic effect over at http://gameswarp.com/studio/?p=311. You can download the effect from there for free.

    Thanks!

    GamesWarp Studio

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ever wanted to create those oscillating sweeps you see on analogue televisions? Or maybe you're looking for some funky image transition to implement programatically? Or you're looking for some high-tech screen jamming effect? Well, with some creativity you will be able to do so with the Oscillating Sweep shader effect.

    Head over to the link below to download the shader and to play with it online.

    http://gameswarp.com/studio/?p=305

    Enjoy!

    GamesWarp Studio

  • Nope... it seems that this issue still persists. I have changed my code to use the above line. However changing resolutions still give me an offset problem.

    I used the following shader code to test out my code at 800x600 and 1600x1200. Only the 800x600 code gets the mouse position ALMOST correct, while 1600x1200 is way off.

    Reference:

    shadertoy.com/view/lssGzH

    HIGHLIGHT MOUSE POSITION SHADER CODE

    precision mediump float;

    varying mediump vec2 vTex;

    uniform lowp sampler2D samplerFront;

    uniform mediump float seconds;

    uniform mediump float pixelWidth;

    uniform mediump float pixelHeight;

    uniform mediump float layerScale;

    uniform float mseX;

    uniform float mseY;

    uniform float distancebetweencircles;

    uniform float zoomfactor;

    mediump vec2 iResolution = vec2(1./pixelWidth, 1./pixelHeight);

    mediump vec2 iMouse = vec2(mseX, mseY);

    float smoothbump(float center, float width, float x) {

    float w2 = width/2.0;

    float cp = center+w2;

    float cm = center-w2;

    float c = smoothstep(cm, center, x) * (1.0-smoothstep(center, cp, x));

    return c;

    }

    void main(void) {

    vec2 uv = (gl_FragCoord.xy / iResolution.xy);

    vec2 m = iMouse / iResolution.xy;

    float m1 = smoothbump(m.x,0.05,uv.x) *

                 smoothbump(m.y,0.05,uv.y);

    gl_FragColor = vec4(m1,0,0,1.0);

    }

    Did I miss something out?

    Or is it a bug? Or maybe a missing feature?

  • When time permits... sure will

  • Here's a pretty standard shader effect with a demo CAPX program for you to try out. Yes, we know there is already an Outline effect, but we couldn't get that one to work properly.

    SOBEL EDGE DETECTION SHADER:

    http://gameswarp.com/studio/?p=299

    OUTLINE SHADER:

    http://www.scirra.com/forum/topic59504.html

    For those who want a challenge, go ahead and modify our shader code to implement a edge detection line thickness effect as in the Outline effect. It would serve as a good tutorial base to work with. Open both Outline.fx and Edge.fx with a text editor and see what needs to be tweaked. Remember to edit Edge.xml to introduce the new line thickness parameter.

    Thanks,

    GamesWarp Studio

  • We have taken an MIT Licensed shader code and converted it for use in C2. You can read more about it over at http://gameswarp.com/studio/?p=294

    This is quite a nifty little shader, and if you know how, you can tweak almost any parameter you desire in the shader code. Imagine a shoot-em-up game that takes place in front of the planet generated by this shader. It would surely look awesome!

    We'll do a couple more shader effects for the holiday season before committing what we learn into a tutorial for the community. Then, you will be able to pull any non-licensed shader effect from Heroku and Shadertoy into your game/app.

    Thanks!

    GamesWarp Studio

  • I found an error in my code, and will be relooking at all the above.

    This

    vec2 resolution = vec2(pixelWidth, pixelHeight);

    should be

    vec2 resolution = vec2(1./pixelWidth, 1./pixelHeight);

    In the meantime, please ignore this.

    I will repost, if I suspect a bug.

    Thanks,

    Gavin

  • Another way to look at it.

    Here is a shader effect on Heroku/Shadertoy that is not dependent on mouse movement... glsl.heroku.com/e

    1. Set resolution to 1366x768.

    2. Load the heroku link - glsl.heroku.com/e

    3. Resize the browser window to fit four rows of hexes.

    4. Change screen resolution via control panel - I chose 800x600.

    5. Count the number of rows of hexes... it should still be four.

    Conclusion: The shader output maintains itself regardless of resolution changes.

    Now, if only Construct 2 can do that... then the community would have a Heroku/Shadertoy like sandbox at their fingertips.

    Thanks,

    Gavin

  • Link to .capx file (required!):

    VIEW

    DOT SCREEN

    gameswarp.com/studio/demo/Bug/DotScreen800x600

    gameswarp.com/studio/demo/Bug/DotScreen1600x1200

    COLOR HALFTONE

    gameswarp.com/studio/demo/Bug/ColorHalftone800x600

    gameswarp.com/studio/demo/Bug/ColorHalftone1600x1200

    DOWNLOAD

    DOT SCREEN

    gameswarp.com/studio/demo/Bug/DotScreen-800x600.capx

    gameswarp.com/studio/demo/Bug/DotScreen-1600x1200.capx

    COLOR HALFTONE

    gameswarp.com/studio/demo/Bug/ColorHalftone-800x600.capx

    gameswarp.com/studio/demo/Bug/ColorHalftone-1600x1200.capx

    Steps to reproduce:

    See description below.

    Observed result:

    The two outputs are dissimilar.

    Expected result:

    The two outputs should remain the same even if the resolution is changed via C2 or manually via the control panel.

    Browsers affected:

    Chrome: yes

    Firefox: browser had been uninstalled; unable to test

    Internet Explorer: yes (on IE11)

    Operating system & service pack:

    Win 7 64-bit, SP1

    Construct 2 version:

    1.52

    DESCRIPTION

    I have been toying with my mouse cursor specific shaders for the past few hours now and have my suspicions that there are some problems with C2's shader "resolution" code.

    If you could refer to these forum messages:

    1. scirra.com/forum/effect-gs-4-circles-with-eyelid_topic82420.html

    2. scirra.com/forum/effect-gs-2-flower-petals_topic81325.html

    I got different results just by changing the screen resolution between 1600x1200 and 800x600 (this includes resizing the background to fit the screen). In one case, the mouse cursor is in the exact center of the flower petal effect, while it is displaced in the other.

    I simply cannot reconcile my observations of Construct 2 with what I see on Heroku and Shadertoy. Try this one for example and change the screen resolution via Control Panel: glsl.heroku.com/e

    The pattern should remain the same - centered on the mouse.

    On Heroku/Shadertoy, they have the resolution parameter that takes care of all resolution switching problems. On Construct 2, I coded it as: vec2 resolution = vec2(pixelWidth, pixelHeight); - which is similar to the approach used in Heroku/Shadertoy.

    To demonstrate there is an error in Construct 2, I had to search for an existing plug-in that would clearly demonstrate the problem. Here are two.

    Just create two Color Halftone (or two Dot Screen) effects having the same settings, but set one to 1600x1200, and the other to 800x600. You will see that the output images are different in appearance because of the resolution change.

    I may be wrong... but please, give me the benefit of doubt... as I am at my wits end as to why C2 can't behave similarly to Heroku/Shadertoy. Would love to hear your explanation.

  • Dear all,

    We are currently rectifying a minor bug we found with our position sensitive shaders.

    Description of problem: If you used the example found in the zip file and change the layout resolution to a different value (say 800x600), you may have noticed the mouse arrow is no longer centered on circle pattern.

    We will update this thread when we have an updated version available for download.

    Thanks,

    GamesWarp Studio

  • Dear all,

    We are currently rectifying a minor bug we found with our position sensitive shaders. This means only the "Flower Petals" and "Circle (with eyelid)" plugins are affected.

    Description of problem: If you used the examples found in the zip file and change the layout resolution to a different value (say 800x600), you may have noticed the mouse arrow is no longer centered on the center of the flower.

    We will update this thread when we have an updated version available for download.

    Thanks,

    GamesWarp Studio

  • And dare I mention it... you should try the Firestorm effect with the User Media plugin... it looks fantastic; really heats things up!