PointLight Shadows

This commit is contained in:
4VRDriver
2020-09-26 14:21:02 +02:00
parent 33dc801483
commit 55b8efc6c4
25 changed files with 399 additions and 139 deletions

View File

@@ -32,7 +32,7 @@ void Entity::draw(glm::mat4 viewProjMatrix, glm::vec3 viewPosition) {
}
void Entity::drawShadows(glm::mat4 viewProjMatrix, ShaderProgram *p_shaderProgram) {
void Entity::drawDirectionalShadows(glm::mat4 viewProjMatrix, ShaderProgram *p_shaderProgram) {
p_shaderProgram->bind();
@@ -46,6 +46,19 @@ void Entity::drawShadows(glm::mat4 viewProjMatrix, ShaderProgram *p_shaderProgra
}
void Entity::drawPointShadows(ShaderProgram *p_shaderProgram) {
p_shaderProgram->bind();
p_shaderProgram->setUniform("u_modelMatrix", modelMatrix);
// Draw the model
model->drawWithoutTextures();
p_shaderProgram->unbind();
}
void Entity::translate(glm::vec3 vector) {
position += vector;
updateModelMatrix();