Beispiel #1
0
bool Scene::on_frame_begin(
    const Project&          project, 
#ifdef WITH_OSL
    OSL::ShadingSystem*     shading_system,
#endif            
    AbortSwitch*            abort_switch)
{
    bool success = true;

    if (impl->m_camera.get())
        success = success && impl->m_camera->on_frame_begin(project, abort_switch);

    success = success && invoke_on_frame_begin(project, texture_instances(), abort_switch);
    success = success && invoke_on_frame_begin(project, environment_edfs(), abort_switch);
    success = success && invoke_on_frame_begin(project, environment_shaders(), abort_switch);

    if (is_aborted(abort_switch))
        return success;

    if (impl->m_environment.get())
        success = success && impl->m_environment->on_frame_begin(project, abort_switch);

#ifdef WITH_OSL
    success = success && invoke_on_frame_begin(project, assemblies(), shading_system, abort_switch);
#else
    success = success && invoke_on_frame_begin(project, assemblies(), abort_switch);
#endif

    success = success && invoke_on_frame_begin(project, assembly_instances(), abort_switch);

    return success;
}
Beispiel #2
0
void Scene::on_frame_end(const Project& project)
{
    invoke_on_frame_end(project, assemblies());
    invoke_on_frame_end(project, environment_shaders());
    invoke_on_frame_end(project, environment_edfs());

    impl->m_camera->on_frame_end(project);
}
Beispiel #3
0
void Scene::update_asset_paths(const StringDictionary& mappings)
{
    BaseGroup::update_asset_paths(mappings);

    do_update_asset_paths(mappings, cameras());

    if (impl->m_environment.get())
        impl->m_environment->update_asset_paths(mappings);

    do_update_asset_paths(mappings, environment_edfs());
    do_update_asset_paths(mappings, environment_shaders());
}
Beispiel #4
0
void Scene::collect_asset_paths(StringArray& paths) const
{
    BaseGroup::collect_asset_paths(paths);

    do_collect_asset_paths(paths, cameras());

    if (impl->m_environment.get())
        impl->m_environment->collect_asset_paths(paths);

    do_collect_asset_paths(paths, environment_edfs());
    do_collect_asset_paths(paths, environment_shaders());
}
Beispiel #5
0
void Scene::on_frame_end(const Project& project)
{
    invoke_on_frame_end(project, assembly_instances());
    invoke_on_frame_end(project, assemblies());

    if (impl->m_environment.get())
        impl->m_environment->on_frame_end(project);

    invoke_on_frame_end(project, environment_shaders());
    invoke_on_frame_end(project, environment_edfs());
    invoke_on_frame_end(project, texture_instances());

    if (impl->m_camera.get())
        impl->m_camera->on_frame_end(project);
}
Beispiel #6
0
bool Scene::on_frame_begin(
    const Project&          project,
    IAbortSwitch*           abort_switch)
{
    bool success = true;

    if (impl->m_camera.get())
        success = success && impl->m_camera->on_frame_begin(project, abort_switch);

    success = success && invoke_on_frame_begin(project, textures(), abort_switch);
    success = success && invoke_on_frame_begin(project, texture_instances(), abort_switch);
    success = success && invoke_on_frame_begin(project, environment_edfs(), abort_switch);
    success = success && invoke_on_frame_begin(project, environment_shaders(), abort_switch);

    if (!is_aborted(abort_switch) && impl->m_environment.get())
        success = success && impl->m_environment->on_frame_begin(project, abort_switch);

    success = success && invoke_on_frame_begin(project, assemblies(), abort_switch);
    success = success && invoke_on_frame_begin(project, assembly_instances(), abort_switch);

    return success;
}
Beispiel #7
0
bool Scene::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_camera = project.get_uncached_active_camera();

    // Fail if we don't have a camera.
    if (m_camera == 0)
    {
        RENDERER_LOG_ERROR("no cameras in scene or no camera specified in the frame entity.");
        return false;
    }

    bool success = true;

    success = success && impl->m_default_surface_shader->on_frame_begin(project, this, recorder, abort_switch);

    success = success && invoke_on_frame_begin(project, this, colors(), recorder, abort_switch);
    success = success && invoke_on_frame_begin(project, this, textures(), recorder, abort_switch);
    success = success && invoke_on_frame_begin(project, this, texture_instances(), recorder, abort_switch);
    success = success && invoke_on_frame_begin(project, this, shader_groups(), recorder, abort_switch);

    success = success && invoke_on_frame_begin(project, this, cameras(), recorder, abort_switch);
    success = success && invoke_on_frame_begin(project, this, environment_edfs(), recorder, abort_switch);
    success = success && invoke_on_frame_begin(project, this, environment_shaders(), recorder, abort_switch);

    if (!is_aborted(abort_switch) && impl->m_environment.get())
        success = success && impl->m_environment->on_frame_begin(project, this, recorder, abort_switch);

    success = success && invoke_on_frame_begin(project, this, assemblies(), recorder, abort_switch);
    success = success && invoke_on_frame_begin(project, this, assembly_instances(), recorder, abort_switch);

    return success;
}