Convert colors to linear RGB before uploading in solid pipelines
This commit is contained in:
parent
b957453404
commit
6246584209
2 changed files with 9 additions and 5 deletions
|
|
@ -63,13 +63,15 @@ impl Program {
|
|||
}
|
||||
|
||||
if color != &self.uniform_data.color {
|
||||
let [r, g, b, a] = color.into_linear();
|
||||
|
||||
unsafe {
|
||||
gl.uniform_4_f32(
|
||||
Some(&self.uniform_data.color_location),
|
||||
color.r,
|
||||
color.g,
|
||||
color.b,
|
||||
color.a,
|
||||
r,
|
||||
g,
|
||||
b,
|
||||
a,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,11 @@ pub(super) struct Uniforms {
|
|||
|
||||
impl Uniforms {
|
||||
pub fn new(transform: Transformation, color: Color) -> Self {
|
||||
let [r, g, b, a] = color.into_linear();
|
||||
|
||||
Self {
|
||||
transform: transform.into(),
|
||||
color: Vec4::new(color.r, color.g, color.b, color.a),
|
||||
color: Vec4::new(r, g, b, a),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue