gam0022 / resimulated

1st place at Revision 2020 (PC 64K Intro)
MIT License
18 stars 1 forks source link

glsl-minifierでES3.0が使えない問題 #3

Closed gam0022 closed 4 years ago

gam0022 commented 4 years ago
#version 300 es
#ifdef GL_ES
precision highp float;
precision highp int;
precision mediump sampler3D;
#endif
#define HW_PERFORMANCE 1
uniform vec3      iResolution;
uniform float     iTime;
uniform float     iChannelTime[4];
uniform vec4      iMouse;
uniform vec4      iDate;
uniform float     iSampleRate;
uniform vec3      iChannelResolution[4];
uniform int       iFrame;
uniform float     iTimeDelta;
uniform float     iFrameRate;
struct Channel
{
    vec3  resolution;
    float time;
};
uniform Channel iChannel[4];
uniform sampler2D iChannel0;
uniform sampler2D iChannel1;
uniform sampler2D iChannel2;
uniform sampler2D iChannel3;
void mainImage( out vec4 c,  in vec2 f );

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    // Normalized pixel coordinates (from 0 to 1)
    vec2 uv = fragCoord/iResolution.xy;

    // Time varying pixel color
    vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));

    // Output to screen
    fragColor = vec4(col,1.0);
}

out vec4 outColor;
void main( void ){vec4 color = vec4(0.0,0.0,0.0,1.0);mainImage( color, gl_FragCoord.xy );color.w = 1.0;outColor = color;}

out vec4 outColor; があるとダメな予感がする…

 ~/Dropbox/TDF2020/webpack-tdf2020  glsl-minifier  ('-') 0  node ./node_modules/glsl-minifier/bin/glsl-minifier.js -i src/fragment.glsl -o dist/fragment.min.frag
/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-minifier/lib/optimizer/glsl-optimizer-asm.js:10
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolv

Error: parameter is not allowed here at line 7
    at unexpected (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/lib/index.js:661:11)
    at parameter_or_not (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/lib/index.js:415:18)
    at /Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/lib/index.js:701:16
    at parse_decl (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/lib/index.js:379:6)
    at write (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/lib/index.js:190:18)
    at reader (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/lib/index.js:166:5)
    at DestroyableTransform.write [as _transform] (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/stream.js:16:17)
    at DestroyableTransform.Transform._read (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/Users/gam0022/Dropbox/TDF2020/webpack-tdf2020/node_modules/glsl-parser/node_modules/readable-stream/lib/_stream_writable.js:237:10)