diff options
Diffstat (limited to 'resources')
-rw-r--r-- | resources/shaders/anchorPoint.vert | 1 | ||||
-rwxr-xr-x | resources/shaders/shader.frag | 8 | ||||
-rwxr-xr-x | resources/shaders/shader.vert | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/resources/shaders/anchorPoint.vert b/resources/shaders/anchorPoint.vert index c074d00..784dbfb 100644 --- a/resources/shaders/anchorPoint.vert +++ b/resources/shaders/anchorPoint.vert @@ -3,6 +3,7 @@ layout(location = 0) in vec3 position; // Position of the vertex layout(location = 2) in vec3 vcolor; // Normal of the vertex + uniform mat4 proj; uniform mat4 view; uniform mat4 model; diff --git a/resources/shaders/shader.frag b/resources/shaders/shader.frag index 141915e..fc78890 100755 --- a/resources/shaders/shader.frag +++ b/resources/shaders/shader.frag @@ -9,6 +9,9 @@ in vec3 refrPos; in float refrProb; in vec2 uv; +uniform sampler2D texture_img; + + uniform int wire = 0; uniform float red = 1.0; uniform float green = 1.0; @@ -56,4 +59,9 @@ void main() { // Dividing refrProb by 2 just for heuristic. Want more phong to show through. // fragColor = clamp(fragColor, 0.f, 1.f); // fragColor = vec4(refrProb, 0.f, 0.f, 1.f); + + + // assign texture + fragColor = texture(texture_img, uv); + } diff --git a/resources/shaders/shader.vert b/resources/shaders/shader.vert index 8dda424..8447dd9 100755 --- a/resources/shaders/shader.vert +++ b/resources/shaders/shader.vert @@ -2,6 +2,8 @@ layout(location = 0) in vec3 position; // Position of the vertex layout(location = 1) in vec3 normal; // Normal of the vertex +layout(location = 3) in vec3 texCoords; // Normal of the vertex + uniform mat4 proj; uniform mat4 view; @@ -65,7 +67,7 @@ void main() { vec3 groundContactPoint = -(normal * depthScale) + position; // carries down to ground groundContactPoint = vec3(model * vec4(position, 1)); uv = vec2((position.x + 81.f) / (162.f), groundContactPoint.z); -// uv = vec2(normal); + uv = vec2(texCoords); vec4 refrPos_and_prob = getRefrPos(); refrPos = vec3(refrPos_and_prob); refrProb = clamp(refrPos_and_prob.w, 0.f, 1.f); |