mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
rendering classes refactoring
This commit is contained in:
+8
-9
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user