Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion renderer/shaders/gpu_particles.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct TriAttr { n0: vec4<f32>, n1: vec4<f32>, n2: vec4<f32>, uv: vec4<f32>, t:
@group(0) @binding(9) var<storage, read> spawns: array<vec4<f32>>;
@group(0) @binding(10) var<storage, read> grid: array<u32>;

const OBJECT_STRIDE: u32 = 3u; // scene.rs OBJECT_STRIDE (particles' objects; no instance colours with them)
const OBJECT_STRIDE: u32 = 3u; // scene.rs `object_stride`: gpu.rs writes 4 here in a scene with instance colours

fn pcg(v: u32) -> u32 {
let s = v * 747796405u + 2891336453u;
Expand Down
2 changes: 1 addition & 1 deletion renderer/shaders/particles.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct System { a: vec4<u32>, b: vec4<u32>, c: vec4<f32>, p: array<vec4<f32>, 8>
// The translucent particles' BLAS input (gpu.rs `Translucent`).
@group(0) @binding(8) var<storage, read_write> tblas: array<f32>;

const OBJECT_STRIDE: u32 = 3u; // scene.rs OBJECT_STRIDE
const OBJECT_STRIDE: u32 = 3u; // scene.rs `object_stride`: gpu.rs writes 4 here in a scene with instance colours

fn pcg(v: u32) -> u32 {
let s = v * 747796405u + 2891336453u;
Expand Down
2 changes: 1 addition & 1 deletion renderer/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ pub fn build(w: &World, assets: &Path, presets_dir: &Path, overrides: Option<&se
// Instanced objects' shared meshes by (geometry, GPU material); their flattened instances' triangle ranges.
let mut inst_mesh_of: HashMap<(u32, u32), u32> = HashMap::new();
let mut tri_instances: Vec<(u32, u32, u32)> = vec![];
// Instance colours anywhere: object entries of 4 vec4s, and the kernel's F_TINT (gpu.rs `tinted_source`).
// Instance colours anywhere: object entries of 4 vec4s, and the kernel's F_TINT.
let tinted = w.instanced.iter().any(|(id, t)| t.colors.is_some() && w.shown(*id) && matches!(w.objects.get(id).map(|o| &o.kind), Some(Kind::Instanced { .. })));
let stride = object_stride(tinted);
for id in &order {
Expand Down