remove unused values from shader storage
This commit is contained in:
parent
142cec1235
commit
803daf17ff
3 changed files with 0 additions and 11 deletions
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
struct VoluMaterial {
|
struct VoluMaterial {
|
||||||
mesh_translation: vec3<f32>,
|
mesh_translation: vec3<f32>,
|
||||||
sphere_radius: f32,
|
|
||||||
color: vec4<f32>,
|
|
||||||
model_inverse: mat4x4<f32>,
|
model_inverse: mat4x4<f32>,
|
||||||
power: f32,
|
power: f32,
|
||||||
iterations: i32,
|
iterations: i32,
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ fn setup(
|
||||||
|
|
||||||
let storage = buffers.add(ShaderStorageBuffer::from(MandelbulbStorage {
|
let storage = buffers.add(ShaderStorageBuffer::from(MandelbulbStorage {
|
||||||
mesh_translation: transform.translation,
|
mesh_translation: transform.translation,
|
||||||
sphere_radius: 1.0,
|
|
||||||
color: Vec4::default(),
|
|
||||||
model_inverse: transform.compute_matrix().inverse(),
|
model_inverse: transform.compute_matrix().inverse(),
|
||||||
power: 8.0,
|
power: 8.0,
|
||||||
iterations: 32,
|
iterations: 32,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ fn update_volu_material(
|
||||||
q: Query<(&Transform, &MeshMaterial3d<MandelbulbMaterial>)>,
|
q: Query<(&Transform, &MeshMaterial3d<MandelbulbMaterial>)>,
|
||||||
mut volu_materials: ResMut<Assets<MandelbulbMaterial>>,
|
mut volu_materials: ResMut<Assets<MandelbulbMaterial>>,
|
||||||
mut buffers: ResMut<Assets<ShaderStorageBuffer>>,
|
mut buffers: ResMut<Assets<ShaderStorageBuffer>>,
|
||||||
time: Res<Time>,
|
|
||||||
) {
|
) {
|
||||||
for (transform, material) in q.iter() {
|
for (transform, material) in q.iter() {
|
||||||
let volu_material = volu_materials.get_mut(material.0.id()).unwrap();
|
let volu_material = volu_materials.get_mut(material.0.id()).unwrap();
|
||||||
|
|
@ -29,12 +28,8 @@ fn update_volu_material(
|
||||||
.get_mut(volu_material.extension.storage.id())
|
.get_mut(volu_material.extension.storage.id())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let elapsed = time.elapsed_secs_wrapped();
|
|
||||||
|
|
||||||
let volu_storage = MandelbulbStorage {
|
let volu_storage = MandelbulbStorage {
|
||||||
mesh_translation: transform.translation,
|
mesh_translation: transform.translation,
|
||||||
sphere_radius: (elapsed.sin() + 3.) / 4.,
|
|
||||||
color: vec4((elapsed.sin() + 1.) / 2., 0.0, 0.0, 1.0),
|
|
||||||
model_inverse: transform.compute_matrix(),
|
model_inverse: transform.compute_matrix(),
|
||||||
power: 8.0,
|
power: 8.0,
|
||||||
iterations: 32,
|
iterations: 32,
|
||||||
|
|
@ -71,8 +66,6 @@ impl MandelbulbExtension {
|
||||||
#[derive(ShaderType, Clone, Default, Debug)]
|
#[derive(ShaderType, Clone, Default, Debug)]
|
||||||
pub struct MandelbulbStorage {
|
pub struct MandelbulbStorage {
|
||||||
pub mesh_translation: Vec3,
|
pub mesh_translation: Vec3,
|
||||||
pub sphere_radius: f32,
|
|
||||||
pub color: Vec4,
|
|
||||||
pub model_inverse: Mat4,
|
pub model_inverse: Mat4,
|
||||||
pub power: f32,
|
pub power: f32,
|
||||||
pub iterations: i32,
|
pub iterations: i32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue