diff --git a/assets/shaders/custom_material_chromatic_aberration.wgsl b/assets/shaders/custom_material_chromatic_aberration.wgsl index e09580848f..787947ce10 100644 --- a/assets/shaders/custom_material_chromatic_aberration.wgsl +++ b/assets/shaders/custom_material_chromatic_aberration.wgsl @@ -1,4 +1,4 @@ -#import bevy_pbr::mesh_view_bindings +#import bevy_sprite::mesh2d_view_bindings #import bevy_pbr::utils @group(1) @binding(0) @@ -22,7 +22,7 @@ fn fragment( textureSample(texture, our_sampler, uv + vec2(-offset_strength, 0.0)).g, textureSample(texture, our_sampler, uv + vec2(0.0, offset_strength)).b, 1.0 - ); + ); return output_color; } diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 3d31258a42..cea5c77abd 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -46,7 +46,7 @@ use bevy_utils::{tracing::error, HashMap}; use crate::{ AlphaMode, DrawMesh, Material, MaterialPipeline, MaterialPipelineKey, MeshPipeline, MeshPipelineKey, MeshUniform, RenderMaterials, SetMaterialBindGroup, SetMeshBindGroup, - MAX_DIRECTIONAL_LIGHTS, + MAX_CASCADES_PER_LIGHT, MAX_DIRECTIONAL_LIGHTS, }; use std::{hash::Hash, marker::PhantomData}; @@ -211,6 +211,10 @@ where "MAX_DIRECTIONAL_LIGHTS".to_string(), MAX_DIRECTIONAL_LIGHTS as i32, )); + shader_defs.push(ShaderDefVal::Int( + "MAX_CASCADES_PER_LIGHT".to_string(), + MAX_CASCADES_PER_LIGHT as i32, + )); if layout.contains(Mesh::ATTRIBUTE_UV_0) { shader_defs.push("VERTEX_UVS".into());