diff options
-rw-r--r-- | source/blender/gpu/shaders/material/gpu_shader_material_texture_coordinates.glsl | 5 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_environment.cc | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_texture_coordinates.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_texture_coordinates.glsl index 204f134dfa6..c849553ae4c 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_texture_coordinates.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_texture_coordinates.glsl @@ -1,4 +1,9 @@ +void node_tex_coord_position(out vec3 out_pos) +{ + out_pos = g_data.P; +} + void node_tex_coord(mat4 obmatinv, vec3 attr_orco, vec4 attr_uv, diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc b/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc index df5fbac3ab5..2739a75ed21 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc @@ -50,7 +50,11 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, return GPU_stack_link(mat, node, "node_tex_environment_empty", in, out); } - node_shader_gpu_default_tex_coord(mat, node, &in[0].link); + if (!in[0].link) { + GPU_link(mat, "node_tex_coord_position", &in[0].link); + node_shader_gpu_bump_tex_coord(mat, node, &in[0].link); + } + node_shader_gpu_tex_mapping(mat, node, in, out); /* Compute texture coordinate. */ |