tmpvar / threejs-experiments

3 stars 0 forks source link

hairbrained idea aka how to fix 2d draw rendering #45

Open tmpvar opened 10 years ago

tmpvar commented 10 years ago

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

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