Skip to content

Entities with transparent materials that share the same mesh use the wrong material when GPU preprocessing is off #19335

@jf908

Description

@jf908

Bevy version

0.16 and main

Relevant system information

Repros on both Windows + macOS

AdapterInfo { name: "NVIDIA GeForce RTX 3070 Ti Laptop GPU", vendor: 4318, device: 9440, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "576.52", backend: Vulkan }
AdapterInfo { name: "Apple M4", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }

What you did

Render two objects with different materials but the same mesh

Repro: https://github.com/jf908/bevy-material-bug.git

If you enable GPU preprocessing by removing these lines, it works again:

What went wrong

If it's not clear, break this out into:

Expected:

Image

Actual:

Image

Additional information

Removing these lines (enabling GPU preprocessing) works again:

app.sub_app_mut(RenderApp)
    .insert_resource(GpuPreprocessingSupport {
        max_supported_mode: GpuPreprocessingMode::None,
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions