98 Commits

Author SHA1 Message Date
Preben Eriksen b5c701f6b6 DX12 SV_PrimitiveID workaround (#480)
* PE: fixed - Crash on debug BVH visualizer is no raytracing is available.

* PE: fixed - black dots issue. ( https://github.com/turanszkij/WickedEngine/issues/450#issuecomment-1143647323 )

* PE: Another way to check if BVH is active is needed.

* PE: fix - Check if debug BVH is possible. or it will crash.

* PE: changed bug fix to a general Workaround function, depending on current backend.

* Fixed - Crash when creating screenshot without a folder.

* PE: Another way to fix black dots issue single call to workaround. ( https://github.com/turanszkij/WickedEngine/issues/450#issuecomment-1143647323 )

* PE: EventBegin for Workarounds.

* PE: workaround cleanup , removed enum and getbackend.

* PE: Disable DX12 workaround on linux.
2022-07-01 23:32:46 +02:00
Turánszki János 03ff8ba4e7 save texture to file: support R8_UNORM format 2022-06-25 13:16:51 +02:00
Turánszki János 7985d06b2c Subresource Mapping (#459)
* subresource download, upload improvements, ktx2, basis convert: using mipmap data from GPU

* bush and tree terrain assets: mipmap coverage fix

* refactors

* comments
2022-06-10 18:35:49 +02:00
Turánszki János 4e1daad92a profiler, infodisplay, logging updates 2022-06-02 12:43:06 +02:00
Turánszki János 6097526134 uwp platform fix for MakePathRelative 2022-05-03 11:33:56 +02:00
Turánszki János e934673562 Linux file dialog fix 2022-04-25 12:15:46 +02:00
Turánszki János 8973a39c5d Linux file dialog extension filtering fix 2022-04-25 11:44:12 +02:00
Megumumpkin a3e5f3a711 (Linux) File dialog glob pattern fix (#403) 2022-03-14 09:13:52 +01:00
Turánszki János 406d24d031 updated to visual studio 2022 (#392)
* updated to visual studio 2022

* github actions fix
2022-02-19 12:54:52 +01:00
Turánszki János 700944f9f9 small updates 2022-01-03 18:52:59 +01:00
Turánszki János 7823d71f3e fixes 2021-12-19 18:19:14 +01:00
Turánszki János c4c582d739 general improvements (#368)
* custom implementation for wi::vector

* fix

* sdl vulkan fix

* linux fix

* fix

* vector fix

* shader compiler and job system will be initialized automatically on first use

* vector improvements

* updates

* update

* network and audio will be auto initializing on first use only

* fix

* for now, use std::vector

* vector refactor minor

* backlog: access safety

* shader clearcoat fix

* gui initialization on demand

* initializer updates

* job system will be explicitly initialized
2021-12-09 18:58:27 +01:00
Turánszki János 74cb74d3c9 version 0.60 (#367)
- namespace refactor (example: wiGraphics:: -> wi::graphics)
  - provided namespace compatibility macro for old user code: WICKEDENGINE_BACKWARDS_COMPATIBILITY_0_59
- resource manager will return `Resource` instead of `shared_ptr<Resource>` objects
- MAD shader optimizations
- implemented alpha to coverage with alpha tested materials when MSAA is enabled
- alpha testing fix with transparent shadow maps
- TLAS and scene buffers will be recreated less frequently when things get added/removed from the scene
2021-12-03 21:22:27 +01:00
Turánszki János 16d9a8de74 common improvements (#366)
- std container replacements for vector, unordered_map, unordered_set
  - unordered_map and unordered_set replaced with ska::flat_hash_map
  - vector replacement is still std::
- unordered_map performance test (std:: vs ska::)
- backlog improvements
- wiArchive improvements
- editor: added option to dump scene to C++ header file
- common improvements, refactors
2021-11-28 22:12:05 +01:00
Turánszki János 4777246989 common refactors (#364)
* common refactors:
- DirectXMath only included in wiMath.h instead of CommonInclude.h
- cleanups in CommonInclude.h
- lua math refactor
- generic allocator refactor

* FLT_MAX to numeric_limits

* linebreak

* comment fix

* allocator fix

* more math refactors

* removed wiContainers, renamed wiAllocators to wiAllocator, moved ThreadSafeRingBuffer to wiAllocator
2021-11-26 13:45:11 +01:00
Turánszki János 146e88f866 wiArchive improvements: (#362)
- strings will be written without terminator
- ability to open from memory mapped pointer
- ability to save into header file
- refactors, comments
2021-11-25 18:16:17 +01:00
James Webb 4f82ed8fbd wiGraphics refactors (#359)
* Mark concrete graphics device classes as final - they should not be inherited from further.

* Apply consistent snake_cast naming (which has been used in more recent additions) across wiGraphics structs

* Make 'CommandList' type safe so that calling graphics device functions is less error-prone.

* Decouple wiProfiler from wiRenderer by passing the device instance to functions instead of using wiRenderer::GetDevice().

* Bump minor version for graphics refactors.

* Decouple wiHelper screenshot/saveTexture* functions from wiRenderer by providing the graphics device as a parameter.

* Convert wiGraphics.h enums to use enum class (except a couple of raytracing flag enums which seem best left)

* hdr fix

* Documentation updates for enum class.

* Revert "Decouple wiHelper screenshot/saveTexture* functions from wiRenderer by providing the graphics device as a parameter."

This reverts commit fd70249554.

* Revert "Decouple wiProfiler from wiRenderer by passing the device instance to functions instead of using wiRenderer::GetDevice()."

This reverts commit 69b5326cfc.

* Fix debug build

* Fix gcc build (hopefully). Move bitmask operator defs to end of file outside of wiGraphics namespace.

* Remove 'to_underlying' and replace with casts

* graphics device access decoupled from wiRenderer, now should be accessed from wiGraphics::GetDevice()

* minor refactors, comments

* dx12 assert fix

* fixes

* commandlist refactor

* commandlist initial value

* commandlist refactor

* graphicsdevice comments, GetActivePipelineCount() function

* has changed to has_flag

* just rename a thing

Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
2021-11-17 20:27:10 +01:00
Turánszki János ddb22482b8 shader fixes, and added new format conversions for texture saving 2021-11-10 14:16:26 +01:00
Amer Koleci f275f4690b Examples: Initial ImGui 1.85 integration example. (#338)
* Examples: Initial ImGui 1.85 integration example.

* Attempt to load and compile shaders.

* ImGUI integration done with some workarounds.

* ImGUI integration: Cleanup example.

* refactor tests->example_imgui

Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
2021-11-04 10:09:20 +01:00
Turánszki János e018935689 linux: added missing stringconvert functions 2021-11-03 17:40:23 +01:00
Amer Koleci 8b4cb875c7 Vulkan Pipeline Cache (#332)
* Vulkan: Implement pipeline cache support, verifies and loads cache validation.

* wiHelper: Add GetTempDirectoryPath and use it in vulkan cache lookup.
2021-10-11 16:43:04 +02:00
Turánszki János 100e6b6c97 Basis Universal (#313)
* added basis-universal library and KHR_texture_basisu gltf support

* fix

* added basisu license

* added basis transcode;
added basis encode;
added ktx2 encode;
resource manager file types query;

* added BC decompressor

* added lightmap compression BC6;
added DirectXTex BC libs;

* version bump

* removed directxtex, using simpler lightmap compression instead

* fix

* added ktx2 conv button; normal maps fix;

* don't rely on zero-initialization of graphics resources

* don't always enable vrs classification
2021-09-19 17:07:12 +02:00
Turanszki Janos 220342b461 texture readback fix 2021-09-05 20:02:18 +02:00
Turánszki János f3687dbf4e DX11 removal, Surfel GI
version 0.57.0:
- DX11 removed, DX12 is default now on Windows
- graphics interfaces improved:
	- Bindless descriptor support is now assumed
	- GPU Buffers with USAGE_UPLOAD and USAGE_READBACK will be persistently mapped after creation
	- Removed Map/Unmap
	- added BindDynamicConstantBuffer helper function
	- improved AllocateGPU helper function
	- GPU Queries resolving can be done directly into GPUBuffer
	- UpdateBuffer now doesn't synchronize internally, this allows batching updates
	- removed support for bindless constant buffers (uniform buffers)
	- BindConstantBuffer will accept offset
	- RESOURCE_STATES refactor, they can be combined now in the barriers
	- many other refactors
- gbuffer normals removed, implemented visibility buffer
- bindless decals, bindless lightmaps, bindless hair particles, bindless software path tracing
- hair particles path tracing support
- path tracing eye adaption supported
- Surfel GI (experimental)
2021-09-05 18:59:03 +02:00
Turanszki Janos f7b0b6f455 dx12, vulkan, path tracing fixes 2021-07-09 11:06:31 +02:00
Turanszki Janos 199b5cbcfa linux file dialog fix 2021-06-04 11:04:20 +02:00
Turánszki János f1ced24f05 Multi swapchain support (#257)
* multi swapchain draft

* uwp fix

* swapchain resize handling

* swapchain buffercount

* vsync toggle

* tests fix

* update

* everything removed from graphicsdevice regarding global screen params, engine refactor

* added GetSwapChainTexture() function to graphics device; screenshot() now requires swapChain

* linux fix: vulkan device needs window handle for instance creation

* refactor

* removed unused includes

* shader refactor and lensflare fix

* swapchain clearcolor and other refactors

* vulkan: no vector allocation in submit

* tests fix

* refactors

* lens flare canvas size fix

* gui refactor for canvas support

* refactors

* removed global canvas state

* msaa fix

* fixes

* refactor to minimize interface changes

* gui changes

* checkbox fix

* gui fixes

* fixes

* input system will accept window handle

* editor fixes

* refactor and removed resolution related system events

* small editor update

* refactor: renderpath inherits from canvas

* fixed tests duh

* image refactor

* image fix

* removed every using namespace std

* pushconstant fix

* editor: object picking only when necessary

* removed include

* dx12: copy fence waiting performed on CPU

* dx12 copyallocator update

* vulkan: copy allocator with timeline semaphores

* missing include

* dx12 copy allocator update

* refactor

* editor update

* vulkan copy allocator fix

* dx12 update

* vulkan, dx12 fixes

* version bump

* vsync event helper

* documentation update

* updated vulkan, dx12, dxc
2021-04-22 11:36:22 +02:00
Turánszki János 933080a2e4 Unified Shader Compiler (#250) 2021-03-21 18:54:04 +01:00
Turanszki Janos 783c824139 resource manager upgrade: embedded resources support 2021-03-01 00:37:55 +01:00
Turanszki Janos c08402f159 file system fixes 2021-02-26 01:08:05 +01:00
Turanszki Janos 9b4a8870ac file system refactor 2021-02-25 21:52:41 +01:00
Turanszki Janos 3a4a3c9b91 file system improvements 2021-02-24 21:39:24 +01:00
Turánszki János 666dd4ff03 platform code refactor (#242) 2021-02-23 00:29:29 +01:00
Turánszki János a0a12ad4ec uwp: port cx to winrt #238 2021-02-22 00:15:42 +01:00
Megumumpkin fc63270b6e SDL Keyboard Input, Unix File Loading and SDL Window Config (#232)
* SDL2 and Unix fix

SDL2 keyboard input, Unix filesystem fix, and SDL2 editor window config, CMake cache gitignore

* Adding comments to the SDL2 keycode fix

For a better understanding

* Slimming down SDL Unix path translation

* Static pathfile compile fix

More pathfile code fix for the compile to work

* Re: Static pathfile compile fix
2021-02-07 19:55:29 +01:00
Turánszki János 9b308941fd sheen and clearcoat (#226)
* sheen and clearcoat

* updated material wnd

* clearcoat works

* sheen updates

* sheen working

* environment reflection alwyas from probe

* restore comment sheen energy conservation

* fixes and gui for sheen and clearcoat

* sheen fix

* ocean, rt reflection fix

* material wnd update

* updated features list
2021-02-01 01:11:30 +01:00
Turánszki János b132056904 vulkan and dx12 improvements (#216)
- dx12: improved descriptor heap allocator: drastically reduce the amount of SetDescriptorHeaps() calls
- vulkan: improved loading of extension functions
- wiHelper::messageBox improvement
2021-01-14 00:08:01 +01:00
Turanszki Janos ae8e1fda1f fixes 2020-12-19 20:30:09 +01:00
Matteo De Carlo 3cd9e77889 WIP: Initial linux support using SDL (#136)
* Initial linux support using SDL

* fixed link error and gitignore

* fix in working directory initialization (windows side)

* Added README_Linux and fixed a few compilation issues in ubuntu

* Rename main to main_Windows in Tests

* Better default renderering backend selector

* Added backlog terminal output on linux

* added asserts on all missing vulkan function call results

* added portable file dialogs

also small tests update and cleanup

* Added Editor compile target

* linux ci

* linux ci

* cmake update

* cmake update?

* cmake

* Editor_Windows fix

* build test

* make

* build tools?

* update

* ubuntu 20.04

* fix?

* cmake

* build

* build?

* package linux build

* updates, bump version

* backslash to forward slash, eof newlines, add portable-file-dialogs license

* xcopy needs backslash duh; update readme;

* copy fix

* updated readme

* readme update

* updated readme

* updated readme

* fix incorrect file encoding linux

* paint tool fix

* linux: add missing shaders

* packaging update

Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
Co-authored-by: Turanszki Janos <turanszkij@gmail.com>
2020-10-05 00:03:22 +02:00
Turanszki Janos d8ceae9f20 removed downloadresource;
added map, unmap;
removed CopyTexture2D_Region;
impoved GPU resource readback functionality;
screenshot/texture readback works for vulkan and dx12;
2020-07-12 22:15:13 +01:00
Turanszki Janos 3f66eea05e working directory fix 2020-07-11 21:13:24 +01:00
Turanszki Janos 09f03b8217 uwp fix #131 2020-06-27 15:27:42 +01:00
Turánszki János ea52f660e1 Raytracing API (#128)
* start

* fix gpu hang

* rtao working

* better support for dynamic tlas

* shader updates

* project structure update

* appveyor build update

* improved acceleration build config

* updated build configuration

* updates

* updates

* acceleration structure build fixes

* minor fixes

* version bump
2020-06-20 23:19:41 +01:00
Turanszki Janos 4fcf2020af added linux build 2020-06-13 19:38:49 +01:00
Turanszki Janos aa69b18e04 uwp fixes and content packaging project 2020-05-13 22:42:57 +01:00
Turanszki Janos b687645407 uwp file system and input updates 2020-05-12 20:02:13 +01:00
Turánszki János eaae8c57ec UWP (#111)
* project restructure

* editor fix: camera shouldn't reset on render path change
2020-05-12 00:59:06 +01:00
Turanszki Janos 4c42983a31 uwp: avoid using broad file system access 2020-05-11 01:20:58 +01:00
Turanszki Janos 88b289dad8 uwp platform updates 2020-05-10 22:41:38 +01:00
Turanszki Janos e9fbc9c205 file operation updates for uwp platform #110 2020-05-10 20:23:49 +01:00