Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CPUSkinnedModelRenderer.h
Go to the documentation of this file.
1/* Copyright (C) 2024 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#ifndef INCLUDED_RENDERER_CPUSKINNEDMODELRENDERER
19#define INCLUDED_RENDERER_CPUSKINNEDMODELRENDERER
20
22
23#include <memory>
24
25/**
26 * Render animated models using a ShaderRenderModifier.
27 * It calculates vertex data for models on the CPU side.
28 * This computes and binds per-vertex data; the modifier is responsible
29 * for setting any shader uniforms etc.
30 */
32{
33public:
36
37 CModelRData* CreateModelData(const void* key, CModel* model) override;
38 void UpdateModelData(CModel* model, CModelRData* data, int updateflags) override;
39
40 void UploadModelData(
41 Renderer::Backend::IDeviceCommandContext* deviceCommandContext,
42 CModel* model, CModelRData* data) override;
43 void PrepareModelDef(
44 Renderer::Backend::IDeviceCommandContext* deviceCommandContext,
45 const CModelDef& def) override;
46 void RenderModel(
47 Renderer::Backend::IDeviceCommandContext* deviceCommandContext,
48 Renderer::Backend::IShaderProgram* shader, CModel* model, CModelRData* data) override;
49
50protected:
51 struct Internals;
52 std::unique_ptr<Internals> m;
53};
54
55
56#endif // INCLUDED_RENDERER_CPUSKINNEDMODELRENDERER
Definition: ModelDef.h:141
Class CModelRData: Render data that is maintained per CModel.
Definition: ModelRenderer.h:63
Definition: Model.h:39
Render animated models using a ShaderRenderModifier.
Definition: CPUSkinnedModelRenderer.h:32
void UpdateModelData(CModel *model, CModelRData *data, int updateflags) override
UpdateModelData: Calculate per-model data for each frame.
Definition: CPUSkinnedModelRenderer.cpp:192
std::unique_ptr< Internals > m
Definition: CPUSkinnedModelRenderer.h:52
void UploadModelData(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, CModel *model, CModelRData *data) override
Upload per-model data to backend.
Definition: CPUSkinnedModelRenderer.cpp:211
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: CPUSkinnedModelRenderer.cpp:227
CModelRData * CreateModelData(const void *key, CModel *model) override
CreateModelData: Create internal data for one model.
Definition: CPUSkinnedModelRenderer.cpp:151
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: CPUSkinnedModelRenderer.cpp:244
CPUSkinnedModelVertexRenderer()
Definition: CPUSkinnedModelRenderer.cpp:143
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
Definition: CPUSkinnedModelRenderer.cpp:137
pthread_key_t key
Definition: wpthread.cpp:140