forked from 1b-agent/opencadstudio-upstream
Raster images: transparency off draws pixels opaque; TRANSPARENCY command
An image's transparency flag decides whether transparent pixels show what is behind the image or draw in their stored colour: the image pass and PDF plots now follow it (it was ignored, so every PNG alpha showed through). TRANSPARENCY selects images and asks for the mode, defaulting to the first image's current one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
801882314f
commit
5ca7becd97
30 files changed
+237
-6
No files matched your search
@@ -28,7 +28,7 @@ struct Uniforms {
|
||||
struct ImageParams {
|
||||
opacity: f32,
|
||||
draw_depth: f32, // signed (-1,1) draw-order bias; 0 = neutral
|
||||
_pad1: f32,
|
||||
use_alpha: f32, // 1 = pixel alpha applies, 0 = pixels draw opaque
|
||||
_pad2: f32,
|
||||
};
|
||||
@group(1) @binding(2) var<uniform> img_params: ImageParams;
|
||||
@@ -63,5 +63,6 @@ fn vs_main(in: VertIn) -> VertOut {
|
||||
@fragment
|
||||
fn fs_main(in: VertOut) -> @location(0) vec4<f32> {
|
||||
let col = textureSample(img_texture, img_sampler, in.uv);
|
||||
return vec4<f32>(col.rgb, col.a * img_params.opacity);
|
||||
let alpha = select(1.0, col.a, img_params.use_alpha > 0.5);
|
||||
return vec4<f32>(col.rgb, alpha * img_params.opacity);
|
||||
}
|
||||
Reference in new issue
Block a user