forked from blender/blender
MaterialX: Implement export of Input nodes #20
@ -26,6 +26,20 @@ static int gpu_shader_camera(GPUMaterial *mat,
|
||||
return GPU_stack_link(mat, node, "camera", in, out);
|
||||
}
|
||||
|
||||
NODE_SHADER_MATERIALX_BEGIN
|
||||
{
|
||||
/* TODO: This node doesn't have an implementation in MaterialX 1.38.6.*/
|
||||
NodeItem res = val(MaterialX::Vector3(1.0f, 1.0f, 1.0f));
|
||||
if (STREQ(socket_out_->name, "View Z Depth")) {
|
||||
res = res.extract(2);
|
||||
}
|
||||
if (STREQ(socket_out_->name, "View Distance")) {
|
||||
res = res.extract(2);
|
||||
}
|
||||
return res;
|
||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
||||
}
|
||||
NODE_SHADER_MATERIALX_END
|
||||
|
||||
} // namespace blender::nodes::node_shader_camera_cc
|
||||
|
||||
void register_node_type_sh_camera()
|
||||
@ -37,6 +51,7 @@ void register_node_type_sh_camera()
|
||||
sh_node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT);
|
||||
ntype.declare = file_ns::node_declare;
|
||||
ntype.gpu_fn = file_ns::gpu_shader_camera;
|
||||
ntype.materialx_fn = file_ns::node_shader_materialx;
|
||||
|
||||
nodeRegisterType(&ntype);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user
start from
empty()
, useelse if