Wildvine Engine
Referencia Doxygen del codigo propio de Wildvine Engine.
Cargando...
Buscando...
Nada coincide
ForwardRenderer.h
Ir a la documentación de este archivo.
1
6#pragma once
7#include "Prerequisites.h"
8#include "Buffer.h"
9#include "DepthStencilState.h"
10#include "DepthStencilView.h"
11#include "RasterizerState.h"
14#include "ShaderProgram.h"
15#include "Texture.h"
17
18class Device;
19class DeviceContext;
20class Camera;
21class Material;
22
30class
32public:
36 HRESULT init(Device& device);
37
41 void resize(Device& device, unsigned int width, unsigned int height);
42
46 void updatePerFrame(const Camera& camera, const RenderScene& scene, DeviceContext& deviceContext);
47
51 void render(DeviceContext& deviceContext,
52 const Camera& camera,
53 RenderScene& scene,
54 EditorViewportPass& viewportPass);
55
59 void destroy();
60 ID3D11ShaderResourceView* getShadowMapSRV() const { return m_shadowDepthSRV.m_textureFromImg; }
61 ID3D11ShaderResourceView* getPreShadowSRV() const { return m_preShadowDebugPass.getSRV(); }
62
63private:
64 void buildQueues(RenderScene& scene, const Camera& camera);
65 void renderPreShadowDebugPass(DeviceContext& deviceContext, RenderScene& scene);
66 void renderShadowPass(DeviceContext& deviceContext);
67 void renderOpaquePass(DeviceContext& deviceContext);
68 void renderTransparentPass(DeviceContext& deviceContext);
69 void renderSkyboxPass(DeviceContext& deviceContext, RenderScene& scene);
70 void renderObject(DeviceContext& deviceContext, const RenderObject& object, RenderPassType passType);
71 void renderShadowObject(DeviceContext& deviceContext, const RenderObject& object);
72 HRESULT createShadowResources(Device& device);
73 void updateLightMatrices(const Camera& camera, const RenderScene& scene);
74 HRESULT createBlendStates(Device& device);
75 ID3D11BlendState* resolveBlendState(const Material* material) const;
76
77private:
82 ID3D11BlendState* m_alphaBlendState = nullptr;
83 ID3D11BlendState* m_opaqueBlendState = nullptr;
84 ID3D11BlendState* m_additiveBlendState = nullptr;
85 ID3D11BlendState* m_premultipliedBlendState = nullptr;
86 float m_blendFactor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
92 unsigned int m_shadowMapSize = 2048;
94 bool m_applyShadows = true;
95
96 CBPerFrame m_cbPerFrame{};
97 CBPerObject m_cbPerObject{};
98 CBPerMaterial m_cbPerMaterial{};
99
100 std::vector<const RenderObject*> m_opaqueQueue;
101 std::vector<const RenderObject*> m_transparentQueue;
102};
103
104
Declara la API de Buffer dentro del subsistema Core.
Declara la API de DepthStencilState dentro del subsistema Core.
Declara la API de DepthStencilView dentro del subsistema Core.
Declara la API de EditorViewportPass dentro del subsistema Utilities.
Declara la API de Prerequisites dentro del subsistema Core.
Declara la API de RasterizerState dentro del subsistema Core.
Declara la API de RenderScene dentro del subsistema Rendering.
Declara la API de RenderTypes dentro del subsistema Rendering.
RenderPassType
Definition RenderTypes.h:28
Declara la API de ShaderProgram dentro del subsistema Core.
Declara la API de Texture dentro del subsistema Core.
Encapsula un ID3D11Buffer para vértices, índices o constantes, incluyendo creación, actualización y enlace.
Definition Buffer.h:28
Encapsula un ID3D11DepthStencilState y su ciclo de vida para la etapa Output-Merger.
Encapsula un ID3D11DepthStencilView para usar un recurso de profundidad/esténcil en el pipeline.
Encapsula un ID3D11Device y facilita la creación de recursos gráficos en Direct3D 11.
Definition Device.h:21
Ejecuta el pipeline de render forward del motor.
DepthStencilView m_shadowDSV
ID3D11ShaderResourceView * getPreShadowSRV() const
std::vector< const RenderObject * > m_transparentQueue
ID3D11ShaderResourceView * getShadowMapSRV() const
DepthStencilState m_transparentDepthStencil
Texture m_shadowDepthTexture
RasterizerState m_shadowRasterizer
ShaderProgram m_shadowShader
std::vector< const RenderObject * > m_opaqueQueue
EditorViewportPass m_preShadowDebugPass
Describe el estado fijo compartido por una o mas instancias de material.
Definition Material.h:23
Contenedor temporal con los elementos visibles de un frame.
Definition RenderScene.h:20
Encapsula la creación, compilación y uso de Vertex Shader y Pixel Shader en Direct3D 11.
Encapsula una textura 2D en Direct3D 11, incluyendo su recurso y vista como Shader Resource.
Definition Texture.h:24