diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-27 17:27:47 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-02 21:49:38 +0300 |
commit | 8c2a6f957ada6cca4b870c094979f9c3e6d43fa7 (patch) | |
tree | bfb4e9f8d5d13db5b13741fe0c112d94cc36de79 /source/blender/draw/intern/draw_common.h | |
parent | a56561dcd28d5a8ee45948afb62cc7296c212a44 (diff) |
Armature: "Raytrace" bones endpoint spheres.
Here is how it works:
We render a high poly disc that we orient & scale towards the camera so that
it covers the same pixel of the sphere it's supposed to represent.
Then the pixel shader raytrace the sphere (effectively starting from
the poly disc depth) and outputs the depth to gl_FragDepth.
This approach has many benefit:
- high quality obviously: per pixel accurate depth!
- compatible with MSAA: since the sphere horizon is delimited by polygons,
we get the coverage computed by the rasterizer. However we still gets
aliasing if the sphere intersect directly other meshes.
- virtually no overdraw: there is no backface to shade but we still get
overdraw because by little triangle [gpus rasterize pixel by groups of 4].
- allows early depth test: since the poly disc is set at the nearest depth
we can output, we can use GL_ARB_conservative_depth to enable early depth
test and discard pixels that are already behind geometry.
- can draw outline pretty easily without geometry shader.
Diffstat (limited to 'source/blender/draw/intern/draw_common.h')
-rw-r--r-- | source/blender/draw/intern/draw_common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 8b418135342..ad6ab2d89fd 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -122,6 +122,8 @@ struct DRWShadingGroup *shgroup_instance_bone_envelope_wire(struct DRWPass *pass struct DRWShadingGroup *shgroup_instance_bone_envelope_solid(struct DRWPass *pass, struct Gwn_Batch *geom); struct DRWShadingGroup *shgroup_instance_mball_handles(struct DRWPass *pass, struct Gwn_Batch *geom); struct DRWShadingGroup *shgroup_instance_armature_shape_outline(struct DRWPass *pass, struct Gwn_Batch *geom); +struct DRWShadingGroup *shgroup_instance_armature_sphere(struct DRWPass *pass); +struct DRWShadingGroup *shgroup_instance_armature_sphere_outline(struct DRWPass *pass); int DRW_object_wire_theme_get( struct Object *ob, struct ViewLayer *view_layer, float **r_color); |