Created
September 6, 2015 18:52
-
-
Save jdavidberger/46cdba6580165fb6dacc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spec.FragmentColor = function(builtIns) { | |
var xy = this.varyings.texCoord; | |
var xyz = [xy[0], xy[1], xy[0] * xy[1]]; | |
var tx = mat4.create(); | |
var xyz2 = vec3.create(); | |
xyz2 = vec3.transformMat4(xyz2, xyz, tx); | |
return vec3.transformMat4(vec3.create(), xyz, tx); | |
} | |
---- | |
varying vec2 varyings_texCoord; | |
vec3 vec3_transformMat4(vec3 t, mat4 m){ | |
return (m * vec4(t[0], t[1], t[2], 1)).xyz; | |
} | |
vec3 vec3_transformMat4(inout vec3 out_param, vec3 t, mat4 m){ | |
return out_param = (m * vec4(t[0], t[1], t[2], 1)).xyz; | |
} | |
vec3 FragmentColor(){ | |
vec2 xy = varyings_texCoord; | |
vec3 xyz = vec3(xy[0], xy[1], (xy[0] * xy[1])); | |
mat4 tx = mat4(1); | |
vec3 xyz2 = vec3(0); | |
xyz2 = vec3_transformMat4(xyz2, xyz, tx); | |
return vec3_transformMat4(xyz, tx); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment