5

I'm a newbie to shaders, and I'm trying to build a vertex colored shader in Bevy. Fortunately one of the bevy examples goes through how to use a custom shader, and creates a vertex colored shader, but unfortunately it doesn't show lighting anymore! Here's the example for reference: https://github.com/bevyengine/bevy/blob/main/examples/shader/mesh_custom_attribute.rs

I want to use the custom attributes as shown in the example, but I still need lighting to work (properly shaded faces). Any help is super appreciated!

Joe Fioti
  • 421
  • 4
  • 15
  • 1
    You might be able to replicate the [pbr shader](https://github.com/bevyengine/bevy/blob/46cae5956f8535a7b24372fec4911704a942e8a4/crates/bevy_pbr/src/render_graph/pbr_pipeline/pbr.frag)? – TheChubbyPanda Aug 30 '21 at 09:23

1 Answers1

0

You need to replicate the relevant parts from the PBR shader. Take a look at my approach here for inspiration.

Jan Hohenheim
  • 3,552
  • 2
  • 17
  • 42