TDME2 1.9.121
|
Rendering class. More...
#include <tdme/engine/subsystems/rendering/EntityRenderer.h>
Classes | |
struct | Object3DRenderContext |
Public Member Functions | |
EntityRenderer (Engine *engine, Renderer *renderer) | |
Public constructor. More... | |
~EntityRenderer () | |
Destructor. More... | |
void | initialize () |
Init. More... | |
void | dispose () |
Dispose. More... | |
BatchRendererTriangles * | acquireTrianglesBatchRenderer () |
void | reset () |
Resets the object 3d renderer. More... | |
void | render (Entity::RenderPass renderPass, const vector< Object3D * > &objects, bool renderTransparentFaces, int32_t renderTypes) |
Renders all given objects. More... | |
void | renderTransparentFaces () |
Renders collected transparent faces. More... | |
void | render (Entity::RenderPass renderPass, const vector< Entity * > &pses) |
Render points particle system entities. More... | |
void | render (Entity::RenderPass renderPass, const vector< LinesObject3D * > &objects) |
Renders all given lines objects. More... | |
Static Public Attributes | |
static constexpr int32_t | RENDERTYPE_NORMALS { 1 } |
static constexpr int32_t | RENDERTYPE_TEXTUREARRAYS { 2 } |
static constexpr int32_t | RENDERTYPE_TEXTUREARRAYS_DIFFUSEMASKEDTRANSPARENCY { 4 } |
static constexpr int32_t | RENDERTYPE_EFFECTCOLORS { 8 } |
static constexpr int32_t | RENDERTYPE_MATERIALS { 16 } |
static constexpr int32_t | RENDERTYPE_MATERIALS_DIFFUSEMASKEDTRANSPARENCY { 32 } |
static constexpr int32_t | RENDERTYPE_TEXTURES { 64 } |
static constexpr int32_t | RENDERTYPE_TEXTURES_DIFFUSEMASKEDTRANSPARENCY { 128 } |
static constexpr int32_t | RENDERTYPE_LIGHTS { 256 } |
static constexpr int32_t | RENDERTYPE_SHADOWMAPPING { 512 } |
static constexpr int32_t | RENDERTYPE_RENDERGROUP_OBJECTORIGIN { 1024 } |
static constexpr int32_t | RENDERTYPE_ALL { 2047 } |
Private Member Functions | |
void | prepareTransparentFaces (const vector< TransparentRenderFace * > &transparentRenderFaces) |
Renders transparent faces TODO: guess this should be optimized regarding GL commands skinned mesh is not supported when using GPU. More... | |
void | renderTransparentFacesGroups (int contextIdx) |
Render transparent faces groups. More... | |
void | releaseTransparentFacesGroups () |
Release transparent faces groups. More... | |
void | renderObjectsOfSameType (int threadIdx, const vector< Object3D * > &objects, bool collectTransparentFaces, int32_t renderTypes, TransparentRenderFacesPool *transparentRenderFacesPool) |
Renders multiple objects of same type(with same model) More... | |
void | renderObjectsOfSameTypeNonInstanced (const vector< Object3D * > &objects, bool collectTransparentFaces, int32_t renderTypes) |
Renders multiple objects of same type(with same model) not using instancing. More... | |
void | renderObjectsOfSameTypeInstanced (int threadIdx, const vector< Object3D * > &objects, bool collectTransparentFaces, int32_t renderTypes, TransparentRenderFacesPool *transparentRenderFacesPool) |
Renders multiple objects of same type(with same model) using instancing. More... | |
bool | checkMaterialChangable (Object3DNode *object3DNode, int32_t facesEntityIdx, int32_t renderTypes) |
Checks if a material could change when having multiple objects but same model. More... | |
void | setupMaterial (int contextIdx, Object3DNode *object3DNode, int32_t facesEntityIdx, int32_t renderTypes, bool updateOnly, string &materialKey, const string ¤tMaterialKey=string()) |
Set ups a material for rendering. More... | |
void | clearMaterial (int contextIdx) |
Clear material for rendering. More... | |
void | renderFunction (int threadIdx, Entity::RenderPass renderPass, const vector< Object3D * > &objects, unordered_map< uint8_t, unordered_map< Model *, vector< Object3D * > > > &objectsByShadersAndModels, bool renderTransparentFaces, int renderTypes, TransparentRenderFacesPool *transparentRenderFacesPool) |
Render function. More... | |
Private Attributes | |
Engine * | engine { nullptr } |
Renderer * | renderer { nullptr } |
vector< BatchRendererTriangles * > | trianglesBatchRenderers |
unordered_map< uint8_t, unordered_map< Model *, vector< Object3D * > > > | objectsByShadersAndModels |
vector< TransparentRenderFace * > | nodeTransparentRenderFaces |
EntityRenderer_TransparentRenderFacesGroupPool * | transparentRenderFacesGroupPool { nullptr } |
TransparentRenderFacesPool * | transparentRenderFacesPool { nullptr } |
unordered_map< string, TransparentRenderFacesGroup * > | transparentRenderFacesGroups |
RenderTransparentRenderPointsPool * | renderTransparentRenderPointsPool { nullptr } |
BatchRendererPoints * | psePointBatchRenderer { nullptr } |
int | threadCount |
vector< Object3DRenderContext > | contexts |
Static Private Attributes | |
static constexpr int32_t | BATCHRENDERER_MAX { 256 } |
static constexpr int32_t | INSTANCEDRENDERING_OBJECTS_MAX { 16384 } |
Friends | |
class | Object3DNodeRenderer |
class | TransparentRenderFacesGroup |
class | tdme::engine::Engine |
EntityRenderer | ( | Engine * | engine, |
Renderer * | renderer | ||
) |
Public constructor.
engine | engine |
renderer | renderer |
Definition at line 140 of file EntityRenderer.cpp.
~EntityRenderer | ( | ) |
Destructor.
Definition at line 158 of file EntityRenderer.cpp.
BatchRendererTriangles * acquireTrianglesBatchRenderer | ( | ) |
Definition at line 199 of file EntityRenderer.cpp.
|
inlineprivate |
Checks if a material could change when having multiple objects but same model.
object3DNode | object 3d node |
facesEntityIdx | faces entity idx |
renderTypes | render types |
Definition at line 151 of file EntityRenderer.h.
|
private |
Clear material for rendering.
contextIdx | context index |
Definition at line 1270 of file EntityRenderer.cpp.
void dispose | ( | ) |
Dispose.
Definition at line 185 of file EntityRenderer.cpp.
void initialize | ( | ) |
Init.
Definition at line 175 of file EntityRenderer.cpp.
|
private |
Renders transparent faces TODO: guess this should be optimized regarding GL commands skinned mesh is not supported when using GPU.
transparentRenderFaces | transparent render faces |
Definition at line 344 of file EntityRenderer.cpp.
|
private |
Release transparent faces groups.
Definition at line 411 of file EntityRenderer.cpp.
void render | ( | Entity::RenderPass | renderPass, |
const vector< Entity * > & | pses | ||
) |
Render points particle system entities.
renderPass | render pass |
pses | points particle system entities |
Definition at line 1305 of file EntityRenderer.cpp.
void render | ( | Entity::RenderPass | renderPass, |
const vector< LinesObject3D * > & | objects | ||
) |
Renders all given lines objects.
renderPass | render pass |
objects | lines objects |
Definition at line 1445 of file EntityRenderer.cpp.
void render | ( | Entity::RenderPass | renderPass, |
const vector< Object3D * > & | objects, | ||
bool | renderTransparentFaces, | ||
int32_t | renderTypes | ||
) |
Renders all given objects.
renderPass | render pass |
objects | objects |
renderTransparentFaces | render transparent faces |
renderTypes | render types |
Definition at line 225 of file EntityRenderer.cpp.
|
inlineprivate |
Render function.
threadIdx | thread index |
objects | objects |
visibleObjectsByModels | objects by models storage |
renderTransparentFaces | render transparent faces |
renderTypes | render types |
Definition at line 181 of file EntityRenderer.h.
|
inlineprivate |
Renders multiple objects of same type(with same model)
threadIdx | thread idx |
objects | objects of same type/ with same models |
collectTransparentFaces | collect render faces |
renderTypes | render types |
transparentRenderFacesPool | transparent render faces pool |
Definition at line 120 of file EntityRenderer.h.
|
private |
Renders multiple objects of same type(with same model) using instancing.
threadIdx | thread idx |
objects | objects of same type/ with same models |
collectTransparentFaces | collect render faces |
renderTypes | render types |
Definition at line 707 of file EntityRenderer.cpp.
|
private |
Renders multiple objects of same type(with same model) not using instancing.
objects | objects of same type/ with same models |
collectTransparentFaces | collect render faces |
renderTypes | render types |
Definition at line 419 of file EntityRenderer.cpp.
void renderTransparentFaces | ( | ) |
Renders collected transparent faces.
Definition at line 277 of file EntityRenderer.cpp.
|
private |
Render transparent faces groups.
contextIdx | context index |
Definition at line 405 of file EntityRenderer.cpp.
void reset | ( | ) |
Resets the object 3d renderer.
Definition at line 220 of file EntityRenderer.cpp.
|
private |
Set ups a material for rendering.
contextIdx | context index |
object3DNode | object 3d node |
facesEntityIdx | faces entity idx |
renderTypes | render types |
updateOnly | update only, means material has been set up already, only do changes |
materialKey | material key |
currentMaterialKey | current material key or empty |
Definition at line 1143 of file EntityRenderer.cpp.
|
friend |
Definition at line 59 of file EntityRenderer.h.
|
friend |
Definition at line 61 of file EntityRenderer.h.
|
friend |
Definition at line 60 of file EntityRenderer.h.
|
staticconstexprprivate |
Definition at line 64 of file EntityRenderer.h.
|
private |
Definition at line 91 of file EntityRenderer.h.
|
private |
Definition at line 79 of file EntityRenderer.h.
|
staticconstexprprivate |
Definition at line 65 of file EntityRenderer.h.
|
private |
Definition at line 84 of file EntityRenderer.h.
|
private |
Definition at line 83 of file EntityRenderer.h.
|
private |
Definition at line 89 of file EntityRenderer.h.
|
private |
Definition at line 80 of file EntityRenderer.h.
|
private |
Definition at line 88 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 253 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 245 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 250 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 246 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 247 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 242 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 252 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 251 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 243 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 244 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 248 of file EntityRenderer.h.
|
staticconstexpr |
Definition at line 249 of file EntityRenderer.h.
|
private |
Definition at line 90 of file EntityRenderer.h.
|
private |
Definition at line 85 of file EntityRenderer.h.
|
private |
Definition at line 87 of file EntityRenderer.h.
|
private |
Definition at line 86 of file EntityRenderer.h.
|
private |
Definition at line 82 of file EntityRenderer.h.