Files
bevy-tape-drive/crates/bevy_tape_load/src/render/spatial_implicit.wesl
T

11 lines
539 B
Plaintext

import package::render::metadata_types::TapeMetadata;
// This is to work around that you can't pass textures as parameters, it seems.
@group(0) @binding(4) var spatial_textures: binding_array<texture_3d<f32>>;
@group(0) @binding(5) var spatial_texture_sampler: sampler;
fn spatial_scene(metadata: TapeMetadata, spatial_texture: u32, p: vec4<f32>) -> f32 {
let actual = (p.xyz - metadata.lowest_corner) / metadata.dimensions;
return textureSampleLevel(spatial_textures[spatial_texture], spatial_texture_sampler, actual, 0.0).x;
}