bevyengine / bevyengine/bevy

Adding a plane to examples/custom_material_glsl.rs breaks cube transform

Open
#11,629 2 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
4d 8m
Merged PRs (30d)
147

Description

## Bevy version

0.12.1

```ignore
`AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }`
```

## What you did

Go to tag 0.12.1 and download examples/shaders/custom_material_glsl.rs and move to src/main.rs. Download assets/shaders/custom_material.{frag,vert} and move to the same path in the project. Edit cube's transform to (0.0, 2.0, 0.0). Run it and get
![image](https://github.com/bevyengine/bevy/assets/5964804/9d7e3a33-4c39-47c9-890e-8dbd06c27b85)
add
```
commands.spawn(PbrBundle{
mesh:meshes.add(Mesh::from(shape::Plane{size:10.0, subdivisions:0})),
transform:Transform::IDENTITY,
material:smat.add(StandardMaterial{base_color:Color::DARK_GREEN,..default()}),
..default()
});
```
To the setup function, run it and get

## What went wrong

![image](https://github.com/bevyengine/bevy/assets/5964804/c34ee470-b934-482e-b296-bf7133603efd)

## Additional information

I found this bug while hunting for a minimal setup of a related problem - when I add custom_material_glsl.rs to my existing project with other spawned Pbr bundles I just get

```
ERROR log: Handling wgpu errors as fatal by default
thread 'Compute Task Pool (2)' panicked at /Users/stanislavponomarev/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.17.2/src/backend/direct.rs:3056:5:
wgpu error: Validation Error

Caused by:
In Device::create_render_pipeline
note: label = `prepass_pipeline`
Error matching ShaderStages(VERTEX) shader requirements against the pipeline
Unable to find entry point 'main'
```
Even though I didn't change the shaders and Material code, just added the spawning function to an exiting app.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.