From f705d0f9086692a41415833a248659319151899a Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Wed, 29 Jun 2016 11:53:05 +0200 Subject: [PATCH] Fix a few GLSL errors as reported by glslangValidator --- Shaders/birds-ALS.frag | 2 +- Shaders/landmass.geom | 32 ++++++++++++++++---------------- Shaders/night-vision.frag | 2 +- Shaders/rain-layer-ALS.frag | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Shaders/birds-ALS.frag b/Shaders/birds-ALS.frag index 0e0f43d21..8e1778f3c 100644 --- a/Shaders/birds-ALS.frag +++ b/Shaders/birds-ALS.frag @@ -196,7 +196,7 @@ if ((domain_x < 0.1) || (domain_x > 0.9)) {shapeTexel.a = 0.0;} domainTexel.rgb *= color_base.rgb; vec4 birdTexel; -birdTexel.rgb = domainTexel.rgb * light_diffuse; +birdTexel.rgb = domainTexel.rgb * light_diffuse.rgb; birdTexel.a = domainTexel.a * shapeTexel.a * transmission; diff --git a/Shaders/landmass.geom b/Shaders/landmass.geom index 673496592..41f15b253 100644 --- a/Shaders/landmass.geom +++ b/Shaders/landmass.geom @@ -1,4 +1,4 @@ -#version 120 +#version 150 #extension GL_EXT_geometry_shader4 : enable // Geometry shader that creates a prism from a terrain triangle, @@ -7,28 +7,28 @@ // A geometry shader should do as little computation as possible. // See landmass-g.vert for a description of the inputs. -varying in vec4 rawposIn[3]; -varying in vec3 NormalIn[3]; -varying in vec4 ecPosIn[3]; -varying in vec3 ecNormalIn[3]; -varying in vec3 VTangentIn[3]; -varying in vec3 VBinormalIn[3]; -varying in vec4 constantColorIn[3]; +in vec4 rawposIn[3]; +in vec3 NormalIn[3]; +in vec4 ecPosIn[3]; +in vec3 ecNormalIn[3]; +in vec3 VTangentIn[3]; +in vec3 VBinormalIn[3]; +in vec4 constantColorIn[3]; uniform float canopy_height; // model position -varying out vec4 rawpos; +out vec4 rawpos; // eye position -varying out vec4 ecPosition; +out vec4 ecPosition; // eye space surface matrix -varying out vec3 VNormal; -varying out vec3 VTangent; -varying out vec3 VBinormal; +out vec3 VNormal; +out vec3 VTangent; +out vec3 VBinormal; // model normal -varying out vec3 Normal; -varying out vec4 constantColor; -varying out float bump; +out vec3 Normal; +out vec4 constantColor; +out float bump; // Emit one vertex of the forest geometry. // parameters: diff --git a/Shaders/night-vision.frag b/Shaders/night-vision.frag index 86488b0d6..168faa2e1 100644 --- a/Shaders/night-vision.frag +++ b/Shaders/night-vision.frag @@ -37,6 +37,6 @@ void main() { c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x ); float l = length(c); float f = smoothstep( 0.7, 1.1, l ); - color.rgb = (1 - f) * color.rgb; + color.rgb = (1.0 - f) * color.rgb; gl_FragColor = color; } diff --git a/Shaders/rain-layer-ALS.frag b/Shaders/rain-layer-ALS.frag index 1b8c7198c..f42451b65 100644 --- a/Shaders/rain-layer-ALS.frag +++ b/Shaders/rain-layer-ALS.frag @@ -54,7 +54,7 @@ void main(void) fragColor.rgb = mix(hazeColor, finalColor.rgb, fogFactor ); } else - {fragColor.rgb = finalColor;} + {fragColor.rgb = finalColor.rgb;} fragColor.a = mix(0.0, finalColor.a, fogFactor); fragColor.rgb = filter_combined(fragColor.rgb);