SIGN IN SIGN UP
bevyengine / bevy UNCLAIMED

A refreshingly simple data-driven game engine built in Rust

0 0 59 Rust

Alpha discard (#11895)

# Objective

I want to call the `pbr_functions::alpha_discard` shader function from
my own material shader, but it only takes a `StandardMaterial`
parameter.

## Solution

This PR replaces the `StandardMaterial` parameter with less restrictive
ones so my shader can call it.

---

## Changelog

- The signature of `pbr_functions::alpha_discard` changed by replacing
`StandardMaterial` with only the `flags` and `alpha_cutoff` fields.

## Migration Guide

Replace this:

```wgsl
pbr_functions::alpha_discard(material, ...);
```

with this:

```wgsl
pbr_functions::alpha_discard(material.flags, material.alpha_cutoff, ...);
```

---------

Co-authored-by: Duncan Fairbanks <duncanfairbanks6@gmail.com>
D
Duncan committed
afd576f380c24b1da3d4c4051281b7bbd201ad6b
Parent: 6603a29
Committed by GitHub <noreply@github.com> on 5/21/2026, 8:49:32 AM