Gigatron's Forum Posts

  • Anyone able to convert this shader to C2?

    https://github.com/uheartbeast/jitter-free-pixelart-scaling/blob/master/JitterFreePixelArt.shader

    See what it does here:

    Subscribe to Construct videos now

    This shader use standard derivatives not working for me in normal fx;

    However i used shadertoy plugin ...

    #extension GL_OES_standard_derivatives : enable

    void mainImage( out vec4 fragColor, in vec2 fragCoord )

    {

    vec2 uv = fragCoord.xy / iResolution.xy;

    vec2 size = vec2(iResolution.xy);

    vec2 pixel = vec2(1.0) / size;

    uv -= pixel * vec2(0.5);

    vec2 uv_pixels = uv * size;

    vec2 delta_pixel = fract(uv_pixels) - vec2(0.5);

    vec2 ddxy = fwidth(uv_pixels )*3.5+sin(iTime)*9.0;

    vec2 mip = log2(ddxy) - 0.5;

    vec4 c1= texture2D(iChannel0, uv + (clamp(delta_pixel / ddxy, 0.0, 1.0) - delta_pixel) * pixel, min(mip.x, mip.y));

    vec4 c2 = texture2D(iChannel0, uv); // debug

    fragColor = vec4(c1);

    }

    you can copy past and try with this tool ...

    http://gigatron3k.free.fr//html5/C2/plugin/st/

  • Hey Gigatron,

    i would love to see the shadertoy plugin grow big.

    Any chance to make the preview window smaller or scalable than there would be

    more room for controls?

    Any roadmap on this gem. I would be cool to make a unquie topic for it on the forum.

    Keep up the good work!

    Hello ... the preview window is scalable .. i think..

    http://gigatron3k.free.fr//html5/C2/plugin/st/

    After finishing the work i will publish this plugin for C2 and you can run some basic shadertoy shaders .. this mean no buffered and no complex shaders for newer gfx ...

    Regards

  • It would be dope to have something like interactiveshaderformat with the ability to save as effect file.

    I need to learn more about shaders. Your making outstanding work with construct2.

    Sure , and thanks for your kind words glad you like it ...

    ok now you can change vec3 float uniforms and load texture, i used normal C2 glwrap.js file it still works.

    But one day i must overwrite glwrap.js from scirra. C3 use newer version of

    glmatrix.

    http://gigatron3k.free.fr//html5/C2/plugin/st/

    some others informations;

    if you want to make modifiable uniform, place at top of shader:

    uniform float myvalue;

    myvalue can now modifiable from shader and must be used somewhere in the shader;

    if you want to make modifiable vec3 uniform, place at top of shader:

    uniform vec3 myvalue; // it's become vec3(x,y,z);

    myvalue can now modifiable from shader and must be used somewhere in the shader;

    to enable standart derivatives place at the top of the shader;

    #extension GL_OES_standard_derivatives : enable

    this enable dFdx,dFdy and fwidth :return the sum of the absolute value of derivatives in x and y

    Regards

  • First I must finish this work and after this will see ... I have modified some c2 file... but will try this work with old glmatrix 1.0.1

    You can now load your texture; and compile button is enabled; this mean you get some errors if the shader is not correct written; but test this.

    Don't forget texture must Power of Two size; 2x2,4x4,8x8,16x16,32x32,64x64,128x128 and so on ....

    texture(iChannel0,uv) not working for me this is the reason why it's replaced

    by texture2D(iChannel0,uv) for example ;

    http://gigatron3k.free.fr//html5/C2/plugin/st/

    Regards

    Here is simple shader example to play with uniform ;

    uniform float it; void mainImage( out vec4 fragColor, in vec2 fragCoord ){ vec2 uv = fragCoord/iResolution.xy; vec3 col = texture2D(iChannel0,uv).xyz*it; fragColor = vec4(col,1.0); }

    After loading texture in slot0=iChannel0 you can play with uniform

    name = it ;value 0.5 for example to have an intensity of texture

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Shadertoy as a C2 plugin? Very interesting!

    I would like to show you a demonstration ;

    http://gigatron3k.free.fr//html5/C2/plugin/st/

    take this shaders from st:

    https://www.shadertoy.com/view/Xls3zf#

    https://www.shadertoy.com/view/llfGR7#

    https://www.shadertoy.com/view/Md2SDc

    And so .... copy one of shader to text area and click Load Text fragment,

    normally it's working.

    for changing uniform ;

    eg : https://www.shadertoy.com/view/Xdd3RB

    after shader was copied:

    change this line to : float uZoom = 10.; >> uniform float uZoom;

    to create an uniform from : uZoom

    and then you can change uniform name in textbox to uZoom and change the value ...

    play with ..

    Regards

    PS: complex shaders with bitshift << or >> or newer shader are not working for me,

    i need to change my gfx card :!

    glmatrix is a newer version than old C2 v1.0.1;

    standard derivatives enabled ; etc !

  • Hello Gigatron,

    is this idea than cancelled to implement litegl.js as a plugin in c2 or do you still try it?

    Is there a chance to see you working on the shadertoy to c2 proggi again this year?

    I would like to implement litegl.js to C2, the only problem is glwrap.js from Scirra. This file must be modified, must ask Scirra staff if C2 is will be opensource ? For now i am testing stage just rewrite shader part...

    You mean shadertoy plugin ? I can adapt entirly this to C2 as plugin..

    Stay tuned .

    Best Regards

  • I am very curius about this! Gigatron

    Thanks for your hard work!

    I want to make plugin but it's not working with C2 .. cause old glmatrix version 1.0.1;

    If you want to look what i mean here is some example of litegl.js plugin i would make, litegl using glmatrix 2.0.7 or 2.0.8;

    https://tamats.com/projects/litegl/examples/

    Regards ;

  • Hi i understand the goal ; I am working to port glmatrix 2.7.0 to Construct2 ( working with old version 1.0.1 )

    it's working with 60%. After finished i will try to meditate with samplerBack & samplerFront to blend bg and front layout ... for detect bg color with sprite like you want ...

    Regards

  • Hi , here is another fx for LAYER only please; nice Scarlett

    This fx proably interest someone there; First play with sliders and see if you need this fx ;

    Demo'n fx inside (if you click Download Text) have fun and be cool ;

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

    Regards

    Ps: Don't forget to see my demo contribution for Shadertoy ;

    https://www.shadertoy.com/view/tt3GzB

  • This fx is free ..

  • One friend asked an old fx but reworked ... so let me share this with you ;

    Demo : http://gigatron3k.free.fr/html5/C2/FX/xfilter/

    The fx file is inside this demo click the text "Download FX" and your browser

    can download this fx ..

    Regards

  • Sorry , it's not working with opaq layer color, you must set layer to transparent. There is another way to simulate drop shadow withe multiple layer texture but i must see that ;

    Regards

  • So the problem is mix glsl command .. and transparent area;

    Send another color shadow demo and new fx called Drop shadow color ; dsc;

    demo : gigatron3k.free.fr/html5/C2/FX/dsc

    file : gigatron3k.free.fr/html5/C2/FX/dsc/dsc.zip

    If you want this shader download and play with parameters and

    download this fx ;

    Be sure i will try to fix the first dsp shader asap ;

    Regards

  • Ok ... it's seem shader problem issue, i have 500 C2 shader and the

    demo is not the same shader i have.

    So i ve made another demo and upload another drop shader from my SSD;

    demo: gigatron3k.free.fr/html5/C2/FX/dsp2

    zip shader: gigatron3k.free.fr/html5/C2/FX/dsp2/dsp2.zip

    Try this one ;

    Regards