lights use node position and orientation

This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent c241c6cac8
commit 3493f1b371
2 changed files with 3 additions and 4 deletions
+2
View File
@@ -104,6 +104,7 @@ namespace vb01{
void Light::renderShadow(std::vector<Node*> descendants, mat4 &proj, mat4 &view){
Root *root = Root::getSingleton();
Vector3 position = node->getPosition(), direction = node->getGlobalAxis(2);
glViewport(0, 0, depthMapSize, depthMapSize);
glBindFramebuffer(GL_FRAMEBUFFER, depthmapFBO);
@@ -172,6 +173,7 @@ namespace vb01{
}
void Light::updateShader(vector<Material*> materials, int thisId, mat4 &proj, mat4 &view){
Vector3 position = node->localToGlobalPosition(Vector3::VEC_ZERO), direction = node->getGlobalAxis(2);
for(Material *m : materials){
Shader *shader = m->getShader();
shader->use();