Gigatron's Recent Forum Activity

  • totoe

    zenox98

    Thank you for testing.. just to know an error like you said .. error on xml file ; i will fix that ;

    Really thanx ; this issue was fixed now;

  • Hello nice people;

    I would like to share a tool with you. I have some errors when i would like to convert

    C2 shaders to C3, so i ve relearned delphi pascal quickly and coded this tool in 2 days..

    The goal is converting Shadertoy shaders to C2 and then C2 shaders to C3.

    There are many issues , be patient and test it... feedback are welcome especially virus warnings.

    The future version of this tool will be

    under this post... (must rewrite some part of the code for better word detection.)

    Download link...

    V0.0.9; some complex shader conversion attempt ;

    http://gigatron3k.free.fr/html5/C2/FX/stoolbox.rar

    Have fun

  • > justifun

    >

    > Just converted in lightspeed ... means 80 times restart C3.. clear cache, rename zip file to .c3addon ... errors somewhere and restart again ... + 3 beers ..

    > A Nightmare to converting something for C3.

    > So try this if it's same as the original ;

    > http://gigatron3k.free.fr/html5/C3/FX/atreshold.c3addon

    >

    > Regards

    > ...

    >

    >

    Gigatron

    Any general tips / guidance on converting over effects? What do you typically have to change in the *.fx file (I'm looking at the effect SDK and comparing some *.fx before and after, but would be interested if you have general tips. I agree with your comments on the other files, right now they are a bit of a pain to deal with.

    I'm trying to convert over NormalMapExtended

    Mikal

    Here is the variables used by C3 shaders but i my declaration is bit different...

    C3 ..
    uniform lowp sampler2D samplerFront;
    uniform mediump vec2 srcStart;  <-- new
    uniform mediump vec2 srcEnd;    <-- new
    uniform mediump vec2 srcOriginStart; <--- new
    uniform mediump vec2 srcOriginEnd;  <-- new
    uniform mediump vec2 layoutStart; <-- new
    uniform mediump vec2 layoutEnd;  <-- new
    uniform lowp sampler2D samplerBackground;
    uniform mediump vec2 destStart;
    uniform mediump vec2 destEnd;
    uniform mediump float seconds;
    uniform mediump vec2 pixelSize;    <-- new 
    uniform mediump float layerScale;
    uniform mediump float layerAngle;
    
    C3 gigatron shader header;
    
    #ifdef GL_ES
    precision mediump float; // or lowp or highp ... all variables are the same precision now !
    #endif
    
    uniform  sampler2D samplerFront;
    uniform vec2 srcStart;
    uniform vec2 srcEnd;
    uniform vec2 srcOriginStart;
    uniform vec2 srcOriginEnd;
    uniform vec2 layoutStart;
    uniform vec2 layoutEnd;
    uniform sampler2D samplerBackground;
    uniform vec2 destStart;
    uniform vec2 destEnd;
    uniform  float seconds;
    uniform vec2 pixelSize;
    uniform float layerScale;
    uniform  float layerAngle;
    vec3 color = vec3(1.,0.,0.); <---- new in C3
    
    void main(){
    
      -- no need precision declaration again in the main loop ;
      -- except gpu overload then we can adjust precision  
      -- like this -uniform  sampler2D samplerFront-  to uniform  lowp sampler2D samplerFront;
       //vec2 uv= vTex;
      
       gl_FragColor = vec4(color,1.0);
    
    }
    
    [/code:35ssi4oj]
    
    Finally no really change on fx file ... in case op special fx we must use some new variables.//
    Regards
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • justifun

    blackhornet and Gigatron - could you try converting alpha threshold effect please? the original author says he's too busy to get around to it these days

    Download link:

    https://my.pcloud.com/publink/show?code ... umljLEgdl7

    Thanks!

    Just converted in lightspeed ... means 80 times restart C3.. clear cache, rename zip file to .c3addon ... errors somewhere and restart again ... + 3 beers ..

    A Nightmare to converting something for C3.

    So try this if it's same as the original ;

    http://gigatron3k.free.fr/html5/C3/FX/atreshold.c3addon

    Regards

    PS: blackhornet

    The conversion is pretty simple .... the hell is the 2 other files especially the en-US.json , the best way is

    just integrate this file on addon.json .. finally we have effect.fx + addon.json ...

    here an example for what i would like ;

    {
    	"is-c3-addon": true,
    	"type": "effect",
    	"name": "AThreshold",
    	"id": "atr",
    	"version": "1.0.0.0",
    	"author": "Paulo Ricardo Reinehr",
    	"website": "https://www.construct.net",
    	"documentation": "https://www.construct.net",
    	"description": "Alpha values below the threshold are converted to transparent and above to opaque with a smoothness control. ",
    	"file-list": [
    		"lang/en-US.json",
    		"addon.json",
    		"effect.fx"
    	],
    	
    	"category": "color",
    	"blends-background": false,
    	"cross-sampling": false,
    	"preserves-opaqueness": true,
    	"animated": false,
    	"extend-box": {
    		"horizontal": 0,
    		"vertical": 0
    	},
    	
    	"parameters": [
    		{
    			"id": "Threshold",
    			"type": "percent",
    			"initial-value": 0.5,
                            "name": "Threshold",                                     
                            "decs" : " Description of the function ",            
    			"uniform": "threshold"
    		},
    		 
    	]
    }
    
    [/code:j7anmqi5]
  • vurzu

    There is no need Capx, i've just created a total new project, new sprite, seascape fx on the sprite, and that strange color...nothing more...

    Maybe layer color is white for you... change it to black ...

  • vurzu

    Thanks for reply. Yes, i know, i've changed both global and surface sea color in every possible variations...., but that strange cyan color brightness remains....in your demo that brightness is different, is white, and seems more real...

    Ok... send me your .capx example please ;

  • actioncancel

    Is that something I can find? Something someone can easily make?

    Something like this demo but for C3 ?

    You can play with sliders for different color component offset rgb;

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

  • vurzu

    Hi Gigatron, Fantastic FX !! by the way, I've noticed that the color of the brightness on the sea surface is always light blue/cyan, although i change all color parameters...and is different form the Demo you posted, where the color seems correct...maybe i'm doing something wrong...

    There are 2 colors.. one is global sea color and the other is water color is a bit change surface color.

    I think all is ok ...

  • matriax

    The zoom parameters cause this problem... i have an another version of this fx on my SSD;

    this one must work now with zoom to 1 or 2;

    precision highp float;
    uniform float textureSizeWidth; //width of the texture
    uniform float textureSizeHeight; //height of the texture
    uniform float texelSizeX; //width of one texel
    uniform float texelSizeY; //height of one texel
    uniform mediump float seconds;
    uniform mediump float pixelWidth;
    uniform mediump float pixelHeight;
    varying mediump vec2 vTex;
    uniform sampler2D samplerFront;
    vec2 iResolution = vec2( 1.0/pixelWidth, 1.0/pixelHeight);
    uniform float zoom;
    #define P(id,a,b,c,d,e,f,g,h) if( id == int(pos.y) ){ int pa = a+2*(b+2*(c+2*(d+2*(e+2*(f+2*(g+2*(h))))))); cha = floor(mod(float(pa)/pow(2.,float(pos.x)-1.),2.)); }
    
    void main()
    {
    		vec2 uv = -vec2(floor(gl_FragCoord.x/8./zoom)*8.*zoom,floor(gl_FragCoord.y/12./zoom)*12.*zoom)/iResolution;
    		ivec2 pos = ivec2(mod(gl_FragCoord.x/zoom,8.),mod(gl_FragCoord.y/zoom,12.));
    		vec4 tex = texture2D(samplerFront,vTex);
    		float cha = 0.;
    
    			float g = tex.r+tex.g+tex.b;
    
    			if( g < .125 )
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,0,0,0,0,0,0);
    			P(9,0,0,0,0,0,0,0,0);
    			P(8,0,0,0,0,0,0,0,0);
    			P(7,0,0,0,0,0,0,0,0);
    			P(6,0,0,0,0,0,0,0,0);
    			P(5,0,0,0,0,0,0,0,0);
    			P(4,0,0,0,0,0,0,0,0);
    			P(3,0,0,0,0,0,0,0,0);
    			P(2,0,0,0,0,0,0,0,0);
    			P(1,0,0,0,0,0,0,0,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
    			else if( g < .25 ) // .
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,0,0,0,0,0,0);
    			P(9,0,0,0,0,0,0,0,0);
    			P(8,0,0,0,0,0,0,0,0);
    			P(7,0,0,0,0,0,0,0,0);
    			P(6,0,0,0,0,0,0,0,0);
    			P(5,0,0,0,0,0,0,0,0);
    			P(4,0,0,0,1,1,0,0,0);
    			P(3,0,0,0,1,1,0,0,0);
    			P(2,0,0,0,0,0,0,0,0);
    			P(1,0,0,0,0,0,0,0,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
    			else if( g < .375 ) // ,
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,0,0,0,0,0,0);
    			P(9,0,0,0,0,0,0,0,0);
    			P(8,0,0,0,0,0,0,0,0);
    			P(7,0,0,0,0,0,0,0,0);
    			P(6,0,0,0,0,0,0,0,0);
    			P(5,0,0,0,0,0,0,0,0);
    			P(4,0,0,0,1,1,0,0,0);
    			P(3,0,0,0,1,1,0,0,0);
    			P(2,0,0,0,0,1,0,0,0);
    			P(1,0,0,0,1,0,0,0,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
    			else if( g < .5 ) // -
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,0,0,0,0,0,0);
    			P(9,0,0,0,0,0,0,0,0);
    			P(8,0,0,0,0,0,0,0,0);
    			P(7,0,0,0,0,0,0,0,0);
    			P(6,1,1,1,1,1,1,1,0);
    			P(5,0,0,0,0,0,0,0,0);
    			P(4,0,0,0,0,0,0,0,0);
    			P(3,0,0,0,0,0,0,0,0);
    			P(2,0,0,0,0,0,0,0,0);
    			P(1,0,0,0,0,0,0,0,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
    			else if(g < .625 ) // +
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,0,0,0,0,0,0);
    			P(9, 0,0,0,1,0,0,0,0);
    			P(8, 0,0,0,1,0,0,0,0);
    			P(7, 0,0,0,1,0,0,0,0);
    			P(6, 1,1,1,1,1,1,1,0);
    			P(5, 0,0,0,1,0,0,0,0);
    			P(4, 0,0,0,1,0,0,0,0);
    			P(3, 0,0,0,1,0,0,0,0);
    			P(2, 0,0,0,0,0,0,0,0);
    			P(1, 0,0,0,0,0,0,0,0);
    			P(0, 0,0,0,0,0,0,0,0);
    			}
    			else if(g < .75 ) // *
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,0,1,0,0,0,0);
    			P(9,1,0,0,1,0,0,1,0);
    			P(8,0,1,0,1,0,1,0,0);
    			P(7,0,0,1,1,1,0,0,0);
    			P(6,0,0,0,1,0,0,0,0);
    			P(5,0,0,1,1,1,0,0,0);
    			P(4,0,1,0,1,0,1,0,0);
    			P(3,1,0,0,1,0,0,1,0);
    			P(2,0,0,0,1,0,0,0,0);
    			P(1,0,0,0,0,0,0,0,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
    			else if(g < .875 ) // #
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,1,0,0,1,0,0);
    			P(9,0,0,1,0,0,1,0,0);
    			P(8,1,1,1,1,1,1,1,0);
    			P(7,0,0,1,0,0,1,0,0);
    			P(6,0,0,1,0,0,1,0,0);
    			P(5,0,1,0,0,1,0,0,0);
    			P(4,0,1,0,0,1,0,0,0);
    			P(3,1,1,1,1,1,1,1,0);
    			P(2,0,1,0,0,1,0,0,0);
    			P(1,0,1,0,0,1,0,0,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
    			else // @
    			{
    			P(11,0,0,0,0,0,0,0,0);
    			P(10,0,0,1,1,1,1,0,0);
    			P(9,0,1,0,0,0,0,1,0);
    			P(8,1,0,0,0,1,1,1,0);
    			P(7,1,0,0,1,0,0,1,0);
    			P(6,1,0,0,1,0,0,1,0);
    			P(5,1,0,0,1,0,0,1,0);
    			P(4,1,0,0,1,0,0,1,0);
    			P(3,1,0,0,1,1,1,1,0);
    			P(2,0,1,0,0,0,0,0,0);
    			P(1,0,0,1,1,1,1,1,0);
    			P(0,0,0,0,0,0,0,0,0);
    			}
        
    vec3 col = vec3(tex.xyz);
    gl_FragColor = vec4(cha*col,1.);
    }
    
    [/code:i1chtnow]
  • The shader code above use vertex shader , so we can not use vertex shader in C2 but just only Quad;

    in this case fragment shader is not help; however you can try to find similar in shadertoy.com

    and then i can try to convert to C2...

    Regards

  • Gigatron

    Thanks but it seams that importing a project from c2 to c3 didn't detects the plugin as installed. Maybe because of the name Out line instead of Outline?

    Yes , for now remove outline fx from your C2 project.

    Import your project to C3 and add outline fx for your sprites text etc ....

    [cid] is not clear yet ;

  • paala

    outline fx link ;

    total conversion time 45 min !!! it's too long;

    total C3 restart at least 20 times ; cause mistake on one of 3 files ... (i don't want build local server)

    Conclusion ... the best way is 1 file instead of 3 ... and C3 must parse this file in 3 part with xml like :

    <section> language</section>

    <section> addondescription</section>

    <section> effect</section>

    ....

Gigatron's avatar

Gigatron

Member since 8 Jan, 2012

Twitter
Gigatron has 33 followers

Connect with Gigatron

Trophy Case

  • 12-Year Club
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

16/44
How to earn trophies