50GeometryBuffer* EnvironmentMappingRenderer::geometryBuffer =
nullptr;
52EnvironmentMappingRenderer::EnvironmentMappingRenderer(
Engine* engine, int32_t width, int32_t height)
61 {{ 1.0f, 0.0f, 0.0f }},
62 {{ -1.0f, 0.0f, 0.0f }},
63 {{ 0.0f, -1.0f, 0.0f }},
64 {{ 0.0f, 1.0f, 0.0f }},
65 {{ 0.0f, 0.0f, 1.0f }},
66 {{ 0.0f, 0.0f, -1.0f }}
69 {{ 0.0f, 0.0f, -1.0f }},
70 {{ 0.0f, 0.0f, 1.0f }},
71 {{ 1.0f, 0.0f, 0.0f }},
72 {{ 1.0f, 0.0f, 0.0f }},
73 {{ 1.0f, 0.0f, 0.0f }},
74 {{ -1.0f, 0.0f, 0.0f }}
78 {{ -1.0f, 0.0f, 0.0f }},
79 {{ 1.0f, 0.0f, 0.0f }},
80 {{ 0.0f, 1.0f, 0.0f }},
81 {{ 0.0f, -1.0f, 0.0f }},
82 {{ 0.0f, 0.0f, 1.0f }},
83 {{ 0.0f, 0.0f, -1.0f }}
86 {{ 0.0f, 0.0f, 1.0f }},
87 {{ 0.0f, 0.0f, -1.0f }},
88 {{ 1.0f, 0.0f, 0.0f }},
89 {{ 1.0f, 0.0f, 0.0f }},
90 {{ 1.0f, 0.0f, 0.0f }},
91 {{ -1.0f, 0.0f, 0.0f }}
118 Console::println(
"EnvironmentMappingRenderer::initialize(): " + to_string(
geometryBuffer->
getId()) +
": geometry buffer width != width, height != height!");
141 auto now = Time::getCurrentMillis();
148 for (
auto runs = 0; runs < (
timeRenderLast == -1LL?2:1); runs++) {
196 EntityRenderer::RENDERTYPE_NORMALS |
197 EntityRenderer::RENDERTYPE_TEXTUREARRAYS |
198 EntityRenderer::RENDERTYPE_TEXTUREARRAYS_DIFFUSEMASKEDTRANSPARENCY |
199 EntityRenderer::RENDERTYPE_EFFECTCOLORS |
200 EntityRenderer::RENDERTYPE_MATERIALS |
201 EntityRenderer::RENDERTYPE_MATERIALS_DIFFUSEMASKEDTRANSPARENCY |
202 EntityRenderer::RENDERTYPE_TEXTURES |
203 EntityRenderer::RENDERTYPE_TEXTURES_DIFFUSEMASKEDTRANSPARENCY |
204 EntityRenderer::RENDERTYPE_LIGHTS
void setSideVector(const Vector3 &sideVector)
Set side vector.
void update(int contextIdx, int32_t width, int32_t height)
Sets up camera while resizing the view port.
void setFovX(float fovX)
Set field of view X.
void setUpVector(const Vector3 &upVector)
Set up vector.
void setCameraMode(CameraMode cameraMode)
Set camera mode.
void setLookFrom(const Vector3 &lookFrom)
Set look from.
void setForwardVector(const Vector3 &forwardVector)
Set forward vector.
void setZNear(float zNear)
Set z near.
void setZFar(float zFar)
Set z far.
static STATIC_DLL_IMPEXT Renderer * renderer
void render(FrameBuffer *renderFrameBuffer, GeometryBuffer *renderGeometryBuffer, DecomposedEntities &visibleDecomposedEntities, int32_t effectPass, int32_t renderPassMask, const string &shaderPrefix, bool useEZR, bool applyShadowMapping, bool applyPostProcessing, bool doRenderLightSource, bool doRenderParticleSystems, int32_t renderTypes)
Do a render/effect pass.
void computeTransformations(Camera *camera, DecomposedEntities &decomposedEntites, bool autoEmit, bool computeTransformations)
Computes visibility and transformations.
void resetLists(DecomposedEntities &decomposedEntites)
Reset lists.
Entity hierarchy to be used with engine class.
static void disableFrameBuffer()
Switches back to non offscreen main frame buffer to be rendered.
static constexpr int32_t FRAMEBUFFER_COLORBUFFER
static constexpr int32_t FRAMEBUFFER_DEPTHBUFFER
void update()
Setups frustum, should be called if frustum did change.
void initialize()
Initialize the geometry buffer.
LOD object 3D to be used with engine class.
Object 3D render group for static objects that might be animated by shaders.
Object 3D to be used with engine class.
Object particle system entity to be used with engine class.
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
int reflectionCubeMapTextureIdx
Engine::DecomposedEntities visibleDecomposedEntities
void reshape(int32_t width, int32_t height)
Reshape frame buffers.
array< array< FrameBuffer *, 6 >, 2 > frameBuffers
array< Vector3, 6 > forwardVectors
void initialize()
Init frame buffer.
array< int32_t, 2 > cubeMapTextureIds
array< Vector3, 6 > sideVectors
int renderCubeMapTextureIdx
~EnvironmentMappingRenderer()
Destructor.
static STATIC_DLL_IMPEXT GeometryBuffer * geometryBuffer
void dispose()
Disposes this shadow mapping.
int64_t timeRenderUpdateFrequency
void render(const Vector3 &position)
Renders given objects in to environment cube map.
virtual void setClearColor(float red, float green, float blue, float alpha)=0
Set up clear color.
int32_t CLEAR_COLOR_BUFFER_BIT
RendererType getRendererType()
virtual void disposeTexture(int32_t textureId)=0
Dispose a texture.
virtual int32_t createCubeMapTexture(int contextIdx, int32_t width, int32_t height)=0
Create cube map texture from frame buffers.
virtual void clear(int32_t mask)=0
Clear render buffer with given mask.
virtual bool isDeferredShadingAvailable()=0
int32_t CONTEXTINDEX_DEFAULT
int32_t CLEAR_DEPTH_BUFFER_BIT