|
CG-Project2
|
All utilities for rendering entities. More...
Functions | |
| void | initStencilShader () |
| Initialize the stencil shader. | |
| void | prepareInstancedMesh (const std::vector< glm::mat4 > &models, const std::vector< glm::vec4 > &colors) |
| This methods calls the renderer and prepares the buffers with the model matrixes and colors. | |
| void | getOtherLightData (LightShaderBlock &block, const Shared< LightComponent > &light) |
| Retrieves all the light data and stores them in a shader block. | |
| std::array< LightShaderBlock, SHADER_MAX_LIGHTS > | prepareLightData () |
| Prepares data of all lights in the scene and put them in an array with defined size. | |
| void | sendOtherLightData (const Shared< ogl::ShaderProgram > &shader, LightShaderBlock &data, size_t &index) |
| This method sends to the used shader program the specific data for that light caster. | |
| void | sendLightDataShader (const Shared< ogl::ShaderProgram > &shader, std::array< LightShaderBlock, SHADER_MAX_LIGHTS > data) |
| This method sends to the used shader program the common lights data. | |
| void | renderSkybox (const unsigned int &id, const Shared< ogl::ShaderProgram > &shader) |
| This method draws the Skybox of the scene. | |
| void | renderAllMeshes () |
| Renders all the entities in the scene. | |
| void | renderInstancedMeshes () |
| Renders all entities with instanced rendering available. | |
| std::vector< glm::vec3 > | getBoxLines (glm::vec3 &botLeft, glm::vec3 &topRight) |
| This method calculates the lines to be drawn from two corners of a ColliderComponent. | |
| void | renderBoundingBox () |
| Renders all bounding box of the entities with a ColliderComponent. | |
All utilities for rendering entities.
| std::vector< glm::vec3 > systems::render::getBoxLines | ( | glm::vec3 & | botLeft, |
| glm::vec3 & | topRight ) |
This method calculates the lines to be drawn from two corners of a ColliderComponent.
| botLeft | the bot left corner position |
| topRight | the top right corner position |
| void systems::render::getOtherLightData | ( | LightShaderBlock & | block, |
| const Shared< LightComponent > & | light ) |
Retrieves all the light data and stores them in a shader block.
It prepares a single light data for sending to the shader program.
| [out] | block | the shader light block |
| [in] | light | the light in the scene |
| void systems::render::prepareInstancedMesh | ( | const std::vector< glm::mat4 > & | models, |
| const std::vector< glm::vec4 > & | colors ) |
This methods calls the renderer and prepares the buffers with the model matrixes and colors.
| models | a list of model matrixes |
| colors | a list of colors |
TODO implement proper instancing rendering for every mesh
| std::array< LightShaderBlock, SHADER_MAX_LIGHTS > systems::render::prepareLightData | ( | ) |
Prepares data of all lights in the scene and put them in an array with defined size.
| void systems::render::renderAllMeshes | ( | ) |
Renders all the entities in the scene.
It renderes all the entities with RenderComponent.
| void systems::render::renderSkybox | ( | const unsigned int & | id, |
| const Shared< ogl::ShaderProgram > & | shader ) |
This method draws the Skybox of the scene.
| id | the entity id |
| shader | the skybox shader program |
| void systems::render::sendLightDataShader | ( | const Shared< ogl::ShaderProgram > & | shader, |
| std::array< LightShaderBlock, SHADER_MAX_LIGHTS > | data ) |
This method sends to the used shader program the common lights data.
| shader | the shader program shared pointer |
| data | the array processed with systems::render::preparedLightData() |
| void systems::render::sendOtherLightData | ( | const Shared< ogl::ShaderProgram > & | shader, |
| LightShaderBlock & | data, | ||
| size_t & | index ) |
This method sends to the used shader program the specific data for that light caster.
| shader | the shader program shared pointer |
| data | the array processed with systems::render::prepareLightData() |
| index | the current light index in the array from systems::render::prepareLightData() |