From c44c5705095b0b0509988ff98c5b4707eb0a9edb Mon Sep 17 00:00:00 2001 From: milek7 Date: Tue, 17 Sep 2019 21:52:44 +0200 Subject: [PATCH] fix smoke color --- renderer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/renderer.cpp b/renderer.cpp index 6fb54309..97873a9f 100644 --- a/renderer.cpp +++ b/renderer.cpp @@ -105,9 +105,8 @@ opengl_particles::update( opengl_camera const &Camera ) { auto const particlecolor { glm::clamp( source.second.color() - * ( glm::vec3 { Global.DayLight.ambient } + 0.35f * glm::vec3{ Global.DayLight.diffuse } ) - * 255.f, - glm::vec3{ 0.f }, glm::vec3{ 255.f } ) }; + * ( glm::vec3 { Global.DayLight.ambient } + 0.35f * glm::vec3{ Global.DayLight.diffuse } ), + glm::vec3{ 0.f }, glm::vec3{ 1.f } ) }; auto const &particles { source.second.sequence() }; // TODO: put sanity cap on the overall amount of particles that can be drawn auto const sizestep { 256.0 * billboard_vertices.size() }; @@ -115,9 +114,9 @@ opengl_particles::update( opengl_camera const &Camera ) { sizestep * std::ceil( m_particlevertices.size() + ( particles.size() * billboard_vertices.size() ) / sizestep ) ); for( auto const &particle : particles ) { // TODO: particle color support - vertex.color[ 0 ] = static_cast( particlecolor.r ); - vertex.color[ 1 ] = static_cast( particlecolor.g ); - vertex.color[ 2 ] = static_cast( particlecolor.b ); + vertex.color[ 0 ] = particlecolor.r; + vertex.color[ 1 ] = particlecolor.g; + vertex.color[ 2 ] = particlecolor.b; vertex.color.a = std::clamp(particle.opacity, 0.0f, 1.0f); auto const offset { glm::vec3{ particle.position - Camera.position() } };