Exemplo n.º 1
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;
}
Exemplo n.º 2
0
RenderLayerRule::RenderLayerRule(
    const char*         name,
    const ParamArray&   params)
  : Entity(g_class_uid, params)
  , impl(new Impl())
{
    set_name(name);

    const EntityDefMessageContext context("render layer rule", this);

    impl->m_render_layer = params.get_required<string>("render_layer", "", context);
    impl->m_order = params.get_required<int>("order", 0, context);

    const string entity_type = params.get_optional<string>("entity_type", "");

    if (entity_type == "")
        impl->m_entity_type_uid = UniqueID(~0);
    else if (entity_type == "assembly")
        impl->m_entity_type_uid = Assembly::get_class_uid();
    else if (entity_type == "assembly_instance")
        impl->m_entity_type_uid = AssemblyInstance::get_class_uid();
    else if (entity_type == "edf")
        impl->m_entity_type_uid = EDF::get_class_uid();
    else if (entity_type == "environment_edf")
        impl->m_entity_type_uid = EnvironmentEDF::get_class_uid();
    else if (entity_type == "environment_shader")
        impl->m_entity_type_uid = EnvironmentShader::get_class_uid();
    else if (entity_type == "light")
        impl->m_entity_type_uid = Light::get_class_uid();
    else if (entity_type == "material")
        impl->m_entity_type_uid = Material::get_class_uid();
    else if (entity_type == "object")
        impl->m_entity_type_uid = Object::get_class_uid();
    else if (entity_type == "object_instance")
        impl->m_entity_type_uid = ObjectInstance::get_class_uid();
    else if (entity_type == "surface_shader")
        impl->m_entity_type_uid = SurfaceShader::get_class_uid();
    else
    {
        RENDERER_LOG_ERROR(
            "%s: invalid value \"%s\" for parameter \"%s\", using default value \"\".",
            context.get(),
            entity_type.c_str(),
            "entity_type");
        impl->m_entity_type_uid = UniqueID(~0);
    }
}
Exemplo n.º 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;
}