// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "Engine/Scripting/ScriptingObject.h" class GPUContext; class GPUTexture; class GPUTextureView; struct RenderContext; class RenderTask; class SceneRenderTask; class MaterialBase; class Actor; /// /// High-level rendering service. /// API_CLASS(Static) class FLAXENGINE_API Renderer { DECLARE_SCRIPTING_TYPE_NO_SPAWN(Renderer); public: /// /// Determines whether the scene rendering system is ready (all shaders are loaded and helper resources are ready). /// static bool IsReady(); /// /// Performs rendering for the input task. /// /// The scene rendering task. API_FUNCTION() static void Render(SceneRenderTask* task); /// /// Draws scene objects depth (to the output Z buffer). The output must be depth texture to write hardware depth to it. /// /// The GPU commands context to use. /// Render task to use it's view description and the render buffers. /// The output texture. Must be valid and created. /// The custom set of actors to render. If empty, the loaded scenes will be rendered. API_FUNCTION() static void DrawSceneDepth(GPUContext* context, SceneRenderTask* task, GPUTexture* output, const Array& customActors); /// /// Draws postFx material to the render target. /// /// The GPU commands context to use. /// The rendering context. /// The material to render. It must be a post fx material. /// The output texture. Must be valid and created. /// The input texture. It's optional. API_FUNCTION() static void DrawPostFxMaterial(GPUContext* context, API_PARAM(Ref) const RenderContext& renderContext, MaterialBase* material, GPUTexture* output, GPUTextureView* input); /// /// Invoked drawing of the scene objects (collects draw calls into RenderList for a given RenderContext). /// /// The rendering context. /// The custom set of actors to render. If empty, the loaded scenes will be rendered. API_FUNCTION() static void DrawActors(API_PARAM(Ref) RenderContext& renderContext, API_PARAM(DefaultValue=null) const Array& customActors); };