Created
July 18, 2014 21:04
-
-
Save g-pechorin/d98945f74d78a968c330 to your computer and use it in GitHub Desktop.
Apologies for the machine-speek. I'm using NVidia's CGC compiler to do error checks, and she insists that there are errors related to array size
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
ESPhysicObject.frag.glsl r = 1 | |
ESPhysicObject.frag.glsl $ | |
ESPhysicObject.frag.glsl ! (0) : error C1307: non constant expression for array size | |
ESPhysicObject.frag.glsl ! (0) : error C1307: non constant expression for array size | |
ESPhysicObject.frag.glsl ! 61 lines, 2 errors. | |
ESPhysicObject.vert.glsl r = 1 | |
ESPhysicObject.vert.glsl $ | |
ESPhysicObject.vert.glsl ! (0) : error C1307: non constant expression for array size | |
ESPhysicObject.vert.glsl ! (0) : error C1307: non constant expression for array size | |
ESPhysicObject.vert.glsl ! 45 lines, 2 errors. |
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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
// varying | |
varying vec2 v_va_TextureCoordinates; | |
varying vec3 v_va_Normals; | |
// uniforms (not-textures) | |
uniform mat4 u_projection; | |
uniform mat4 u_view; | |
uniform mat4 u_model; | |
#ifdef GLES2 | |
precision highp float; | |
#endif | |
// uniforms (just textures) | |
uniform sampler2D u_texture; | |
uniform vec3 y_texture; | |
// main | |
void main(void) | |
{ | |
// compute the fragment color | |
ivec2 ssa0 = ivec2(1, 1); | |
vec2 ssa1 = v_va_TextureCoordinates + vec2(ssa0); | |
vec2 ssa2 = ssa1 * 0.5; | |
ivec2 ssa3 = ivec2(floor(ssa2)); | |
vec2 ssa4 = ssa2 - vec2(ssa3); | |
vec2 ssa5 = ssa4 * float(2); | |
vec2 ssa6 = ssa5 + vec2(ssa0); | |
vec2 ssa7 = abs(ssa6); | |
vec4 ssa8 = texture2D(u_texture, (ssa7 * y_texture.z) + y_texture.xy); | |
ivec4 ssa9 = ivec4(0, -1, 0, 0); | |
vec4 ssa10 = vec4(v_va_Normals, 0.0); | |
vec4 ssa11 = u_model * ssa10; | |
float ssa12 = dot(vec4(ssa9), ssa11); | |
float ssa13 = max(float(0), ssa12); | |
float ssa14 = ssa13 * ssa13; | |
float ssa15 = float(1) - ssa14; | |
vec4 ssa16 = ssa8 * ssa15; | |
ivec4 ssa17 = ivec4(1, 1, 0, 1); | |
float ssa18 = dot(vec4(ssa17), ssa8); | |
vec4 ssa19 = ssa8 * ssa18; | |
vec4 ssa20 = ssa19 * ssa13; | |
vec4 ssa21 = ssa16 + ssa20;// | |
gl_FragColor = ssa21; | |
} |
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
// varying | |
varying vec2 v_va_TextureCoordinates; | |
varying vec3 v_va_Normals; | |
// uniforms (not-textures) | |
uniform mat4 u_projection; | |
uniform mat4 u_view; | |
uniform mat4 u_model; | |
// attributes | |
attribute vec3 Positions; | |
attribute vec3 Normals; | |
attribute vec3 Tangents; | |
attribute vec3 BiTangents; | |
attribute vec2 TextureCoordinates; | |
// main | |
void main(void) | |
{ | |
// compute varying // | |
v_va_TextureCoordinates = TextureCoordinates; | |
// | |
v_va_Normals = Normals; | |
// compute the vertex position | |
mat4 ssa0 = u_projection * u_view; | |
mat4 ssa1 = ssa0 * u_model; | |
vec4 ssa2 = vec4(Positions, 1.0); | |
vec4 ssa3 = ssa1 * ssa2;// | |
gl_Position = ssa3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment