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
24
app-proto/src/point.vert
Normal file
24
app-proto/src/point.vert
Normal file
|
@ -0,0 +1,24 @@
|
|||
#version 300 es
|
||||
|
||||
in vec4 position;
|
||||
in vec3 color;
|
||||
in float highlight;
|
||||
in float selected;
|
||||
|
||||
out vec3 point_color;
|
||||
out float point_highlight;
|
||||
out float total_radius;
|
||||
|
||||
// camera
|
||||
const float focal_slope = 0.3;
|
||||
|
||||
void main() {
|
||||
total_radius = 5. + 0.5*selected;
|
||||
|
||||
float depth = -focal_slope * position.z;
|
||||
gl_Position = vec4(position.xy / depth, 0., 1.);
|
||||
gl_PointSize = 2.*total_radius;
|
||||
|
||||
point_color = color;
|
||||
point_highlight = highlight;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue