Geeks3D Forums

GeeXLab => GeeXLab - english forum => Topic started by: Stefan on January 08, 2016, 06:18:25 PM

Title: River Styx - fixed
Post by: Stefan on January 08, 2016, 06:18:25 PM
Original Shadertoy demo (https://www.shadertoy.com/view/XstGWn)

Ported to GeeXLab (https://goo.gl/jGKImW)

At first compiler complained: Pixel shader error: C0000: syntax error, unexpected '=', expecting ',' or ';' at token "="

// Home in on the surface by dividing by two and split...
(mapDE(rO + halfwayT*rD) < 0.) ? t.x = halfwayT:t.y = halfwayT;

Fixed by replacing questionmark and colon with commas.
Is there any info about purpose of questionmark and colon?



With Intel renderer i got blank screen. Fixed by removing "inout" from:
// Neat huh? Not mine though...
vec2 rot2D(inout vec2 p, float a)

Judging from a Google search many coders have trouble with inout



Last but least i shortened main function to
Code: [Select]
uniform vec3      iResolution;     
uniform float     iGlobalTime;     
uniform vec4      iMouse;
// etc.

/* replace this line with original Shadertoy code - don't edit mainImage, fragColor and fragCoord */

void main(){mainImage(gl_FragColor,gl_FragCoord.xy);}


(https://farm2.staticflickr.com/1635/24171377651_e6a1fbb939_o.png)