Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_environment.cc
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | static int node_shader_gpu_tex_environment(GPUMaterial *mat, | ||||
| GPUNodeLink *outalpha; | GPUNodeLink *outalpha; | ||||
| /* HACK(@fclem): For lookdev mode: do not compile an empty environment and just create an empty | /* HACK(@fclem): For lookdev mode: do not compile an empty environment and just create an empty | ||||
| * texture entry point. We manually bind to it after #DRW_shgroup_add_material_resources(). */ | * texture entry point. We manually bind to it after #DRW_shgroup_add_material_resources(). */ | ||||
| if (!ima && !GPU_material_flag_get(mat, GPU_MATFLAG_LOOKDEV_HACK)) { | if (!ima && !GPU_material_flag_get(mat, GPU_MATFLAG_LOOKDEV_HACK)) { | ||||
| return GPU_stack_link(mat, node, "node_tex_environment_empty", in, out); | 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); | node_shader_gpu_tex_mapping(mat, node, in, out); | ||||
| /* Compute texture coordinate. */ | /* Compute texture coordinate. */ | ||||
| if (tex->projection == SHD_PROJ_EQUIRECTANGULAR) { | if (tex->projection == SHD_PROJ_EQUIRECTANGULAR) { | ||||
| GPU_link(mat, "node_tex_environment_equirectangular", in[0].link, &in[0].link); | GPU_link(mat, "node_tex_environment_equirectangular", in[0].link, &in[0].link); | ||||
| /* To fix pole issue we clamp the v coordinate. */ | /* To fix pole issue we clamp the v coordinate. */ | ||||
| sampler &= ~GPU_SAMPLER_REPEAT_T; | sampler &= ~GPU_SAMPLER_REPEAT_T; | ||||
| /* Force the highest mipmap and don't do anisotropic filtering. | /* Force the highest mipmap and don't do anisotropic filtering. | ||||
| ▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines | |||||