Shadows now working, though they are still voxel based. Need to calculate where on the surface the ray hits, and then send the ray out from that point.

This commit is contained in:
MitchellHansen
2017-01-15 23:23:43 -08:00
parent 9a12fba310
commit cc7a4a2efb
3 changed files with 42 additions and 64 deletions

View File

@@ -116,7 +116,7 @@ int main() {
// Light for the currently non functional Bling Phong shader
Light l;
l.direction_cartesian = sf::Vector3f(-0.2f, -0.2f, -1.5f);
l.position = sf::Vector3f(100.0f, 100.0f, 500.0f);
l.position = sf::Vector3f(100.0f, 500.0f, 100.0f);
l.rgbi = sf::Vector4f(0.3f, 0.4f, 0.3f, 1.0f);
std::vector<Light> light_vec;
@@ -180,7 +180,7 @@ int main() {
raycaster->test_edit_viewport(WINDOW_X, WINDOW_Y, w -= 5, h -= 5);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::L)) {
light_vec.at(0).position.y += 0.5;
light_vec.at(0).position = camera->get_position();
}
// Time keeping