Core/Color: Switch formal from RGBA8 to RGBA32F

This commit is contained in:
SirLynix
2022-04-23 16:08:15 +02:00
parent de53c88c01
commit e7274b24e9
32 changed files with 331 additions and 196 deletions

View File

@@ -338,7 +338,7 @@ int main()
std::random_device rng;
std::mt19937 randomEngine(rng());
std::uniform_int_distribution<unsigned int> colorDis(0, 255);
std::uniform_real_distribution<float> colorDis(0.f, 1.f);
std::uniform_real_distribution<float> heightDis(0.15f, 1.f);
std::uniform_real_distribution<float> posDis(-10.f, 10.f);
std::uniform_real_distribution<float> dirDis(-1.f, 1.f);
@@ -1174,11 +1174,11 @@ int main()
{
float rotationSpeed = ComputeLightAnimationSpeed(viewerPos);
auto& whiteLight = spotLights.emplace_back();
whiteLight.color = Nz::Color(100, 100, 255);
whiteLight.radius = 5.f;
whiteLight.position = AnimateLightPosition(viewerPos, rotationSpeed, -elapsedTime);
whiteLight.direction = AnimateLightDirection(camQuat * Nz::Vector3f::Forward(), rotationSpeed, -elapsedTime);
auto& spotLight = spotLights.emplace_back();
spotLight.color = Nz::Color(0.4f, 0.4f, 1.f);
spotLight.radius = 5.f;
spotLight.position = AnimateLightPosition(viewerPos, rotationSpeed, -elapsedTime);
spotLight.direction = AnimateLightDirection(camQuat * Nz::Vector3f::Forward(), rotationSpeed, -elapsedTime);
lightUpdate = true;
}
@@ -1524,7 +1524,7 @@ int main()
Nz::Vector3f position = AnimateLightPosition(spotLight.position, rotationSpeed, elapsedTime);
Nz::Vector3f direction = AnimateLightDirection(spotLight.direction, rotationSpeed, elapsedTime);
Nz::AccessByOffset<Nz::Vector3f&>(lightDataPtr, colorOffset) = Nz::Vector3f(spotLight.color.r / 255.f, spotLight.color.g / 255.f, spotLight.color.b / 255.f);
Nz::AccessByOffset<Nz::Vector3f&>(lightDataPtr, colorOffset) = Nz::Vector3f(spotLight.color.r, spotLight.color.g, spotLight.color.b);
Nz::AccessByOffset<Nz::Vector3f&>(lightDataPtr, positionOffset) = position;
Nz::AccessByOffset<Nz::Vector3f&>(lightDataPtr, directionOffset) = direction;
Nz::AccessByOffset<float&>(lightDataPtr, radiusOffset) = spotLight.radius;

View File

@@ -62,7 +62,7 @@ int main()
registry.emplace<Nz::NodeComponent>(viewer);
auto& cameraComponent = registry.emplace<Nz::CameraComponent>(viewer, window.GetRenderTarget(), Nz::ProjectionType::Orthographic);
cameraComponent.UpdateRenderMask(1);
cameraComponent.UpdateClearColor(Nz::Color(127, 127, 127));
cameraComponent.UpdateClearColor(Nz::Color(0.5f, 0.5f, 0.5f));
}
std::shared_ptr<Nz::Material> material = std::make_shared<Nz::Material>();

View File

@@ -133,7 +133,7 @@ int main()
registry.emplace<Nz::NodeComponent>(viewer);
auto& cameraComponent = registry.emplace<Nz::CameraComponent>(viewer, window.GetRenderTarget());
cameraComponent.UpdateRenderMask(1);
cameraComponent.UpdateClearColor(Nz::Color(127, 127, 127));
cameraComponent.UpdateClearColor(Nz::Color(0.5f, 0.5f, 0.5f));
}
auto shipCollider = std::make_shared<Nz::ConvexCollider3D>(vertices, vertexMapper.GetVertexCount(), 0.01f);

View File

@@ -22,7 +22,7 @@ int main()
{
registry.emplace<Nz::NodeComponent>(cameraEntity);
auto& cameraComponent = registry.emplace<Nz::CameraComponent>(cameraEntity, mainWindow.GetRenderTarget(), Nz::ProjectionType::Orthographic);
cameraComponent.UpdateClearColor(Nz::Color(117, 122, 214, 255));
cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f));
}
Nz::SimpleTextDrawer textDrawer;

View File

@@ -22,7 +22,7 @@ int main()
{
registry.emplace<Nz::NodeComponent>(cameraEntity);
auto& cameraComponent = registry.emplace<Nz::CameraComponent>(cameraEntity, mainWindow.GetRenderTarget(), Nz::ProjectionType::Orthographic);
cameraComponent.UpdateClearColor(Nz::Color(117, 122, 214, 255));
cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f));
}
Nz::SimpleTextDrawer textDrawer;

View File

@@ -117,7 +117,7 @@ int main()
{
registry.emplace<Nz::NodeComponent>(viewer2D);
auto& cameraComponent = registry.emplace<Nz::CameraComponent>(viewer2D, window.GetRenderTarget(), Nz::ProjectionType::Orthographic);
cameraComponent.UpdateClearColor(Nz::Color(173, 216, 230, 255));
cameraComponent.UpdateClearColor(Nz::Color(0.678f, 0.847f, 0.9f, 1.f));
}
window.EnableEventPolling(true);