Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_coord.cc
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | static int node_shader_gpu_tex_coord(GPUMaterial *mat, | ||||
| GPUNodeLink *inv_obmat = (ob != nullptr) ? GPU_uniform(&ob->imat[0][0]) : | GPUNodeLink *inv_obmat = (ob != nullptr) ? GPU_uniform(&ob->imat[0][0]) : | ||||
| GPU_builtin(GPU_INVERSE_OBJECT_MATRIX); | GPU_builtin(GPU_INVERSE_OBJECT_MATRIX); | ||||
| /* Opti: don't request orco if not needed. */ | /* Opti: don't request orco if not needed. */ | ||||
| const float default_coords[4] = {0.0f, 0.0f, 0.0f, 0.0f}; | const float default_coords[4] = {0.0f, 0.0f, 0.0f, 0.0f}; | ||||
| GPUNodeLink *orco = (!out[0].hasoutput) ? GPU_constant(default_coords) : | GPUNodeLink *orco = (!out[0].hasoutput) ? GPU_constant(default_coords) : | ||||
| GPU_attribute(mat, CD_ORCO, ""); | GPU_attribute(mat, CD_ORCO, ""); | ||||
| GPUNodeLink *mtface = GPU_attribute(mat, CD_MTFACE, ""); | GPUNodeLink *mtface = GPU_attribute(mat, CD_AUTO_FROM_NAME, ""); | ||||
| GPUNodeLink *viewpos = GPU_builtin(GPU_VIEW_POSITION); | GPUNodeLink *viewpos = GPU_builtin(GPU_VIEW_POSITION); | ||||
| GPUNodeLink *worldnor = GPU_builtin(GPU_WORLD_NORMAL); | GPUNodeLink *worldnor = GPU_builtin(GPU_WORLD_NORMAL); | ||||
| GPUNodeLink *texcofacs = GPU_builtin(GPU_CAMERA_TEXCO_FACTORS); | GPUNodeLink *texcofacs = GPU_builtin(GPU_CAMERA_TEXCO_FACTORS); | ||||
| if (out[0].hasoutput) { | if (out[0].hasoutput) { | ||||
| GPU_link(mat, "generated_from_orco", orco, &orco); | GPU_link(mat, "generated_from_orco", orco, &orco); | ||||
| } | } | ||||
| Show All 40 Lines | |||||