future-iron-61487
03/23/2023, 4:44 AMdamp-artist-60225
03/23/2023, 6:33 PMambitious-knife-25690
03/23/2023, 6:45 PMfuture-iron-61487
03/24/2023, 12:42 AMhallowed-ocean-84954
03/24/2023, 4:44 AMfinal fs_string = '#pragma header
uniform float uWidth;
uniform float uHeight;
uniform float uPixelWidth;
uniform float uPixelHeight;
void main() {
vec2 st = openfl_TextureCoordv.xy; // Note, already normalized
float x = floor(floor(openfl_TextureCoordv.x * uWidth / uPixelWidth) * uPixelWidth) / uWidth;
float y = floor(floor(openfl_TextureCoordv.y * uHeight / uPixelHeight) * uPixelHeight) / uHeight;
// Output the color
// gl_FragColor = flixel_texture2D(bitmap, vec2(x, y));
gl_FragColor = vec4(grayscale(bitmap, vec2(x, y)), 1.0);
}
';
@:glFragmentSource(fs_string)
throws
haxe\std/haxe/macro/ExprTools.hx:286: characters 12-17 : Uncaught exception Unsupported expression: {pos: #pos(parasol/shaders/GrayscalePixelationShader.hx:65: characters 24-33), expr: EConst(CIdent(fs_string))}
.../openfl/9,1,0/src/openfl/utils/_internal/ShaderMacro.hx:37: characters 26-51 : Called from here
when just including the literal string it builds ok ?hallowed-ocean-84954
03/24/2023, 4:45 AMable-action-74275
03/24/2023, 8:18 AMhallowed-ocean-84954
03/24/2023, 1:10 PMhallowed-ocean-84954
03/24/2023, 1:12 PMable-action-74275
03/24/2023, 1:13 PMable-action-74275
03/24/2023, 1:14 PMglFragmentSource
at run time in my shader constructor before calling super()
hallowed-ocean-84954
03/24/2023, 1:15 PMhallowed-ocean-84954
03/24/2023, 1:15 PMable-action-74275
03/24/2023, 1:16 PMhallowed-ocean-84954
03/24/2023, 1:16 PMable-action-74275
03/24/2023, 1:18 PM//!voidmainImage
with the injected sourceable-action-74275
03/24/2023, 1:19 PMable-action-74275
03/24/2023, 1:19 PMhallowed-ocean-84954
03/24/2023, 1:20 PMhallowed-ocean-84954
03/24/2023, 1:22 PMable-action-74275
03/24/2023, 1:23 PMable-action-74275
03/24/2023, 1:25 PMsrc/openfl/utils/_internal/ShaderMacro.hx
hallowed-ocean-84954
03/24/2023, 1:25 PMable-action-74275
03/24/2023, 1:26 PMhallowed-ocean-84954
03/24/2023, 1:26 PMhallowed-ocean-84954
03/24/2023, 1:26 PMhallowed-ocean-84954
03/24/2023, 1:28 PMable-action-74275
03/24/2023, 1:30 PMable-action-74275
03/24/2023, 1:30 PM