Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-04-27 17:27:47 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-02 21:49:38 +0300
commit8c2a6f957ada6cca4b870c094979f9c3e6d43fa7 (patch)
treebfb4e9f8d5d13db5b13741fe0c112d94cc36de79 /source/blender/draw/CMakeLists.txt
parenta56561dcd28d5a8ee45948afb62cc7296c212a44 (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/CMakeLists.txt')
-rw-r--r--source/blender/draw/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index 27daab90234..3ab0ea40990 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -221,6 +221,9 @@ data_to_c_simple(modes/shaders/common_globals_lib.glsl SRC)
data_to_c_simple(modes/shaders/common_view_lib.glsl SRC)
data_to_c_simple(modes/shaders/common_fxaa_lib.glsl SRC)
data_to_c_simple(modes/shaders/common_fullscreen_vert.glsl SRC)
+data_to_c_simple(modes/shaders/armature_sphere_vert.glsl SRC)
+data_to_c_simple(modes/shaders/armature_sphere_frag.glsl SRC)
+data_to_c_simple(modes/shaders/armature_sphere_outline_vert.glsl SRC)
data_to_c_simple(modes/shaders/armature_shape_outline_vert.glsl SRC)
data_to_c_simple(modes/shaders/armature_shape_outline_geom.glsl SRC)
data_to_c_simple(modes/shaders/edit_mesh_overlay_frag.glsl SRC)