Screenspace Data Example

December 28, 2022 ยท View on GitHub

Hey gamers here is an example showing a geometry shader encoding multiple per-vertex attributes into a grid of screenspace pixel blocks. This exports the data directly without the need for cameras.

This data is captured into a CRT through the use of a grabpass where a different shader can perform arbitrary computations on said data.

Then we read the result of said computations to mesh attributes when actually drawing the mesh.

img

Credits:

CNLohr: CRT read/write boilerplate.

MerlinVR: Functions for encoding and decoding screenspace data. See float3's gist.

Pema99: Helpful articles and tips.