本文整理汇总了C++中ShadingPoint::get_osl_shader_globals方法的典型用法代码示例。如果您正苦于以下问题:C++ ShadingPoint::get_osl_shader_globals方法的具体用法?C++ ShadingPoint::get_osl_shader_globals怎么用?C++ ShadingPoint::get_osl_shader_globals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShadingPoint
的用法示例。
在下文中一共展示了ShadingPoint::get_osl_shader_globals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute_transparency
void OSLShaderGroupExec::execute_transparency(
const ShaderGroup& shader_group,
const ShadingPoint& shading_point,
Alpha& alpha) const
{
do_execute(
shader_group,
shading_point,
VisibilityFlags::TransparencyRay);
process_transparency_tree(shading_point.get_osl_shader_globals().Ci, alpha);
}
示例2: execute_shading
void OSLShaderGroupExec::execute_shading(
const ShaderGroup& shader_group,
const ShadingPoint& shading_point) const
{
assert(m_osl_shading_context);
assert(m_osl_thread_info);
m_osl_shading_system.execute(
*m_osl_shading_context,
*shader_group.shadergroup_ref(),
shading_point.get_osl_shader_globals());
}
示例3: execute_transparency
void OSLShaderGroupExec::execute_transparency(
const ShaderGroup& shader_group,
const ShadingPoint& shading_point,
Alpha& alpha,
float* holdout) const
{
// Switch temporary the ray type to Shadow.
ShadingRay::TypeType saved_type = shading_point.m_ray.m_type;
shading_point.m_ray.m_type = ShadingRay::ShadowRay;
m_osl_shading_system.execute(
*m_osl_shading_context,
*shader_group.shadergroup_ref(),
shading_point.get_osl_shader_globals());
process_transparency_tree(shading_point.get_osl_shader_globals().Ci, alpha);
if (holdout)
*holdout = process_holdout_tree(shading_point.get_osl_shader_globals().Ci);
// Restore the original ray type.
shading_point.m_ray.m_type = saved_type;
}
示例4: choose_bsdf_closure_shading_basis
void OSLShaderGroupExec::choose_bsdf_closure_shading_basis(
const ShadingPoint& shading_point,
const Vector2f& s) const
{
CompositeSurfaceClosure c(
Basis3f(shading_point.get_shading_basis()),
shading_point.get_osl_shader_globals().Ci,
m_arena);
float pdfs[CompositeSurfaceClosure::MaxClosureEntries];
const size_t num_closures = c.compute_pdfs(ScatteringMode::All, pdfs);
if (num_closures == 0)
return;
const size_t index = c.choose_closure(s[1], num_closures, pdfs);
shading_point.set_shading_basis(
Basis3d(c.get_closure_shading_basis(index)));
}
示例5: do_execute
void OSLShaderGroupExec::do_execute(
const ShaderGroup& shader_group,
const ShadingPoint& shading_point,
const VisibilityFlags::Type ray_flags) const
{
assert(m_osl_shading_context);
assert(m_osl_thread_info);
shading_point.initialize_osl_shader_globals(
shader_group,
ray_flags,
m_osl_shading_system.renderer());
m_osl_shading_system.execute(
m_osl_shading_context,
*reinterpret_cast<OSL::ShaderGroup*>(shader_group.osl_shader_group()),
shading_point.get_osl_shader_globals());
}
示例6: execute_bump
void OSLShaderGroupExec::execute_bump(
const ShaderGroup& shader_group,
const ShadingPoint& shading_point,
const Vector2f& s) const
{
// Choose between BSSRDF and BSDF.
if (shader_group.has_subsurface() && s[0] < 0.5f)
{
do_execute(
shader_group,
shading_point,
VisibilityFlags::SubsurfaceRay);
CompositeSubsurfaceClosure c(
Basis3f(shading_point.get_shading_basis()),
shading_point.get_osl_shader_globals().Ci,
m_arena);
// Pick a shading basis from one of the BSSRDF closures.
if (c.get_closure_count() > 0)
{
const size_t index = c.choose_closure(s[1]);
shading_point.set_shading_basis(
Basis3d(c.get_closure_shading_basis(index)));
}
}
else
{
do_execute(
shader_group,
shading_point,
VisibilityFlags::CameraRay);
choose_bsdf_closure_shading_basis(shading_point, s);
}
}