Use Oklab color interpolation only with color::GAMMA_CORRECTION
This commit is contained in:
parent
2b746c7b25
commit
10d0b257f9
11 changed files with 544 additions and 489 deletions
|
|
@ -487,8 +487,10 @@ mod solid {
|
|||
device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some("iced_wgpu.triangle.solid.shader"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
std::borrow::Cow::Borrowed(include_str!(
|
||||
"shader/triangle.wgsl"
|
||||
std::borrow::Cow::Borrowed(concat!(
|
||||
include_str!("shader/triangle.wgsl"),
|
||||
"\n",
|
||||
include_str!("shader/triangle/solid.wgsl"),
|
||||
)),
|
||||
),
|
||||
});
|
||||
|
|
@ -537,6 +539,7 @@ mod solid {
|
|||
}
|
||||
|
||||
mod gradient {
|
||||
use crate::graphics::color;
|
||||
use crate::graphics::mesh;
|
||||
use crate::graphics::Antialiasing;
|
||||
use crate::triangle;
|
||||
|
|
@ -633,9 +636,31 @@ mod gradient {
|
|||
device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some("iced_wgpu.triangle.gradient.shader"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
std::borrow::Cow::Borrowed(include_str!(
|
||||
"shader/triangle.wgsl"
|
||||
)),
|
||||
std::borrow::Cow::Borrowed(
|
||||
if color::GAMMA_CORRECTION {
|
||||
concat!(
|
||||
include_str!("shader/triangle.wgsl"),
|
||||
"\n",
|
||||
include_str!(
|
||||
"shader/triangle/gradient.wgsl"
|
||||
),
|
||||
"\n",
|
||||
include_str!("shader/color/oklab.wgsl")
|
||||
)
|
||||
} else {
|
||||
concat!(
|
||||
include_str!("shader/triangle.wgsl"),
|
||||
"\n",
|
||||
include_str!(
|
||||
"shader/triangle/gradient.wgsl"
|
||||
),
|
||||
"\n",
|
||||
include_str!(
|
||||
"shader/color/linear_rgb.wgsl"
|
||||
)
|
||||
)
|
||||
},
|
||||
),
|
||||
),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue