Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_coord.cc
| Show All 38 Lines | static int node_shader_gpu_tex_coord(GPUMaterial *mat, | ||||
| float dummy_matrix[4][4]; | float dummy_matrix[4][4]; | ||||
| dummy_matrix[3][3] = 0.0f; | dummy_matrix[3][3] = 0.0f; | ||||
| GPUNodeLink *inv_obmat = (ob != NULL) ? GPU_uniform(&ob->imat[0][0]) : | GPUNodeLink *inv_obmat = (ob != NULL) ? GPU_uniform(&ob->imat[0][0]) : | ||||
| GPU_uniform(&dummy_matrix[0][0]); | GPU_uniform(&dummy_matrix[0][0]); | ||||
| /* Opti: don't request orco if not needed. */ | /* Opti: don't request orco if not needed. */ | ||||
| float4 zero(0.0f); | float4 zero(0.0f); | ||||
| GPUNodeLink *orco = (!out[0].hasoutput) ? GPU_constant(zero) : GPU_attribute(mat, CD_ORCO, ""); | GPUNodeLink *orco = (!out[0].hasoutput) ? GPU_constant(zero) : GPU_attribute(mat, CD_ORCO, ""); | ||||
| GPUNodeLink *mtface = GPU_attribute(mat, CD_MTFACE, ""); | GPUNodeLink *mtface = GPU_attribute(mat, CD_AUTO_FROM_NAME, ""); | ||||
| GPU_stack_link(mat, node, "node_tex_coord", in, out, inv_obmat, orco, mtface); | GPU_stack_link(mat, node, "node_tex_coord", in, out, inv_obmat, orco, mtface); | ||||
| int i; | int i; | ||||
| LISTBASE_FOREACH_INDEX (bNodeSocket *, sock, &node->outputs, i) { | LISTBASE_FOREACH_INDEX (bNodeSocket *, sock, &node->outputs, i) { | ||||
| node_shader_gpu_bump_tex_coord(mat, node, &out[i].link); | node_shader_gpu_bump_tex_coord(mat, node, &out[i].link); | ||||
| /* Normalize some vectors after dFdx/dFdy offsets. | /* Normalize some vectors after dFdx/dFdy offsets. | ||||
| * This is the case for interpolated, non linear functions. | * This is the case for interpolated, non linear functions. | ||||
| Show All 33 Lines | |||||