diff options
author | Germano <germano.costa@ig.com.br> | 2018-05-03 15:11:02 +0300 |
---|---|---|
committer | Germano <germano.costa@ig.com.br> | 2018-05-03 15:11:02 +0300 |
commit | 1677ea89c7ad34c32a00eca44eeea705f49d9e25 (patch) | |
tree | 85beb352ed69fd0c3be086a77a2c4fd1d4a23aa7 /source/blender/gpu | |
parent | 9c78d9ba9f169005527ba77d1f758fd1d3ebeb42 (diff) |
Metaball: Move handles shader to draw/modes/shader and reference them in draw_common.c
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/gpu/GPU_shader.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 3 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl | 36 |
4 files changed, 0 insertions, 42 deletions
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 7634bd74978..481133ba984 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -181,7 +181,6 @@ data_to_c_simple(shaders/gpu_shader_instance_camera_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_instance_distance_line_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_geom.glsl SRC) data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_vert.glsl SRC) -data_to_c_simple(shaders/gpu_shader_instance_mball_handles_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_groundline_geom.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_groundpoint_vert.glsl SRC) diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index b395b320580..2a672873d86 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -185,8 +185,6 @@ typedef enum GPUBuiltinShader { GPU_SHADER_2D_NODELINK, GPU_SHADER_2D_NODELINK_INST, - GPU_SHADER_3D_INSTANCE_MBALL_HANDLES, - GPU_NUM_BUILTIN_SHADERS /* (not an actual shader) */ } GPUBuiltinShader; diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index 34b710b649e..02baa2e58cb 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -819,9 +819,6 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader) datatoc_gpu_shader_2D_nodelink_frag_glsl }, [GPU_SHADER_2D_NODELINK_INST] = { datatoc_gpu_shader_2D_nodelink_vert_glsl, datatoc_gpu_shader_2D_nodelink_frag_glsl }, - - [GPU_SHADER_3D_INSTANCE_MBALL_HANDLES] = { datatoc_gpu_shader_instance_mball_handles_vert_glsl, - datatoc_gpu_shader_flat_color_frag_glsl }, }; if (builtin_shaders[shader] == NULL) { diff --git a/source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl deleted file mode 100644 index 819199c26c7..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl +++ /dev/null @@ -1,36 +0,0 @@ - -/* This shader takes a 2D shape, puts it in 3D Object space such that is stays aligned with view, - * and scales the shape according to per-instance attributes - * Note that if the stiffness is zero, it assumes the scale is directly multiplied by the radius */ - - - #define M_PI_2 1.570796f // pi/2 - -uniform mat4 ViewProjectionMatrix; -uniform vec3 screen_vecs[2]; - -/* ---- Instanciated Attribs ---- */ -in vec2 pos; - -/* ---- Per instance Attribs ---- */ -in mat3x4 ScaleTranslationMatrix; -in float radius; -in vec3 color; - -flat out vec4 finalColor; - -void main() -{ - mat3 Scamat = mat3(ScaleTranslationMatrix); - vec4 world_pos = vec4( - ScaleTranslationMatrix[0][3], - ScaleTranslationMatrix[1][3], - ScaleTranslationMatrix[2][3], - 1.0); - - vec3 screen_pos = screen_vecs[0].xyz * pos.x + screen_vecs[1].xyz * pos.y; - world_pos.xyz += Scamat * (screen_pos * radius); - - gl_Position = ViewProjectionMatrix * world_pos; - finalColor = vec4(color, 1.0); -} |