bevyengine / bevyengine/bevy

Passthrough Shader Example Needed

Open
#20,547 3 comments 4 reactions 0 assignees View on GitHub
A-Rendering C-Examples D-Modest D-Shaders S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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).

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.