Commit e1cd76d8 authored by Al's avatar Al

preapartions for lighting rework

parent d7ecae75
......@@ -24,7 +24,7 @@ MainScene::MainScene(Graphics & gfx)
// set light sphere colors
for (auto& v : lightIndicator.vertices)
{
v.color = Colors::White;
v.color = Colors::Yellow;
}
......@@ -118,7 +118,6 @@ void MainScene::Update(Keyboard& kbd, Mouse& mouse, float dt)
}
//l_pos.y = l_height_amplitude * sin(wrap_angle((PI / (2.0f * l_height_amplitude)) * t));
......@@ -134,7 +133,7 @@ void MainScene::Draw()
// draw light indicator with different pipeline
// don't call beginframe on this pipeline b/c wanna keep zbuffer contents
// (don't like this assymetry but we'll live with it for now)
liPipeline.effect.vs.BindWorldView(Mat4::Translation(l_pos) * view);
liPipeline.effect.vs.BindWorldView(Mat4::Translation(l_pos0) * view);
liPipeline.effect.vs.BindProjection(proj);
liPipeline.Draw(lightIndicator);
......@@ -142,9 +141,9 @@ void MainScene::Draw()
// draw walls (ceiling floor)
wPipeline.effect.vs.BindProjection(proj);
wPipeline.effect.vs.SetLightPosition(l_pos * view);
wPipeline.effect.vs.SetLightPosition(l_pos0 * view);
wPipeline.effect.vs.SetAmbientLight(l_ambient);
wPipeline.effect.vs.SetDiffuseLight(l);
wPipeline.effect.vs.SetDiffuseLight(l0);
const std::vector<WallsETC::Wall>& wal = walls.GetWalls();
for (const auto w : wal)
{
......@@ -178,9 +177,9 @@ void MainScene::Draw()
//draw Particles
pPipeline.effect.vs.BindProjection(proj);
pPipeline.effect.vs.SetLightPosition(l_pos * view);
pPipeline.effect.vs.SetLightPosition(l_pos0 * view);
pPipeline.effect.vs.SetAmbientLight(l_ambient);
pPipeline.effect.vs.SetDiffuseLight(l);
pPipeline.effect.vs.SetDiffuseLight(l0);
for (auto& pb : partBursts)
{
......
......@@ -91,8 +91,10 @@ private:
//light stuff
IndexedTriangleList<SolidEffect::Vertex> lightIndicator = Sphere::GetPlain<SolidEffect::Vertex>(0.05f);
Vec4 l_pos = { 0.0f,0.4f,0.0f,1.0f };
Vec3 l = { 1.0f,1.0f,1.0f };
Vec3 l_ambient = { 0.2f,0.1f,0.15f };
Vec4 l_pos0 = { 0.7f,0.4f,0.0f,1.0f };
Vec3 l0 = { 1.0f,0.45f,0.35f };
Vec4 l_pos1 = { -0.7f,0.4f,0.0f,1.0f };
Vec3 l1 = { 1.0f,0.45f,0.35f };
Vec3 l_ambient = { 0.1f,0.05f,0.04f };
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment