Example #1
0
Tracer::Tracer(
    const Scene&                scene,
    const Intersector&          intersector,
    TextureCache&               texture_cache,
#ifdef WITH_OSL
    OSLShaderGroupExec*         shadergroup_exec,
#endif
    const float                 transparency_threshold,
    const size_t                max_iterations,
    const bool                  print_details)
  : m_intersector(intersector)
  , m_texture_cache(texture_cache)
#ifdef WITH_OSL
  , m_shadergroup_exec(shadergroup_exec)
#endif
  , m_assume_no_alpha_mapping(!uses_alpha_mapping(scene))
  , m_transmission_threshold(static_cast<double>(transparency_threshold))
  , m_max_iterations(max_iterations)
{
    if (print_details)
    {
        if (m_assume_no_alpha_mapping)
            RENDERER_LOG_DEBUG("the scene does not rely on alpha mapping; using probe tracing.");
        else RENDERER_LOG_DEBUG("the scene uses alpha mapping; using standard tracing.");
    }
}
Example #2
0
bool ObjectInstance::on_frame_begin(
    const Project&          project,
    const BaseGroup*        parent,
    OnFrameBeginRecorder&   recorder,
    IAbortSwitch*           abort_switch)
{
    if (!Entity::on_frame_begin(project, parent, recorder, abort_switch))
        return false;

    m_transform_swaps_handedness = get_transform().swaps_handedness();

    const EntityDefMessageContext context("object instance", this);

    if (uses_alpha_mapping())
    {
        if (m_front_materials != m_back_materials)
        {
            RENDERER_LOG_WARNING(
                "%s: object instance uses alpha mapping on one side (or both) but materials are different on front and back faces; "
                "this may lead to unexpected or unphysical results since the direction of shadow rays is unpredictable.",
                context.get());
        }
    }

    return true;
}
Example #3
0
bool ObjectInstance::on_frame_begin(
    const Project&          project,
    const Assembly&         assembly,
    IAbortSwitch*           abort_switch)
{
    const EntityDefMessageContext context("object instance", this);

    if (uses_alpha_mapping())
    {
        if (m_front_materials != m_back_materials)
        {
            RENDERER_LOG_WARNING(
                "%s: object instance uses alpha mapping on one side (or both) but materials are different on front and back faces; "
                "this may lead to unexpected or unphysical results since the direction of shadow rays is unpredictable.",
                context.get());
        }
    }

    return true;
}