From 62ea911e1a22d2a717c225ea1bbd130ac5c367bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 1 May 2017 18:09:50 +0200 Subject: GPUMaterial: Making material node tree compatible with new drawmanager. - code_generate_fragment : Making sure that shaders uses the new uniforms. - code_generate_vertex_new : create require attribute based on their names and not their id (see draw_cache_impl_mesh.c). - add support for ramp textures. --- source/blender/nodes/shader/nodes/node_shader_tex_coord.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c index be393582a42..23571e24501 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c @@ -48,14 +48,14 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *UNUSED(node), bNod GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ""); GPUMatType type = GPU_Material_get_type(mat); - if (type == GPU_MATERIAL_TYPE_MESH) { - return GPU_stack_link(mat, "node_tex_coord", in, out, + if (type == GPU_MATERIAL_TYPE_WORLD) { + return GPU_stack_link(mat, "node_tex_coord_background", in, out, GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); } else { - return GPU_stack_link(mat, "node_tex_coord_background", in, out, + return GPU_stack_link(mat, "node_tex_coord", in, out, GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); -- cgit v1.2.3