rendering classes refactoring

This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent 217061e67b
commit 8f49bd1125
25 changed files with 1028 additions and 951 deletions
+8 -9
View File
@@ -4,20 +4,19 @@ in vec2 texCoords;
flat in int id;
layout (location=0) out vec4 FragColor;
layout (location=1) out vec4 BrightColor;
layout (location = 0) out vec4 FragColor;
layout (location = 1) out vec4 BrightColor;
uniform sampler2D tex;
uniform float lifePercentage[500];
uniform vec4 startColor,endColor;
//uniform vec4 color[500];
void main(){
float alpha=texture(tex,texCoords).r;
vec4 c=startColor+(endColor-startColor)*lifePercentage[id];
c=vec4(c.x,c.y,c.z,alpha);
float alpha = texture(tex, texCoords).r;
vec4 c = startColor + (endColor - startColor) * lifePercentage[id];
c = vec4(c.x, c.y, c.z, alpha);
float brightness = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));
if(brightness>1)
BrightColor=vec4(c.rgb,1);
FragColor=c;
if(brightness > 1)
BrightColor = vec4(c.rgb, 1);
FragColor = c;
}