当前位置: 首页>>代码示例>>C++>>正文


C++ ShadingPoint::get_region_index方法代码示例

本文整理汇总了C++中ShadingPoint::get_region_index方法的典型用法代码示例。如果您正苦于以下问题:C++ ShadingPoint::get_region_index方法的具体用法?C++ ShadingPoint::get_region_index怎么用?C++ ShadingPoint::get_region_index使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShadingPoint的用法示例。


在下文中一共展示了ShadingPoint::get_region_index方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: evaluate_pdf

double LightSampler::evaluate_pdf(const ShadingPoint& shading_point) const
{
    assert(shading_point.is_triangle_primitive());

    const EmittingTriangleKey triangle_key(
        shading_point.get_assembly_instance().get_uid(),
        shading_point.get_object_instance_index(),
        shading_point.get_region_index(),
        shading_point.get_primitive_index());

    const EmittingTriangle* triangle = m_emitting_triangle_hash_table.get(triangle_key);
    return triangle->m_triangle_prob * triangle->m_rcp_area;
}
开发者ID:docwhite,项目名称:appleseed,代码行数:13,代码来源:lightsampler.cpp

示例2: evaluate


//.........这里部分代码省略.........
      case AmbientOcclusion:
        {
            // Compute the occlusion.
            const double occlusion =
                compute_ambient_occlusion(
                    sampling_context,
                    sample_hemisphere_uniform<double>,
                    shading_context.get_intersector(),
                    shading_point,
                    m_ao_max_distance,
                    m_ao_samples);

            // Return a gray scale value proportional to the accessibility.
            const float accessibility = static_cast<float>(1.0 - occlusion);
            shading_result.set_main_to_linear_rgb(Color3f(accessibility));
        }
        break;

      case AssemblyInstances:
        shading_result.set_main_to_linear_rgb(
            integer_to_color(shading_point.get_assembly_instance().get_uid()));
        break;

      case ObjectInstances:
        shading_result.set_main_to_linear_rgb(
            integer_to_color(shading_point.get_object_instance().get_uid()));
        break;

      case Regions:
        {
            const uint32 h =
                mix_uint32(
                    static_cast<uint32>(shading_point.get_object_instance().get_uid()),
                    static_cast<uint32>(shading_point.get_region_index()));
            shading_result.set_main_to_linear_rgb(integer_to_color(h));
        }
        break;

      case Primitives:
        {
            const uint32 h =
                mix_uint32(
                    static_cast<uint32>(shading_point.get_object_instance().get_uid()),
                    static_cast<uint32>(shading_point.get_region_index()),
                    static_cast<uint32>(shading_point.get_primitive_index()));
            shading_result.set_main_to_linear_rgb(integer_to_color(h));
        }
        break;

      case Materials:
        {
            const Material* material = shading_point.get_material();
            if (material)
                shading_result.set_main_to_linear_rgb(integer_to_color(material->get_uid()));
            else shading_result.set_main_to_opaque_pink_linear_rgba();
        }
        break;

      case RaySpread:
        {
            const ShadingRay& ray = shading_point.get_ray();
            if (!ray.m_has_differentials)
                break;

            const Material* material = shading_point.get_material();
            if (material)
开发者ID:johnhaddon,项目名称:appleseed,代码行数:67,代码来源:diagnosticsurfaceshader.cpp


注:本文中的ShadingPoint::get_region_index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。