Commit Graph

8 Commits

Author SHA1 Message Date
Бранимир Караџић 72cbe83275 Removed bgfx::setPlatformData usage from entry example harness. 2022-08-25 20:07:03 -07:00
luzpaz 6875e96bcb
Fix various typos (#2719)
Found via `codespell -q 3 -S ./3rdparty,*.ttf -L attribut,ba,clude,conly,indext,inout,lod,nclude,retur,utput`
2022-02-05 11:34:15 -08:00
Бранимир Караџић 4581f14cd4 Happy New Year! 2022-01-15 11:59:06 -08:00
Бранимир Караџић 45234794d9 Don't interact with camera when mouse is over ImGui. 2021-02-05 17:24:56 -08:00
Бранимир Караџић 415d850b01 44-sss: Added screenshot. 2021-01-10 17:53:41 -08:00
Бранимир Караџић 7b8ff41954 44-sss: Fixed build. Use D32F instead D24. 2021-01-10 11:27:13 -08:00
Branimir Karadžić 4c18b80c9d 44-sss: Built shaders and added example to GENie script. 2021-01-10 11:24:28 -08:00
elvencache e5d6a5a22b
xx-sss - Screen Space Shadows (#2350)
* add denoise example

/*
* Implement SVGF style denoising as bgfx example. Goal is to explore various
* options and parameters, not produce an optimized, efficient denoiser.
*
* Starts with deferred rendering scene with very basic lighting. Lighting is
* masked out with a noise pattern to provide something to denoise. There are
* two options for the noise pattern. One is a fixed 2x2 dither pattern to
* stand-in for lighting at quarter resolution. The other is the common
* shadertoy random pattern as a stand-in for some fancier lighting without
* enough samples per pixel, like ray tracing.
*
* First a temporal denoising filter is applied. The temporal filter is only
* using normals to reject previous samples. The SVGF paper also describes using
* depth comparison to reject samples but that is not implemented here.
*
* Followed by some number of spatial filters. These are implemented like in the
* SVGF paper. As an alternative to the 5x5 Edge-Avoiding A-Trous filter, can
* select a 3x3 filter instead. The 3x3 filter takes fewer samples and covers a
* smaller area, but takes less time to compute. From a loosely eyeballed
* comparison, N 5x5 passes looks similar to N+1 3x3 passes. The wider spatial
* filters take a fair chunk of time to compute. I wonder if it would be a good
* idea to interleave the input texture before computing, after the first pass
* which skips zero pixels.
*
* I have not implemetened the variance guided part.
*
* There's also an optional TXAA pass to be applied after. I am not happy with
* its implementation yet, so it defaults to off here.
*/

/*
* References:
* Spatiotemporal Variance-Guided Filtering: Real-Time Reconstruction for
*	Path-Traced Global Illumination. by Christoph Schied and more.
*	- SVGF denoising algorithm
*
* Streaming G-Buffer Compression for Multi-Sample Anti-Aliasing.
*	by E. Kerzner and M. Salvi.
*	- details about history comparison for temporal denoising filter
*
* Edge-Avoiding À-Trous Wavelet Transform for Fast Global Illumination
*	Filtering. by Holger Dammertz and more.
*	- details about a-trous algorithm for spatial denoising filter
*/

* screen space shadows sample

implement screen space shadows. requires deferred rendering or a depth prepass. convert rendered depth to linear depth to skip reconstructing multiple times when doing shadow test.

project light into screen space to find direction from each pixel to the light. walk through screen space texture towards light. sample depth to reconstruct position represented by this sample pixel and compare to position along interpolated ray from pixel to light. if position represented by depth is closer to the eye than the light ray, an initial pixel is in shadow.

specify distance of shadow ray via world units or pixels in screen space.

optionally offset the initial sample position by noise to reduce banding.

demonstrate other ways to reduce hard edge of screen space shadow.

* clean out denoise sample for pull request...

* rename folder to 44- add missing file
2021-01-10 11:20:35 -08:00