diff --git a/Game.cpp b/Game.cpp index a22c255..90429e5 100644 --- a/Game.cpp +++ b/Game.cpp @@ -202,7 +202,7 @@ void Game::CreateBasicGeometry() std::make_shared(materials[0], shapes[0]), std::make_shared(materials[0], shapes[1]), std::make_shared(materials[0], shapes[2]), - std::make_shared(materials[1], shapes[3]), + std::make_shared(materials[0], shapes[3]), std::make_shared(materials[1], shapes[4]), std::make_shared(materials[1], shapes[5]), std::make_shared(materials[1], shapes[6]), @@ -211,6 +211,7 @@ void Game::CreateBasicGeometry() for (int i = 0; i < entities.size(); ++i) { entities[i]->GetTransform()->SetPosition((-(int)(entities.size() / 2) + i) * 5, 0, 0); + entities[i]->GetMaterial()->SetEmitAmount((entities.size() - i) * 0.25f); } } @@ -242,10 +243,10 @@ void Game::Update(float deltaTime, float totalTime) for (int i = 0; i < entities.size(); ++i) { entities[i]->GetTransform()->SetRotation(sin(totalTime / 720) * 360, 0, 0); - entities[i]->GetMaterial()->SetRoughness(sin(totalTime) * 0.5f + 0.49f); - entities[i]->GetMaterial()->SetUVOffset(DirectX::XMFLOAT2(cos(totalTime * 4) * 0.5f + 0.49f, cos(totalTime * 4) * 0.5f + 0.49f)); - entities[i]->GetMaterial()->SetUVScale(DirectX::XMFLOAT2(sin(totalTime) * 0.5f + 0.49f, sin(totalTime) * 0.5f + 0.49f)); - entities[i]->GetMaterial()->SetEmitAmount(cos(totalTime) * 0.5f + 0.49f); + //entities[i]->GetMaterial()->SetRoughness(sin(totalTime) * 0.5f + 0.49f); + //entities[i]->GetMaterial()->SetUVOffset(DirectX::XMFLOAT2(cos(totalTime * 4) * 0.5f + 0.49f, cos(totalTime * 4) * 0.5f + 0.49f)); + //entities[i]->GetMaterial()->SetUVScale(DirectX::XMFLOAT2(sin(totalTime) * 0.5f + 0.49f, sin(totalTime) * 0.5f + 0.49f)); + //entities[i]->GetMaterial()->SetEmitAmount(cos(totalTime) * 0.5f + 0.49f); } } diff --git a/Material.cpp b/Material.cpp index a1a3159..dc99ff6 100644 --- a/Material.cpp +++ b/Material.cpp @@ -12,6 +12,7 @@ Material::Material( pixelShader = _pixelShader; uvOffset = DirectX::XMFLOAT2(0, 0); uvScale = DirectX::XMFLOAT2(1, 1); + emitAmount = 0; } Material::~Material()