Aeva / m.grl

Midnight Graphics & Recreation Library
http://mgrl.midnightsisters.org
GNU Lesser General Public License v3.0
44 stars 3 forks source link

On Chromeos (ARM Chromebook), "simple.vert" and "picking.frag" failed to build #219

Closed mldulaney closed 8 years ago

mldulaney commented 8 years ago

js console:

mgrl.js:3104 ----- semicompiled shader ---------------- 1 | #ifdef GL_FRAGMENT_PRECISION_HIGH 2 | precision highp float; 3 | #else 4 | precision mediump float; 5 | #endif 9 | // Generated and hoisted function prototypes follow: 10 | void main(); 11 | uniform mat4 view_matrix; 12 | uniform mat4 world_matrix; 13 | uniform mat4 particle_matrix; 14 | uniform mat4 projection_matrix; 15 | attribute vec3 position; 16 | attribute vec3 normal; 17 | attribute vec2 tcoords; 18 | uniform float mgrl_orthographic_scale; 19 | uniform float billboard_mode; 20 | varying vec3 local_position; 21 | varying vec3 local_normal; 22 | varying vec2 local_tcoords; 23 | varying vec3 world_position; 24 | varying vec3 world_normal; 25 | varying vec3 screen_normal; 26 | varying float linear_depth; 27 | // matrices 28 | // vertex data 29 | // misc adjustments 30 | // billboard sprites enabler 31 | // interpolated vertex data in various transformations 32 | void main() { 33 | // pass along to the fragment shader 34 | local_position=position_mgrl_orthographic_scale;local_normal=normal;local_tcoords=tcoords;// calculate modelview matrix 35 | mat4 model_view=view_matrix_world_matrix;if(billboard_mode > 0.0) { 36 | // clear out rotation information 37 | model_view[0].xyz=world_matrix[0].xyz;model_view[2].xyz=world_matrix[2].xyz;if(billboard_mode == 2.0) { 38 | model_view[1].xyz=world_matrix[1].xyz; 39 | } 40 | } 41 | // various coordinate transforms 42 | vec4 final_position=projection_matrix_model_view_vec4(local_position, 1.0);world_position=(world_matrix * vec4 (local_position, 1.0)).xyz;world_normal=normalize(mat3 (world_matrix) * normal).xyz;screen_normal=normalize(mat3 (projection_matrix * model_view) * normal).xyz;linear_depth=length(model_view * vec4 (local_position, 1.0));gl_Position=final_position; 43 | }Shader compilation error for: simple.vert 0:1: S0029: main() has been overloaded glsl.__on_error @ mgrl.js:3104 mgrl.js:3105 WebSocket connection to 'ws://sleepermud.net:2067/' failed: Error during WebSocket handshake: Incorrect 'Sec-WebSocket-Accept' header valueglsl.on_error @ mgrl.js:3105 mgrl.js:3104 ----- semicompiled shader ---------------- 1 | #ifdef GL_FRAGMENT_PRECISION_HIGH 2 | precision highp float; 3 | #else 4 | precision mediump float; 5 | #endif 9 | // Generated and hoisted function prototypes follow: 10 | void main(); 11 | varying vec3 local_position; 12 | uniform vec3 object_index; 13 | uniform bool mgrl_select_mode; 14 | uniform vec3 mgrl_model_local_min; 15 | uniform vec3 mgrl_model_local_size; 16 | void main() { 17 | if(mgrl_select_mode) { 18 | gl_FragColor=vec4(object_index, 1.0); 19 | } 20 | else { 21 | vec3 shifted=local_position-mgrl_model_local_min;vec3 scaled=shifted/mgrl_model_local_size;gl_FragColor=vec4(scaled, 1.0); 22 | } 23 | ; 24 | }Shader compilation error for: picking.frag 0:1: S0029: main() has been overloaded glsl.on_error @ mgrl.js:3104 mgrl.js:3337 Uncaught Error: Shader could not be activated..?

0:1: S0029: main() has been overloaded

0:1: S0029: main() has been overloaded

Aeva commented 8 years ago

ah, interesting :) 'main' cannot be hoisted. I betcha this is also related to #211