Commit Graph

2227 Commits

Author SHA1 Message Date
Paul Gruenbacher 5b4a6dc330
Fix bad delete in font_manager.cpp (#2703)
Fix alloc-dealloc-mismatch (operator new [] vs operator delete
2022-01-03 12:52:53 -08:00
Бранимир Караџић 946852cec8 Fixed issue #2696. 2021-12-26 09:02:48 -08:00
XXxR4GALXxx be3cfd1bd9
Fix "GDI resource leak". (#2694)
"When you no longer need the HBRUSH object, call the DeleteObject function to delete it."
https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createsolidbrush
👍
2021-12-25 13:45:19 -08:00
Raziel Alphadios 16ee93b88d
Change TTF init asserts to warns and add some details to the output (#2681)
Co-authored-by: Raziel Alphadios <raziely@gmail.com>
2021-12-08 14:27:13 -08:00
simon chen 5cbaa3bdcd
remove duplicate code (#2679) 2021-12-07 08:55:19 -08:00
Aleš Mlakar 130bc00608
shaderc: Ignore .@data uniforms when compiling for metal (#2677)
Co-authored-by: Aleš Mlakar <ales.ambits@gmail.com>
2021-12-06 09:39:05 -08:00
Aleš Mlakar f0a38398ae
40-svt: Use BGFX_TEXTURE_BLIT_DST when creating Atlas and Page Table textures so they can be blit to (#2678)
Co-authored-by: Aleš Mlakar <ales.ambits@gmail.com>
2021-12-06 09:38:23 -08:00
Бранимир Караџић 3b1f74bb51 09-hdr: Fixed texture creation. 2021-12-06 08:41:23 -08:00
Бранимир Караџић 73acc9e59b 41-tess: Updated GL shaders. 2021-11-21 07:58:19 -08:00
Бранимир Караџић 17bb4dce49 08-update: Fixed BC texture update. 2021-11-11 15:21:59 -08:00
DarkContact 08b8252f73
Fix font rendering (#2653)
* Fix subpixel font rendering

* remove const
2021-11-09 14:35:48 -08:00
Бранимир Караџић 796d1ceb39 08-update: Cleanup. 2021-11-01 18:27:27 -07:00
Бранимир Караџић 2df0a41918 08-update: Added blit test. 2021-11-01 08:43:22 -07:00
Raziel Alphadios 094d34194c
Cleanup: change POD casts from static_cast to functional/ctor casts, for consistency (#2648)
Co-authored-by: Raziel Alphadios <raziely@gmail.com>
2021-10-31 15:54:10 -07:00
Бранимир Караџић b2d13fc3b8 21-deferred: Fixed uniform leak. 2021-10-28 18:43:09 -07:00
Branimir Karadžić 1d0d9b7149 21-deferred: Rebuilt shaders. 2021-10-28 18:40:46 -07:00
pezcode d32d3b19b6
Fix 21-deferred with texture array frame buffer (#2646) 2021-10-28 16:46:57 -07:00
Бранимир Караџић e71ffa0016 Cleanup. 2021-10-27 17:00:39 -07:00
Raziel Alphadios 9cc470a390
Fix C5055 warnings on C++20 and up (#2637)
* Fix C5055 (operator 'operator-name': deprecated between enumerations and floating-point types) warnings on C++20 and up

* Changed static_casts to functional-style casts

Co-authored-by: Raziel Alphadios <raziely@gmail.com>
2021-10-27 09:33:03 -07:00
Бранимир Караџић 67f462eee8 Cleanup. 2021-10-26 18:44:37 -07:00
Бранимир Караџић 53772163f4 Added cmdRemove. 2021-10-26 18:20:35 -07:00
Бранимир Караџић 948d137dfd Merge branch 'master' of github.com:bkaradzic/bgfx 2021-10-25 18:59:59 -07:00
Бранимир Караџић 8392a44b3a Fixed assert macros, and improved error handling. 2021-10-25 18:59:32 -07:00
Branimir Karadžić 4f1b3f8a1b 37-gpudrivenrendering: Rebuilt shaders. 2021-10-22 11:33:10 -07:00
Tom Schroeder 6573fc44a8
Modified handle initialization to fix compilation error (clang-osx) (#2629) 2021-10-17 15:21:57 -07:00
Бранимир Караџић c5d1a1a8e3 Moving bounds from bgfx to bx. 2021-10-16 10:41:42 -07:00
Richard Schubert ffeba57b8a
Fix FSR (#2628)
* Clear full framebuffer

* Fix type coercion

* Use bgfx API properly

* Remove redundant calls
2021-10-15 07:36:46 -07:00
Бранимир Караџић a1d2c03eba Cleanup. 2021-10-14 21:03:34 -07:00
Бранимир Караџић 84a38eede0 Cleanup. 2021-10-13 19:54:27 -07:00
Бранимир Караџић 6921fc3438 Cleanup. 2021-10-08 19:06:53 -07:00
Branimir Karadžić 5890cef12b 46-fsr: Updated screenshot. 2021-10-06 18:05:00 -07:00
Branimir Karadžić 4717192086 Updated makefile. 2021-10-06 17:40:32 -07:00
Branimir Karadžić 778dffb6ee 46-fsr: Built shaders. 2021-10-06 17:40:15 -07:00
Branimir Karadžić ad8eb09cf6 Fixed warnings. 2021-10-06 17:39:48 -07:00
Бранимир Караџић 58441ea499 Cleanup. 2021-10-05 19:42:44 -07:00
Richard Schubert fc513e163b
Add new Example - AMD FidelityFX-FSR (#2612)
* Add new sample

* Add FSR shaders

* Add example template

* Add Antialiasing

* Add multi resolution rendering

* Implement magnifier

* Implement FSR EASU pass

* Implement FSR RCAS pass

* Improve wording of comments and UI

* Remove use of ffx_a.h in cpp

* Remove example external files

* Perform bilinear upsampling by compute shader

* Add FSR 16 Bit support

* Improve magnifier picking

* Fix magnifier picking

* Render magnifier widget

* Renaming of stuff

* Separate magnifier functionality

* Move FSR into separate class

* Reduce scope of FSR resources

* Fix FSR for Vulkan

* Fix OpenGL support

* Update sample screenshot
2021-10-05 09:01:50 -07:00
Бранимир Караџић f50d84da52 Rebuilt SPIR-V shaders. 2021-10-02 11:31:52 -07:00
Бранимир Караџић 3c9591d9f9 Cleanup. 2021-09-25 22:30:42 -07:00
Бранимир Караџић 23994e7f23 Bounds: Overlap aabb/obb, and obb/obb. 2021-09-25 19:20:06 -07:00
Бранимир Караџић f1ddf67114 Added initializer types. 2021-09-06 09:03:26 -07:00
Бранимир Караџић ee0fbea726 Added AGC renderer stub. 2021-08-24 19:35:09 -07:00
pezcode ec7cb7608e
Fix textureGather in example 39 (#2596) 2021-08-24 19:30:27 -07:00
Бранимир Караџић 568ee4ceac Cleanup. 2021-08-18 09:27:12 -07:00
DarkContact 8f60971dd6
fix deadlock and remove unused bx::Error (#2589) 2021-08-18 09:22:55 -07:00
Martijn Courteaux 078666d373
Allow to create a nvg texture from a BGFX texture. (#2548) 2021-06-25 13:29:51 -07:00
Бранимир Караџић e0d26507dc Added BGFX_CONFIG_ENCODER_API_ONLY configuration setting to enable/disable non-encoder API. 2021-06-11 08:05:58 -07:00
Branimir Karadžić f569fe32a6 Rebuilt all embedded shaders. 2021-06-06 14:51:46 -07:00
kingscallop 6440d669a8
Add missing examples in makefile (#2534) 2021-06-05 13:56:29 -07:00
kingscallop 1ab27e277b
Fix hardcoded bgfx dir from include paths in makefiles (#2532)
Only these four makefiles had these hardcoded paths.
All other makefiles don't specify the bgfx dir name.
2021-06-05 13:55:19 -07:00
Бранимир Караџић ed645ff01a Bounds: Moved pass-thru funcs into .inl header. 2021-06-05 10:29:59 -07:00
Бранимир Караџић b8dc216fa0 Cleanup. 2021-06-05 07:56:20 -07:00
simon chen 0b179e59e2
fixed GLES3 bug, when "EGL_KHR_create_context" doesn't exist. (#2529)
* fixed gles3 bug

* fixed sdl bug on android platform
2021-06-05 07:54:14 -07:00
Branimir Karadžić daa4f9d627 Updated shaders. 2021-05-18 20:36:03 -07:00
Бранимир Караџић 3214539bad Fixing WebGL + Android instancing. 2021-05-18 20:22:46 -07:00
Бранимир Караџић c42a3a5d4d Cleanup. 2021-05-08 07:29:50 -07:00
Daniel Collin c9bf791eaa
Fixed multiview issues with dear imgui (#2511)
When using the multview / docking feature of dear imgui (availible on the main repo in the docking branch) dear imgui will use desktop relative coordinates instead of window relative. This causing the rendering to get "offseted" if not handled correctly.
Before this change the rendering matrix wasn't used at all and this has now been changed in the vertex shader.

Notice this change is fully backwards compatible with the relative windows as well as the upper left corner will always be set to 0,0 in that case thus this change will work with both versions.

I also added some changes to skip rendering if not needed (based on the the other backend implementations for dear imgui such as the OpenGL one)
2021-05-08 07:26:06 -07:00
Бранимир Караџић 67e628d8e3 Cleanup. 2021-04-25 20:23:36 -07:00
pezcode e8d4b3dcce
Fixes for multiple windows and example 22 (#2483) 2021-04-19 15:30:03 -07:00
Бранимир Караџић 19fe73d00d Cleanup. 2021-04-18 21:16:56 -07:00
Hugo Amnov daad11fa0c
Fix 43-denoise when FB format invalid (#2480) 2021-04-18 21:14:57 -07:00
Hugo Amnov a176685a2c
Cleanup imgui shaders (#2479)
* Remove unused Imgui shaders

* Cleanup Imgui shaders position attribute
2021-04-18 12:58:00 -07:00
Бранимир Караџић c3b8ec0dd0 Revert "Cleanup imgui shaders (#2476)"
This reverts commit 01b7fc0105.
2021-04-18 11:43:51 -07:00
Hugo Amnov 01b7fc0105
Cleanup imgui shaders (#2476)
* Remove unused Imgui shaders

* Cleanup Imgui shaders position attribute
2021-04-18 11:39:42 -07:00
pezcode eec0fcd867
Remove unused attributes in debug draw shaders (#2468) 2021-04-11 18:26:23 -07:00
Бранимир Караџић 9ec2472763 Cleanup. 2021-04-07 20:07:28 -07:00
pezcode 870d14110b
Vulkan: allow writing to gl_FragColor without framebuffer color attachment (#2452) 2021-04-07 07:21:02 -07:00
pezcode 9a91bc3496
Fix example 31-rsm Vulkan shaders (#2453) 2021-04-06 19:46:26 -07:00
Бранимир Караџић 1fb245c581 Cleanup. 2021-04-02 12:51:59 -07:00
Бранимир Караџић 0df2e90edb Cleanup. 2021-04-01 20:09:16 -07:00
Branimir Karadžić 117b5ec4ee 05-instancing: Fixed update logic. 2021-04-01 19:16:13 -07:00
Vladimir Vukicevic cb77d3bb46
Fix crash when hitting max draw call limit (#2440)
* Expand instancing demo to have non-instanced path

* Fix count vs. index off by one error when hitting max draw calls
2021-04-01 19:03:01 -07:00
Бранимир Караџић 453adcf661 Replaced D24* with D32F depth format. 2021-02-25 19:44:13 -08:00
Branimir Karadžić 35b7bacfb9 Rebuilt embedded shaders. 2021-02-25 19:33:34 -08:00
Бранимир Караџић b5afc2c81c Updated ImGui. 2021-02-10 22:28:11 -08:00
Бранимир Караџић 45234794d9 Don't interact with camera when mouse is over ImGui. 2021-02-05 17:24:56 -08:00
Branimir Karadžić 3e30d7f42f Updated shaders. 2021-02-04 20:35:37 -08:00
Branimir Karadžić 820e0a0e03 Updated shaders. 2021-02-04 20:33:42 -08:00
elvencache 7f758a06a7
Improve Bokeh example (#2377)
* display bokeh sample pattern, add bokeh shape, improve look

draw sample pattern to texture and display in ui to see number of samples and their arrangment

add bokeh shape controls

remove adhoc 'sqrt' pattern since display makes existing pattern easier to understand and it looks nicer.

switch to floating point color texture and leave lighting results in linear space until after dof is performed. provides better results and bright spots can make more noticeable bokeh shapes.

change default values to use take more samples at reduced resolution so initial experience when loading the sample is better looking image

* update screenshot, minor change to ui

fix height of ui element so scrollbar not required by default layout
update screenshot

* fix typo in texturev

atleast, i'm pretty sure that's a typo don't see a reason to set width twice
2021-02-04 20:28:54 -08:00
Бранимир Караџић eee065c59f 45-bokeh: Fixed OSX build. 2021-02-02 19:05:14 -08:00
XxXSVVPXxXx e068453b53
Update entry_android.cpp (#2375)
- Fix Android Building
- "entry_android.cpp:157:29: error: no member named 'kErrorRederWriterEof' in namespace 'bx'; did you mean 'kErrorReaderWriterEof'?"
2021-02-01 09:08:19 -08:00
Бранимир Караџић b92860be23 45-bokeh: Added screenshot. 2021-01-31 15:47:11 -08:00
Бранимир Караџић 298ffe0968 45-bokeh: Fixed build. 2021-01-31 10:09:22 -08:00
Branimir Karadžić 1401a5333d 45-bokeh: Built shaders and added example. 2021-01-31 10:07:49 -08:00
elvencache 4d272f4104
bokeh depth of field (#2372)
* Implement bokeh depth of field

Implement bokeh depth of field as described in the blog post here:
https://blog.tuxedolabs.com/2018/05/04/bokeh-depth-of-field-in-single-pass.html

Additionally, implement the optimizations discussed in the closing paragraph. Apply the effect in multiple passes. Calculate the circle of confusion and store in the alpha channel while downsampling the image. Then compute depth of field at this lower res, storing sample size in alpha. Then composite the blurred image, based on the sample size. Compositing the lower res like this can lead to blocky edges where there's a depth discontinuity and the blur is just enough. May be an area to improve on.

Provide an alternate means of determining radius of current sample when blurring. I find the blog post's sample pattern to be difficult to directly reason about. It is not obvious, given the parameters, how many samples will be taken. And it can be very many samples. Though the results are good. The 'sqrt' pattern chosen here looks alright and allows for the number of samples to be set directly. If you are going to use this in a project, may be worth exploring additional sample patterns. And certainly update the shader to remove the pattern choice from inside the sample loop.

* fix typo in shader of denoise example

copy/paste error, applying y offset to x component instead
2021-01-31 09:59:55 -08:00
Бранимир Караџић af49c5d264 Happy New Year! 2021-01-14 15:53:49 -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
Бранимир Караџић 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
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
Бранимир Караџић 1f4da1e459 Fixed warning. 2020-12-28 19:36:23 -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
Бранимир Караџић 90381661e1 36-sky: Removed utf-8 characters from comments. 2020-12-27 09:03:58 -08:00
Бранимир Караџић c95eca2a4b Don't update camera when mouse is over imgui. 2020-12-26 22:46:26 -08:00
Бранимир Караџић 4224dcf2b2 Cleanup. 2020-12-20 22:42:16 -08:00
Бранимир Караџић c5db87d87a Fixed cubemap test texture. 2020-12-17 19:47:44 -08:00
Бранимир Караџић 263415b887 Cleanup. 2020-12-16 13:50:47 -08:00
Branimir Karadžić 5c304dad3b Fixed issue #2330. Added support for 32-bit indices in transient index buffer. 2020-12-15 19:01:25 -08:00
Бранимир Караџић 2427d870d0 Cleanup. 2020-12-13 17:04:55 -08:00
Josh Jensen c103383f6f
Add SDF font outlines, drop shadows, and image glyphs (#2325)
* Implement SDF font outlines, drop shadows, and image glyphs

* Update 11-fontsdf to showcase the SDF outlines, drop shadows, and image glyphs

Co-authored-by: Josh Jensen <josh@everrush.com>
2020-12-13 17:02:36 -08:00
Бранимир Караџић 89362944b1 GLFW: Use glfwWaitEventsTimeout instead glfwWaitEvents and posting empty events. 2020-12-08 19:11:18 -08:00
Бранимир Караџић 01b0c00780 entry: Fixed X11 setWindowTitle to display UTF-8 properly. 2020-12-03 07:54:12 -08:00
Бранимир Караџић 8ea8832341 Cleanup. 2020-11-29 18:50:10 -08:00
Бранимир Караџић 35a9771c34 entry: Fixed reset logic. 2020-11-29 15:11:37 -08:00
Бранимир Караџић 86583e9bbd Cleanup. 2020-11-25 22:29:40 -08:00
Бранимир Караџић 3d01e274ff Added cubemap test texture. 2020-11-25 16:20:37 -08:00
Бранимир Караџић 2b4bf6d913 Metal: Fixed screenshot. 2020-11-10 17:14:54 -08:00
Cedric Guillemet e06dd2435e
gcc fix warning (#2295)
error: extra ‘;’ [-Werror=pedantic]
2020-10-23 07:44:18 -07:00
Federico Bertola d4b518ecae
Fixed reference to 'sqrt' (#2293) 2020-10-21 06:59:51 -07:00
Бранимир Караџић 626ca46aa0 Bounds: Overlap cone/plane. 2020-10-17 22:16:18 -07:00
Бранимир Караџић 3a8e0e2bb1 Fixed blit on cubemaps. 2020-10-09 20:47:50 -07:00
Бранимир Караџић adf93db26b Updated ImGui. 2020-10-09 08:50:40 -07:00
Branimir Karadžić 729c6b98ed Rebuilt shaders. 2020-10-04 22:39:41 -07:00
kingscallop 436b7fab9e
Adds UAV support for D3D12, Vulkan and reworked for OpenGL, D3D11 (#2119)
* Adds UAV support for D3D12, Vulkan and reworked support for OpenGL, D3D11

UAV support is now uniform across compute and draw.
To set a UAV you just use bgfx::setImage() and IMAGE2D in the shader, just like in compute.
Due to these changes shaders will have to be recompiled.

The changes include:
	- D3D11 requires patching of the UAV slot number (which is now done by modifying the DXBC instead of using a macro)
	- If the DXBC binary includes a debug chunk, that is also patched to match the new slot number
	- All the other renderers don't need any kind of patching
	- There are some shader annotations to better convert the UAV format used in hlsl to spirv

Possibility of further enhancements:
	- bgfx::setViewFrameBuffer() only supports binding to a framebuffer or, using BGFX_INVALID_HANDLE, to bind the default backbuffer. This doesn't allow for the case where there is no need to bind to either one of them, for example when using a fragment shader only to read and write to an UAV.

* Bump shader version, because they need to be recompiled.
2020-10-04 21:51:41 -07:00
Бранимир Караџић b2259d7c11 Updated screenshots. 2020-09-19 20:05:25 -07:00
Branimir Karadžić 73508ac80f Fixed warnings. 2020-09-07 10:06:47 -07:00
Бранимир Караџић 66deeb10c2 21-deferred: Fixed depth format selection. 2020-09-05 12:15:07 -07:00
Wencey Wang 0093a67681
Fix Windows ARM build (#2254) 2020-09-02 08:31:39 -07:00
Бранимир Караџић 4d4ef74fe6 Fixed GCC warning.: 2020-09-01 20:21:58 -07:00
kingscallop ba3be9affd
Fixes example 42 (#2235)
Because example 42 was using the shaders from example 07 (callback), which have
input vertex attributes position and color, while the mesh from example 42 has
attributes position and normal, this causes problems on Windows when using
AMD gpus (no bunny mesh would appear on the window).
2020-08-16 11:44:00 -07:00
kingscallop e5d25a7d88
Fixes example 41 on OpenGL (#2234)
The glsl function findMSB is overriden, causing an error on Windows and Linux
when running on AMD or Intel gpus. Nvidia, for whatever reason, seems to allow
overriding the function.
2020-08-16 11:43:28 -07:00
kingscallop a39b14cacc
Fixes example 37 on Windows using AMD GCN 1.0 gpus (#2232)
When compiling shader cs_gdr_stream_compaction.sc on GCN 1.0 gpus
the following error appears:

Compute link error: HW_UNSUPPORTED.
ERROR: Internal compile error, error code: E_SC_NOTSUPPORTED
Shader not supported by HW

These changes avoid the error.
2020-08-16 11:41:53 -07:00
kingscallop 988077804f
Fix X11 flicker when window is being resized (#2203) 2020-07-18 11:41:01 -07:00
Бранимир Караџић 8acb8383b0 Fixed issue #2201. 2020-07-16 06:57:18 -07:00
云风 ecb0143a40
update sdf see #2193 (#2196) 2020-07-06 23:43:21 -07:00
Бранимир Караџић 301629ed16 Cleanup. 2020-07-05 21:30:52 -07:00
Бранимир Караџић 7efb218fd1 Fixed issue #2192. 2020-07-03 00:07:46 -07:00
Бранимир Караџић c08f2db901 02-metaballs: Added settings. 2020-07-02 20:55:07 -07:00
Бранимир Караџић 38ac02695d Fixed emscripten build. 2020-06-19 20:36:44 -07:00
Бранимир Караџић 77c974b69f Fixed use of BX_ASSERT in entry_html5. 2020-06-16 18:44:31 -07:00
Бранимир Караџић 2cbcb6ea90 RRenamed BX_CHECK to BX_ASSERT. 2020-06-16 10:06:18 -07:00
juj 75384ccfe1
Add checks for Emscripten API return values to make sure API calls are not failing (#2160) 2020-06-05 07:34:11 -07:00
Бранимир Караџић 0a80a7bfcc
Updated license text. (#2157) 2020-06-03 14:50:54 -07:00
Бранимир Караџић d042d3d70a 42-bunnylod: Switched to flat shaded to better show LOD. 2020-06-01 11:47:38 -07:00
Бранимир Караџић dba154036f Cleanup. 2020-05-31 15:41:18 -07:00
Бранимир Караџић a53871ccdc Added screenshot. 2020-05-31 11:50:52 -07:00
Бранимир Караџић 99637d536b Fixed warning. 2020-05-31 11:09:13 -07:00
云风 d1586fcb38
Improve example 42 (#2156)
* rename to weldVertices

* cache to temp/bunnylod.cache

* use bgfx::weldVertices instead
2020-05-30 22:38:42 -07:00
Бранимир Караџић adc701d611 Fixed warning. 2020-05-30 21:42:08 -07:00
Бранимир Караџић dfaf816822 Cleanup. 2020-05-30 13:05:43 -07:00
Бранимир Караџић a433c040d8 42-bunnylod: Better slider control towards 0. 2020-05-30 12:54:00 -07:00