Package engine.renderEngine
Class EntityRenderer
java.lang.Object
engine.renderEngine.EntityRenderer
This class is responsible for rendering anything considered an entity.
An entity constitutes as anything that has a 3D asset.
Starts the entity shaders as well as drawing every asset to the screen with the help of the shaders.
-
Constructor Summary
ConstructorsConstructorDescriptionEntityRenderer
(EntityShader shader, org.joml.Matrix4f projectionMatrix) Constructor which starts the shader and loads the projection matrix in the shader. -
Method Summary
Modifier and TypeMethodDescriptionvoid
prepareModel
(TexturedModel texturedModel) The vertex attribute arrays for each model are enabled, the shaders are laoded with the shinedampers and reflectivity, the texture banks are activated and the texture is loaded.void
render
(Map<TexturedModel, List<Entity>> entities) Entities are stored in the hashmap Render function prepares each type of TexturedModel and the prepares each individual instance of that model before drawing it to the screen.void
Disables and unbinds all the Vertex Arrays.
-
Constructor Details
-
EntityRenderer
Constructor which starts the shader and loads the projection matrix in the shader.- Parameters:
shader
-projectionMatrix
-
-
-
Method Details
-
render
Entities are stored in the hashmap Render function prepares each type of TexturedModel and the prepares each individual instance of that model before drawing it to the screen.- Parameters:
entities
-
-
prepareModel
The vertex attribute arrays for each model are enabled, the shaders are laoded with the shinedampers and reflectivity, the texture banks are activated and the texture is loaded.- Parameters:
texturedModel
-
-
unbindModel
public void unbindModel()Disables and unbinds all the Vertex Arrays.
-