Passthrough Shader Example Needed
What problem does this solve or what need does it fill?
When we write a shader we lose the default material shading by default. It would be good to know how to write a passthrough shader. Writing shaders that extend the default shaders should be simple.
What solution would you like?
An example with both vertex and fragment shaders that are passing through default shader behaviour would be very helpful to people new to writing shaders.
What alternative(s) have you considered?
Not writing custom shaders and trying to achieve visual effects by other means.
Additional context
Some of the existing shaders from the other examples can be helpful to nearly achieve passthrough shading. I've tried functions like mesh_position_local_to_world and apply_pbr_lighting, but I still don't know the correct combination to achieve a passthrough that achieves the default shading. If I have a cube the sides should be shaded at different levels on each side as determined by the light sources as they are by default (if that's what I want to achieve).
Agree. I've been looking for examples around the internet, but none of them seem to work (maybe outdated?), specially for the vertex part.
I'm sorry if i've misunderstood, but is it possible you're referring to what bevy calls MaterialExtension - where you rely mostly on bevys StandardMaterial with a shader that changes it slightly/extends it?
This is an official example: https://bevy.org/examples/shaders/extended-material/ (you'll have to make sure to select the correct version tag when viewing examples on GitHub directly, while the site shows the latest version)
A more complex 3rd party example can be found here: https://github.com/rust-adventure/bevy-examples/tree/main/examples/dissolve-sphere-standard-material-extensions