Commit Graph

7829 Commits

Author SHA1 Message Date
Бранимир Караџић
e14a070c29 Updated spirv-headers. 2021-01-27 15:15:31 -08:00
Бранимир Караџић
93efa0c36b Updated glslang. 2021-01-27 14:56:11 -08:00
Бранимир Караџић
fc99801806 Removed glslang build files. 2021-01-27 14:45:28 -08:00
Бранимир Караџић
16f441758f Fixed #2368. 2021-01-25 12:24:12 -08:00
Бранимир Караџић
d8cfb8f64d Fixed issue #2368. 2021-01-22 07:33:59 -08:00
Бранимир Караџић
e769cd7e9f Updated ImGui. 2021-01-21 12:23:03 -08:00
Бранимир Караџић
7783eb8169 Updated ImGui. 2021-01-20 19:02:16 -08:00
Бранимир Караџић
3773e66dda Fixed build. 2021-01-19 16:26:47 -08:00
Hugo Amnov
a515dd3c3d
WebGPU update (#2364)
* Update WebGPU renderer to match new state of API

* Update WebGPU files
2021-01-19 15:18:30 -08:00
kingscallop
5a6c1361ce
Fix compute on Vulkan when there is only one buffer but no uniforms (#2359)
When using this compute shader, the following validation errors appear.
This patch fixes the issue.

BUFFER_WR(cBuffer, uint, 1);

NUM_THREADS(1u, 1u, 1u)
void main()
{
	cBuffer[0] = 0u;
}

../../../src/renderer_vk.cpp (628): BGFX ---E-       CommandBuffer,
Validation, 0: Validation Error: [
VUID-vkCmdBindDescriptorSets-dynamicOffsetCount-00359 ] Object 0: handle =
0x7fffe453ec88, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID =
0x82756c54 | vkCmdBindDescriptorSets(): Attempting to bind 1 descriptorSets
with 0 dynamic descriptors, but dynamicOffsetCount is 1. It should exactly
match the number of dynamic descriptors. The Vulkan spec states:
dynamicOffsetCount must be equal to the total number of dynamic descriptors
in pDescriptorSets
(https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/
vkspec.html#VUID-vkCmdBindDescriptorSets-dynamicOffsetCount-00359)

../../../src/renderer_vk.cpp (628): BGFX ---E-            Pipeline,
Validation, 0: Validation Error: [ VUID-vkCmdDispatch-None-02697 ] Object 0:
handle = 0xcd00000000cd, type = VK_OBJECT_TYPE_PIPELINE; Object 1: handle =
0x630000000063, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; Object 2:
VK_NULL_HANDLE, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; | MessageID =
0xfd9e3152 | vkCmdDispatch(): VkPipeline 0xcd00000000cd[] defined with
VkPipelineLayout 0x630000000063[] is not compatible for maximum set
statically used 0 with bound descriptor sets, last bound with
VkPipelineLayout 0x0[] The Vulkan spec states: For each set n that is
statically used by the VkPipeline bound to the pipeline bind point used by
this command, a descriptor set must have been bound to n at the same
pipeline bind point, with a VkPipelineLayout that is compatible for set n,
with the VkPipelineLayout used to create the current VkPipeline, as
described in Pipeline Layout Compatibility
(https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/
vkspec.html#VUID-vkCmdDispatch-None-02697)

../../../src/renderer_vk.cpp (628): BGFX ---E-       CommandBuffer,
Validation, 0: Validation Error: [
UNASSIGNED-CoreValidation-DrawState-DescriptorSetNotBound ] Object 0: handle
= 0x7fffe453ec88, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID =
0xcde11083 | VkPipeline 0xcd00000000cd[] uses set #0 but that set is not
bound.
2021-01-16 14:00:40 -08:00
kingscallop
758566b3af
Make the provoking vertex consistent across OpenGL, D3D and Vulkan (#2360)
The default provoking vertex on OpenGL is the last of a triangle, but
on D3D and Vulkan it is the first.

This patch sets the provoking vertex to the first vertex on OpenGL.
2021-01-16 13:59:28 -08:00
kingscallop
26c3768cac
Fix typo in bgfx_shader.sh (#2361) 2021-01-16 13:58:32 -08:00
Бранимир Караџић
eab0833b82 Updated spirv-cross. 2021-01-15 20:33:57 -08:00
Бранимир Караџић
a867d872f4 Updated spirv-tools. 2021-01-15 20:33:45 -08:00
Бранимир Караџић
630263d1cb Updated ImGui. 2021-01-15 20:30:58 -08:00
Бранимир Караџић
9e7273506a Updated meshoptimizer. 2021-01-15 20:30:24 -08:00
Бранимир Караџић
af49c5d264 Happy New Year! 2021-01-14 15:53:49 -08:00
MooZ
465c13ad37
Set profile id for metal and pssl to avoid d3d9 codepath. (#2355) 2021-01-13 07:10:23 -08:00
Бранимир Караџић
6b061ffd4e Updated README. 2021-01-11 23:02:06 -08:00
Бранимир Караџић
415d850b01 44-sss: Added screenshot. 2021-01-10 17:53:41 -08:00
Бранимир Караџић
b6ae2d2709 Cleanup. 2021-01-10 14:44:30 -08:00
Бранимир Караџић
7b8ff41954 44-sss: Fixed build. Use D32F instead D24. 2021-01-10 11:27:13 -08:00
Бранимир Караџић
743682db67 Updated meshoptimizer. 2021-01-10 11:25:34 -08:00
Бранимир Караџић
9f5ebeefa4 Updated spirv-cross. 2021-01-10 11:25:26 -08:00
Бранимир Караџић
3c4d81c3b8 Updated spirv-tools. 2021-01-10 11:25:12 -08:00
Бранимир Караџић
b21fdb3718 Updated glslang. 2021-01-10 11:24:56 -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
Бранимир Караџић
d4fbcb113c Updated ImGui. 2021-01-09 13:52:11 -08:00
Alex-MSFT
68f79970e1
Don't skip reset if platform data has changed. (#2347)
(cherry picked from commit 8c4cc84c62)
2021-01-07 16:56:57 -08:00
Бранимир Караџић
e1c2834fc0 travisci: Build OSX debug only to avoid timeout. 2021-01-05 10:56:02 -08:00
Бранимир Караџић
3202330daa 43-denoise: Removed alpha from screenshot. 2021-01-02 11:35:21 -08:00
Бранимир Караџић
fa3aed3b0b 43-denoise: Updated references. 2021-01-02 11:23:13 -08:00
Бранимир Караџић
cbccb2386a 43-denoise: Style cleanup. Added screenshot. 2021-01-02 11:12:45 -08:00
Бранимир Караџић
27de3100b7 43-denoise: Switched depth to D32F format. 2021-01-02 10:52:19 -08:00
Бранимир Караџић
0170399cf6 Merge branch 'master' of github.com:bkaradzic/bgfx 2021-01-02 10:47:37 -08:00
Branimir Karadžić
4760628bb1 43-denoise: Added shaders. 2021-01-02 10:46:43 -08:00
elvencache
a33ca71bcf
add denoise example (#2344)
/*
* 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
*/
2021-01-02 10:42:02 -08:00
Бранимир Караџић
39424491df TravisCI: OSX build name is osx-x64. 2020-12-31 18:26:30 -08:00
Бранимир Караџић
76f3e0590f OSX: Added separate osx-arm64 build configuration. 2020-12-31 18:17:39 -08:00
Бранимир Караџић
3bc0362ed2 TravisCI: Just build x86-64 on OSX. 2020-12-30 20:24:27 -08:00
Sandy
6072d4eda0
shaderc_glsl: parse int samplers like float samplers (#2341) 2020-12-30 15:58:39 -08:00
Бранимир Караџић
1f4da1e459 Fixed warning. 2020-12-28 19:36:23 -08:00
Бранимир Караџић
0f0a664a47 Cleanup. 2020-12-28 17:27:50 -08:00
Бранимир Караџић
c2b7ffe2e7 Updated SPIR-V and Metal shaders. 2020-12-28 13:01:44 -08:00
Бранимир Караџић
ed48498911 Disabled imguizmo is over test. 2020-12-28 12:57:46 -08:00
Бранимир Караџић
f232f93017 Added build rule to examples makefile. 2020-12-28 11:58:03 -08:00
MooZ
d65dac2000
Shaderc OpenGL fixes. (#2317)
* Reworked profile cli argument.

* Added missing GLSL profile.

* Fixed essl shader preambule.

* Fixed uniform "parsing" and hlsl profiles.

* Reworked hlsl profiles.

* Fixed missing extension for gl_FragDepth.

* Cleanup.

* Removed version preamble and reverted shadow samplers translation.

* Fixed HLSL profile tests.
2020-12-28 11:24:49 -08:00
Бранимир Караџић
197c1ced3b Included ImGuizmo to ImGui::MouseOverArea test. 2020-12-27 21:28:07 -08:00
Бранимир Караџић
11acd61b04 Updated ImGui. 2020-12-27 20:22:58 -08:00