mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
spread fix
start and end size merge
This commit is contained in:
+9
-1
@@ -9,12 +9,19 @@ const int numParticles = 1;
|
||||
layout (location = 0) out vec4 FragColor;
|
||||
layout (location = 1) out vec4 BrightColor;
|
||||
|
||||
uniform sampler2D tex;
|
||||
struct Texture{
|
||||
float mixRatio;
|
||||
sampler2D pastTexture, nextTexture;
|
||||
bool animated;
|
||||
};
|
||||
|
||||
uniform Texture tex;
|
||||
uniform float lifePercentage[500];
|
||||
uniform vec4 startColor, endColor;
|
||||
|
||||
void main(){
|
||||
float alpha = texture(tex.pastTexture, texCoords).r;
|
||||
|
||||
if(tex.animated)
|
||||
alpha = mix(alpha, texture(tex.nextTexture, texCoords).r, tex.mixRatio);
|
||||
|
||||
@@ -22,6 +29,7 @@ void main(){
|
||||
FragColor = c;
|
||||
|
||||
float brightness = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
|
||||
if(brightness > 1)
|
||||
BrightColor = vec4(c.rgb, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user