Added gamma correction, Blinn-Phong shading, and normal map support

This commit is contained in:
grayson committed 2021-09-16 14:05:42 -05:00
1 parent e7cd6d8132
commit 6daa9d8d25
13 files changed
+101 -25

No files matched your search

+7 -7
View File
@@ -4,17 +4,17 @@ void MainState::onEnter() {
Log("MainState onEnter!");
camera->setType(nf::Camera::Type::FIRST_PERSON);
ap.load("example.nfpack");
test.create(ap["spec.obj"]);
test.setPosition(0.0, 0.0, -5.0);
plane.create(nf::BaseAssets::plane);
plane.setPosition(0.0, -2.0, 0.0);
plane.setScale(10.0);
test.create(ap["normal.obj"]);
test.setPosition(0.0, 0.05, -5.0);
plane.create(nf::BaseAssets::cube);
plane.setPosition(0.0, -1.0, 0.0);
plane.setScale(50.0, 0.05, 50.0);
text.create("This is a test text.", nf::Vec2(0.1, 0.025), nf::Vec3(0.8));
text.centered(true);
uiTex.create(nf::BaseAssets::logo, nf::Vec2(0.025, 0.025), 0.5);
button.create(nf::Vec2(0.8, 0.025), "Reset");
button2.create(nf::Vec2(0.6, 0.025), "Play Sound");
light.create(nf::Vec3(-5.0, 10.0, 5.0), nf::Vec3(1.0, 1.0, 1.0), 1.0);
light.create(nf::Vec3(-5.0, 10.0, 5.0), nf::Vec3(1.0, 1.0, 1.0));
cm.create(nf::BaseAssets::cubemap);
sound.create(ap["sound.wav"]);
@@ -51,7 +51,7 @@ void MainState::update(double deltaTime) {
xrot += offset;
if (app->isKeyHeld(NFI_RIGHT))
xrot -= offset;
test.setPosition(-xrot / 10.0, 0.0, -yrot / 10.0 - 5.0);
light.setPosition(nf::Vec3(-5.0, yrot / 10.0 + 10.0, 5.0));
text.setText("FPS: " + std::to_string(app->getFPS()));