kovasb / gamma

glsl shaders made simple
Eclipse Public License 1.0
306 stars 20 forks source link

Uncaught Error: Invalid literal: :fail #5

Closed sgrove closed 9 years ago

sgrove commented 9 years ago
(def vertex-position (g/attribute "aVertexPosition" :vec3))
(def u-p-matrix (g/uniform "uPMatrix" :mat4))
(def u-mv-matrix (g/uniform "uMVMatrix" :mat4))
(def vtx-time        (g/uniform "u_Time" :vec2))

(def vertex-shader
  {(g/gl-position) (-> (g/* u-p-matrix u-mv-matrix)
                       (g/* (g/vec4 vertex-position 1))
                       (g/+ (g/vec4 (g/sin (g/swizzle vtx-time :x)) 0 0 0)))})

Errors somewhere in gamma.ast: Uncaught Error: Invalid literal: :fail

Trying to produce the output:

uniform mat4 uPMatrix;
uniform mat4 uMVMatrix;
attribute vec3 aVertexPosition;
uniform vec2 u_Time;
void main(void){

(gl_Position = (((uPMatrix * uMVMatrix) * vec4(aVertexPosition, 1)) + vec4(
  (sin u_Time.x),
  0,
  0,
  0)));
}
kovasb commented 9 years ago

Fixed as of https://github.com/kovasb/gamma/commit/b6f6c1da92a35f689cb79367d5d1f710017b0b09 . Need to spend time writing tests..

sgrove commented 9 years ago

Just trying to provide test case!