Rendering the draw canvas to the draw plane will work for the immediate future, but longer term it will fall down. The main issue with it now, is the fact that it looks horrible. No amount of scaling/AA is going to fix that it seems. And the worst thing is that down the road, when we start resizing the canvas to provide a bigger drawing surface at a desired resolution, we'll run into max texture size issues.
Alternatives:
3d primitives
The idea here is that vec2's and other geometry coming from draw would be converted to 3d and in the scene coplanar to the draw plane.
This is not without issues or obvious performance problems though. For instance, drawing a circle would require a circle.computeGeometry() call which would then need to be translated into 3d. Changes to the circle would need to go through a similar flow.
There is also the question of manipulating the polygons/circles/etc via the 3d counterparts.
draw maintains a list of objects that represent the current drawing draw.renderables
when rendering, we generate the appropriate supporting geometry and vertex attributes
"extrude" geometry in vertex shader
render arcs/lines/circles/etc in the fragment shader
This approach is certainly more difficult, but the applications are further reaching than this project. It might be hard to keep the fragment shader performant
Rendering the draw canvas to the draw plane will work for the immediate future, but longer term it will fall down. The main issue with it now, is the fact that it looks horrible. No amount of scaling/AA is going to fix that it seems. And the worst thing is that down the road, when we start resizing the canvas to provide a bigger drawing surface at a desired resolution, we'll run into max texture size issues.
Alternatives:
3d primitives
The idea here is that
vec2
's and other geometry coming from draw would be converted to 3d and in the scene coplanar to the draw plane.This is not without issues or obvious performance problems though. For instance, drawing a circle would require a
circle.computeGeometry()
call which would then need to be translated into 3d. Changes to the circle would need to go through a similar flow.There is also the question of manipulating the polygons/circles/etc via the 3d counterparts.
Maybe a combination of these approaches:
shader driven
This idea is not fully formed
draw.renderables
This approach is certainly more difficult, but the applications are further reaching than this project. It might be hard to keep the fragment shader performant
Something like this: https://www.shadertoy.com/view/XsB3z3