This commit is contained in:
Tleety
2016-03-07 23:25:06 +01:00
parent 7de95d4cb5
commit 5c0d9070c7
11 changed files with 421 additions and 5 deletions
+1
View File
@@ -5,4 +5,5 @@
<Color R="1" G="1" B="1" A="1"/>
<Visible>true</Visible>
<DepthSort>true</DepthSort>
<BlurBackground>false</BlurBackground>
</Sprite>
+3
View File
@@ -24,6 +24,9 @@
<xs:element name="DepthSort" type="t:bool" minOccurs="0">
<xs:annotation><xs:documentation>Whether the sprite should be sorted with depth or not. Only use false for textures that are on HUD</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="BlurBackground" type="t:bool" minOccurs="0">
<xs:annotation><xs:documentation>Wether the background should be blurred begind this sprite.</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
@@ -0,0 +1,25 @@
#version 430
uniform sampler2D Texture0;
uniform sampler2D Texture1;
in VertexData{
vec2 TextureCoordinate;
}Input;
out vec4 fragmentColor;
void main()
{
vec4 texel0 = texture(Texture0, Input.TextureCoordinate);
vec4 texel1 = texture(Texture1, Input.TextureCoordinate);
float texel1_total = (texel1.r + texel1.g + texel1.b) * texel1.a;
texel1_total = ceil(clamp(texel1_total, 0, 1));
vec4 final = texel0 * texel1_total + texel1 * (1 - texel1_total);
//vec4 final = vec4(texel1_total, texel1_total, texel1_total, 1.0);
fragmentColor = final;
}
@@ -0,0 +1,13 @@
#version 430
layout (location = 0) in vec3 Position;
out VertexData{
vec2 TextureCoordinate;
}Output;
void main()
{
gl_Position = vec4(Position, 1.0);
Output.TextureCoordinate = (vec2(Position) + 1) / 2;
}