opengl.geometry.colored_textured: Use texturing shader snippet.
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
#version 140
|
||||
// Include 'version.header'.
|
||||
// Include 'texturing-frag.snippet'.
|
||||
|
||||
uniform sampler2D sTexture;
|
||||
in vec3 frag_Site;
|
||||
in vec4 frag_Color;
|
||||
in vec2 frag_Coords;
|
||||
|
||||
varying vec4 vColor;
|
||||
varying vec2 vCoords;
|
||||
out vec4 final_Color;
|
||||
|
||||
|
||||
void main()
|
||||
void
|
||||
main()
|
||||
{
|
||||
gl_FragColor = mix (texture2D (sTexture, vCoords),
|
||||
vColor,
|
||||
0.5);
|
||||
}
|
||||
vec4 surface_Color = mix (apply_Texturing (frag_Coords),
|
||||
frag_Color,
|
||||
0.5);
|
||||
|
||||
vec3 Gamma = vec3 (1.0 / 2.2);
|
||||
final_Color = vec4
|
||||
(pow
|
||||
(surface_Color.rgb, // Final color (after gamma correction).
|
||||
Gamma),
|
||||
surface_Color.a);
|
||||
}
|
||||
@@ -3,17 +3,17 @@
|
||||
uniform mat4 mvp_Transform;
|
||||
uniform vec3 Scale;
|
||||
|
||||
attribute vec3 Site;
|
||||
attribute vec4 Color;
|
||||
attribute vec2 Coords;
|
||||
in vec3 Site;
|
||||
in vec4 Color;
|
||||
in vec2 Coords;
|
||||
|
||||
varying vec4 vColor;
|
||||
varying vec2 vCoords;
|
||||
out vec4 frag_Color;
|
||||
out vec2 frag_Coords;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp_Transform * vec4 (Site * Scale, 1.0);
|
||||
vColor = Color;
|
||||
vCoords = Coords;
|
||||
frag_Color = Color;
|
||||
frag_Coords = Coords;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,9 @@ is
|
||||
white_Texture := openGL.Texture.Forge.to_Texture (white_Image);
|
||||
|
||||
vertex_Shader .define (Shader.Vertex, "assets/opengl/shader/colored_textured.vert");
|
||||
fragment_Shader.define (Shader.Fragment, "assets/opengl/shader/colored_textured.frag");
|
||||
fragment_Shader.define (Shader.Fragment, (asset_Names' (1 => to_Asset ("assets/opengl/shader/version.header"),
|
||||
2 => to_Asset ("assets/opengl/shader/texturing-frag.snippet"),
|
||||
3 => to_Asset ("assets/opengl/shader/colored_textured.frag"))));
|
||||
|
||||
the_Program := new openGL.Program.item;
|
||||
the_Program.define (vertex_Shader 'Access,
|
||||
|
||||
Reference in New Issue
Block a user