Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_environment.cc
| Context not available. | |||||
| BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); | BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); | ||||
| BKE_texture_colormapping_default(&tex->base.color_mapping); | BKE_texture_colormapping_default(&tex->base.color_mapping); | ||||
| tex->projection = SHD_PROJ_EQUIRECTANGULAR; | tex->projection = SHD_PROJ_EQUIRECTANGULAR; | ||||
| tex->cubemap_layout = SHD_CUBE_CROSS_HORIZONTAL; | |||||
| BKE_imageuser_default(&tex->iuser); | BKE_imageuser_default(&tex->iuser); | ||||
| node->storage = tex; | node->storage = tex; | ||||
| Context not available. | |||||
| * This is to fix the artifact caused by derivatives discontinuity. */ | * This is to fix the artifact caused by derivatives discontinuity. */ | ||||
| sampler &= ~(GPU_SAMPLER_MIPMAP | GPU_SAMPLER_ANISO); | sampler &= ~(GPU_SAMPLER_MIPMAP | GPU_SAMPLER_ANISO); | ||||
| } | } | ||||
| else { | else if (tex->projection == SHD_PROJ_MIRROR_BALL) { | ||||
| GPU_link(mat, "node_tex_environment_mirror_ball", in[0].link, &in[0].link); | GPU_link(mat, "node_tex_environment_mirror_ball", in[0].link, &in[0].link); | ||||
| /* Fix pole issue. */ | /* Fix pole issue. */ | ||||
| sampler &= ~GPU_SAMPLER_REPEAT; | sampler &= ~GPU_SAMPLER_REPEAT; | ||||
| } | } | ||||
| else { | |||||
| if (tex->cubemap_layout == SHD_CUBE_CROSS_HORIZONTAL) { | |||||
| /* An unfolded cube in a cross layout (aka net) will have correct tiling | |||||
| * of its faces when repeatedly placed in a horizontal and vertical fashion. | |||||
| * This is useful to minimize artifacts along the seams of the bordering faces. */ | |||||
| sampler &= GPU_SAMPLER_REPEAT; | |||||
| GPU_link(mat, "node_tex_environment_cubemap_cross_horizontal", in[0].link, &in[0].link); | |||||
| } | |||||
| else if (tex->cubemap_layout == SHD_CUBE_STRIPE_HORIZONTAL) { | |||||
| /* To help with seam issues caused by interpolation coordinates are clamped to the border. */ | |||||
| sampler &= GPU_SAMPLER_CLAMP_BORDER; | |||||
| GPU_link(mat, "node_tex_environment_cubemap_stripe_horizontal", in[0].link, &in[0].link); | |||||
| } | |||||
| else { | |||||
| sampler &= GPU_SAMPLER_CLAMP_BORDER; | |||||
| GPU_link(mat, "node_tex_environment_cubemap_stripe_vertical", in[0].link, &in[0].link); | |||||
| } | |||||
| } | |||||
| const char *gpu_fn; | const char *gpu_fn; | ||||
| static const char *names[] = { | static const char *names[] = { | ||||
| Context not available. | |||||