embrace the egui
This commit is contained in:
24
assets/shaders/shader.wgsl
Normal file
24
assets/shaders/shader.wgsl
Normal file
@@ -0,0 +1,24 @@
|
||||
#import bevy_pbr::forward_io::{VertexOutput, FragmentOutput}
|
||||
|
||||
@group(#{MATERIAL_BIND_GROUP}) @binding(101) var ui_texture: texture_2d<f32>;
|
||||
@group(#{MATERIAL_BIND_GROUP}) @binding(102) var ui_texture_sampler: sampler;
|
||||
@group(#{MATERIAL_BIND_GROUP}) @binding(103) var cursor_texture: texture_2d<f32>;
|
||||
@group(#{MATERIAL_BIND_GROUP}) @binding(104) var cursor_texture_sampler: sampler;
|
||||
|
||||
@fragment
|
||||
fn fragment(
|
||||
in: VertexOutput,
|
||||
) -> FragmentOutput {
|
||||
var out: FragmentOutput;
|
||||
|
||||
// textureSample(material_color_texture, material_color_sampler, in.uv);
|
||||
|
||||
var surface = textureSample(ui_texture, ui_texture_sampler, in.uv);
|
||||
var overlay = textureSample(cursor_texture, cursor_texture_sampler, in.uv);
|
||||
|
||||
var result_rgb = mix(surface.rgb, overlay.rgb, overlay.a);
|
||||
|
||||
out.color = vec4(result_rgb, 1.0);
|
||||
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user