Init
This commit is contained in:
19
assets/shaders/circleFragment.glsl
Normal file
19
assets/shaders/circleFragment.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
varying vec2 val;
|
||||
|
||||
void main() {
|
||||
float radius = 1.0f;
|
||||
float radius2 = 0.5f;
|
||||
float smoothing = 0.005f;
|
||||
float dist = sqrt(dot(val,val));
|
||||
|
||||
if (dist > radius || dist < radius2) {
|
||||
discard;
|
||||
}
|
||||
float sm = smoothstep(radius, radius - smoothing, dist);
|
||||
float sm2 = smoothstep(radius2, radius2 + smoothing, dist);
|
||||
float alpha = sm * sm2;
|
||||
FragColor = vec4(1.0, 0.0, 0.0, alpha);
|
||||
}
|
||||
Reference in New Issue
Block a user