1
0
Fork 0

Fix a few GLSL errors as reported by glslangValidator

This commit is contained in:
Erik Hofman 2016-06-29 11:53:05 +02:00
parent 9ce7c3c747
commit f705d0f908
4 changed files with 19 additions and 19 deletions

View file

@ -196,7 +196,7 @@ if ((domain_x < 0.1) || (domain_x > 0.9)) {shapeTexel.a = 0.0;}
domainTexel.rgb *= color_base.rgb; domainTexel.rgb *= color_base.rgb;
vec4 birdTexel; vec4 birdTexel;
birdTexel.rgb = domainTexel.rgb * light_diffuse; birdTexel.rgb = domainTexel.rgb * light_diffuse.rgb;
birdTexel.a = domainTexel.a * shapeTexel.a * transmission; birdTexel.a = domainTexel.a * shapeTexel.a * transmission;

View file

@ -1,4 +1,4 @@
#version 120 #version 150
#extension GL_EXT_geometry_shader4 : enable #extension GL_EXT_geometry_shader4 : enable
// Geometry shader that creates a prism from a terrain triangle, // Geometry shader that creates a prism from a terrain triangle,
@ -7,28 +7,28 @@
// A geometry shader should do as little computation as possible. // A geometry shader should do as little computation as possible.
// See landmass-g.vert for a description of the inputs. // See landmass-g.vert for a description of the inputs.
varying in vec4 rawposIn[3]; in vec4 rawposIn[3];
varying in vec3 NormalIn[3]; in vec3 NormalIn[3];
varying in vec4 ecPosIn[3]; in vec4 ecPosIn[3];
varying in vec3 ecNormalIn[3]; in vec3 ecNormalIn[3];
varying in vec3 VTangentIn[3]; in vec3 VTangentIn[3];
varying in vec3 VBinormalIn[3]; in vec3 VBinormalIn[3];
varying in vec4 constantColorIn[3]; in vec4 constantColorIn[3];
uniform float canopy_height; uniform float canopy_height;
// model position // model position
varying out vec4 rawpos; out vec4 rawpos;
// eye position // eye position
varying out vec4 ecPosition; out vec4 ecPosition;
// eye space surface matrix // eye space surface matrix
varying out vec3 VNormal; out vec3 VNormal;
varying out vec3 VTangent; out vec3 VTangent;
varying out vec3 VBinormal; out vec3 VBinormal;
// model normal // model normal
varying out vec3 Normal; out vec3 Normal;
varying out vec4 constantColor; out vec4 constantColor;
varying out float bump; out float bump;
// Emit one vertex of the forest geometry. // Emit one vertex of the forest geometry.
// parameters: // parameters:

View file

@ -37,6 +37,6 @@ void main() {
c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x ); c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x );
float l = length(c); float l = length(c);
float f = smoothstep( 0.7, 1.1, l ); float f = smoothstep( 0.7, 1.1, l );
color.rgb = (1 - f) * color.rgb; color.rgb = (1.0 - f) * color.rgb;
gl_FragColor = color; gl_FragColor = color;
} }

View file

@ -54,7 +54,7 @@ void main(void)
fragColor.rgb = mix(hazeColor, finalColor.rgb, fogFactor ); fragColor.rgb = mix(hazeColor, finalColor.rgb, fogFactor );
} }
else else
{fragColor.rgb = finalColor;} {fragColor.rgb = finalColor.rgb;}
fragColor.a = mix(0.0, finalColor.a, fogFactor); fragColor.a = mix(0.0, finalColor.a, fogFactor);
fragColor.rgb = filter_combined(fragColor.rgb); fragColor.rgb = filter_combined(fragColor.rgb);