bevyengine / bevyengine/bevy

Mesh thickness prepass textute

Open
#14,487 0 comments 1 reaction 0 assignees View on GitHub
A-Rendering C-Feature
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?

Information about distance to mesh is often used (depth texture), but what about distance through mesh? Local thickness is essential for realistic subsurface shaders (skin, foliage, fruits and more) , volumetric an transmittance rendering. It could be used in post-fx.
Examples:
![Screenshot_141](https://github.com/user-attachments/assets/3fb7d77a-75ad-4dcb-85a1-aa6ea254769d)
![Screenshot_140](https://github.com/user-attachments/assets/f620278e-19f1-402d-b0e5-5159b9d9f2eb)
![Screenshot_139](https://github.com/user-attachments/assets/790be111-5145-4a74-84cc-57f7a9b3606b)

## What solution would you like?

Per-camera texture that hold local distance, that ray passes through mesh, so enter and exit points can be computed using view matrix.

![Screenshot_142](https://github.com/user-attachments/assets/4c7007a6-beda-4c05-bfe2-cf4a1374e09d)

## More information:
1. GDC 2011 "Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look"
http://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/

2. Barre-Brisebois, Colin and Bouchard, Marc. "Real-Time Approximation of Light Transport in
Translucent Homogenous Media", GPU Pro 2, Wolfgang Engel, Ed. Charles River Media, 2011.

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.