Pyrogenesis trunk
HWLightingModelRenderer.h
Go to the documentation of this file.
1/* Copyright (C) 2022 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * ModelVertexRenderer that transforms models on the CPU but performs
20 * lighting in a vertex shader.
21 */
22
23#ifndef INCLUDED_HWLIGHTINGMODELRENDERER
24#define INCLUDED_HWLIGHTINGMODELRENDERER
25
27
28/**
29 * Render animated models using a ShaderRenderModifier.
30 * This computes and binds per-vertex data; the modifier is responsible
31 * for setting any shader uniforms etc.
32 */
34{
35public:
38
39 CModelRData* CreateModelData(const void* key, CModel* model) override;
40 void UpdateModelData(CModel* model, CModelRData* data, int updateflags) override;
41
42 void UploadModelData(
43 Renderer::Backend::IDeviceCommandContext* deviceCommandContext,
44 CModel* model, CModelRData* data) override;
45 void PrepareModelDef(
46 Renderer::Backend::IDeviceCommandContext* deviceCommandContext,
47 const CModelDef& def) override;
48 void RenderModel(
49 Renderer::Backend::IDeviceCommandContext* deviceCommandContext,
50 Renderer::Backend::IShaderProgram* shader, CModel* model, CModelRData* data) override;
51
52protected:
55};
56
57
58#endif // INCLUDED_HWLIGHTINGMODELRENDERER
Definition: ModelDef.h:141
Class CModelRData: Render data that is maintained per CModel.
Definition: ModelRenderer.h:63
Definition: Model.h:39
Class ModelVertexRenderer: Normal ModelRenderer implementations delegate vertex array management and ...
Definition: ModelVertexRenderer.h:44
Definition: IDeviceCommandContext.h:42
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:81
Render animated models using a ShaderRenderModifier.
Definition: HWLightingModelRenderer.h:34
~ShaderModelVertexRenderer()
Definition: HWLightingModelRenderer.cpp:151
ShaderModelRendererInternals * m
Definition: HWLightingModelRenderer.h:54
ShaderModelVertexRenderer()
Definition: HWLightingModelRenderer.cpp:145
CModelRData * CreateModelData(const void *key, CModel *model) override
CreateModelData: Create internal data for one model.
Definition: HWLightingModelRenderer.cpp:158
void PrepareModelDef(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CModelDef &def) override
PrepareModelDef: Setup backend state for rendering of models that use the given CModelDef object as b...
Definition: HWLightingModelRenderer.cpp:235
void UploadModelData(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, CModel *model, CModelRData *data) override
Upload per-model data to backend.
Definition: HWLightingModelRenderer.cpp:219
void RenderModel(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Renderer::Backend::IShaderProgram *shader, CModel *model, CModelRData *data) override
RenderModel: Invoke the rendering commands for the given model.
Definition: HWLightingModelRenderer.cpp:253
void UpdateModelData(CModel *model, CModelRData *data, int updateflags) override
UpdateModelData: Calculate per-model data for each frame.
Definition: HWLightingModelRenderer.cpp:200
Definition: HWLightingModelRenderer.cpp:138
pthread_key_t key
Definition: wpthread.cpp:149