forked from StudioInfinity/dyna3
feat: Points (#82)
Replaces the former sole Element entity by two, Sphere and Point, both implementing an Element trait. Adds Point display, uses the former Element display for Sphere. Adds a new "canned" configuration, and the ability to add, select, and nudge Point entities. Co-authored-by: Aaron Fenyes <aaron.fenyes@fareycircles.ooo> Reviewed-on: StudioInfinity/dyna3#82 Co-authored-by: Vectornaut <vectornaut@nobody@nowhere.net> Co-committed-by: Vectornaut <vectornaut@nobody@nowhere.net>
This commit is contained in:
parent
360ce12d8b
commit
a2478febc1
9 changed files with 815 additions and 330 deletions
18
app-proto/src/point.frag
Normal file
18
app-proto/src/point.frag
Normal file
|
@ -0,0 +1,18 @@
|
|||
#version 300 es
|
||||
|
||||
precision highp float;
|
||||
|
||||
in vec3 point_color;
|
||||
in float point_highlight;
|
||||
in float total_radius;
|
||||
|
||||
out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
float r = total_radius * length(2.*gl_PointCoord - vec2(1.));
|
||||
|
||||
const float POINT_RADIUS = 4.;
|
||||
float border = smoothstep(POINT_RADIUS - 1., POINT_RADIUS, r);
|
||||
vec3 color = mix(point_color, vec3(1.), border * point_highlight);
|
||||
outColor = vec4(color, 1. - smoothstep(total_radius - 1., total_radius, r));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue