opengl.assets.shader: Add 'version.header' and 'texturing.frag' shader snippets.
This commit is contained in:
21
3-mid/opengl/assets/shader/texturing.frag
Normal file
21
3-mid/opengl/assets/shader/texturing.frag
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
uniform int texture_Count;
|
||||||
|
uniform sampler2D Textures [32];
|
||||||
|
uniform float Fade [32];
|
||||||
|
|
||||||
|
vec4
|
||||||
|
apply_Texturing (vec2 Coords)
|
||||||
|
{
|
||||||
|
vec4 Color = vec4 (0);
|
||||||
|
|
||||||
|
for (int i = 0; i < texture_Count; ++i)
|
||||||
|
{
|
||||||
|
Color.rgb += texture (Textures [i], Coords).rgb
|
||||||
|
* texture (Textures [i], Coords).a
|
||||||
|
* (1.0 - Fade [i]);
|
||||||
|
|
||||||
|
Color.a = max (Color.a, texture (Textures [i],
|
||||||
|
Coords).a);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Color;
|
||||||
|
}
|
||||||
1
3-mid/opengl/assets/shader/version.header
Normal file
1
3-mid/opengl/assets/shader/version.header
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#version 140
|
||||||
Reference in New Issue
Block a user