Draw a rotating cube: Difference between revisions

Content added Content deleted
(J: apparently some implementations of glsl disallow empty statements (which were specified as legal in the language spec I read))
m (J: revert to prettier syntax)
Line 1,285: Line 1,285:
}}
}}


FSRC=: 0 : 0
FSRC=: {{)n
#version $version
#version $version
$f_in $lowp vec4 v_color;
$f_in $lowp vec4 v_color;
Line 1,292: Line 1,292:
$gl_fragColor= v_color;
$gl_fragColor= v_color;
}
}
}}
)


fixversion=: monad define
fixversion=: {{
NB. cope with host shader language version
NB. cope with host shader language version
r=. '$version';GLSL,&":;(GLSL>:300)#(*GLES_VERSION){' core';' es'
r=. '$version';GLSL,&":;(GLSL>:300)#(*GLES_VERSION){' core';' es'
Line 1,306: Line 1,306:
r=.r, '$gl_fragColor';f2{'gl_fragColor';'fragColor'
r=.r, '$gl_fragColor';f2{'gl_fragColor';'fragColor'
r=.r, '$fragColor';f2#'out vec4 fragColor;'
r=.r, '$fragColor';f2#'out vec4 fragColor;'
}}
)


rot_timer=: {{
rot_timer=: {{