Commit graph

304 commits

Author SHA1 Message Date
Sascha Willems
ab38f8b150 Code-Cleanup: All samples now use the camera class and it's matrices
Cleaned up base class
2020-04-22 20:58:24 +02:00
Sascha Willems
e0c15f62da Renamed mesh example to glTF scene 2020-04-19 11:50:46 +02:00
Sascha Willems
579c7d086f Calculate matrices from node-hierarchy and pass via push constant 2020-04-13 16:26:40 +02:00
Sascha Willems
bb9374b2ec Split shader UBOs 2020-04-12 21:58:45 +02:00
Sascha Willems
d1fbf8d00a
Skeletalanimation fix (#671)
* Fixed anc code cleanup for skeletal animation

Refs #669

* Fix android build
2020-02-20 14:25:29 +01:00
Sascha Willems
b3749a90ad
Merge pull request #653 from httpdigest/master
Fix typos
2020-02-14 07:00:18 +01:00
Jakub Kuderski
8982f8f2ec Perform sampling before branching to discard
This two fragment shaders that exhibit undefined behavior. In GLSL,
it is undefined to use implicit or explicit derivatives in
non-uniform control flow [1]. The SPIR-V produced by glslang contained
similar undefined behavior, which results in incorrect codegen
with the amdvlk's LLPC shader compiler, and produces visually
incorrect image.

This PR fixes this issue by hoisting the sampling so that it's
executed before discarding. It's a simple fix and may not be
the optimial way to resolve this issue.

[1]
https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.pdf
p. 137.
2020-02-13 10:01:50 -05:00
Sascha Willems
fb45d1f741 Divide direction by w-component
Fixes #616
2020-01-24 10:04:31 +01:00
Sascha Willems
652fc3ab00 Code cleanup
Fixes #657
2020-01-24 09:16:52 +01:00
httpdigest
5029e15ec6 Fix typos
http://its-not-its.info/
2020-01-12 12:56:16 +01:00
Chris Forbes
6c4b8727ef Fix interface mismatch between VS and GS in deferredshadows
GLSLang determines the content of the builtin block based on the shading
language version. In the case of 420 vs 450, the difference is whether
the gl_CullDistance member is present.

Vulkan requires that the builtin interface block be the same on both
sides of a shader interface not involving the fragment shader, so this
leads to undefined behavior. This is caught by recent versions of the
validation layers.

Fix the issue by using GLSL 450 for both shaders in the pipeline.
2020-01-07 18:27:13 -08:00
binary
6849c14ee4
Update ssao.frag
Sorry,It should be spelled bias
2019-12-03 19:06:56 +08:00
binary
364c4695a9
Update ssao.frag
samplePos.z bias  can remove banding
2019-11-25 10:13:19 +08:00
Sascha Willems
e1e348ac7a Merge branch 'master' of github.com:SaschaWillems/Vulkan 2019-10-27 17:53:51 +01:00
Sascha Willems
526ed2da0e Simplified offscreen sample 2019-10-27 17:53:31 +01:00
Sascha Willems
eddd724e7c Removed unused compute shader ubo members 2019-10-23 20:45:54 +02:00
Sascha Willems
958f0cb65e
Merge pull request #609 from chrisforbes/shader-recompile
Recompile shaders with more modern glslang
2019-10-10 21:19:30 +02:00
Sascha Willems
36bf3dd31a Removed remaining dds files
All textures are now loaded from ktx
2019-09-06 19:18:15 +02:00
Chris Forbes
a05d90c221 Recompile shaders with more modern glslang
The SPIRV previously checked in had various issues -- most commonly, it
would use the VertexId and InstanceId builtins rather than the
replacmenet VertexIndex and InstanceIndex builtins required by Vulkan.
2019-09-06 09:59:45 +01:00
Sascha Willems
2a5d7df56e
Merge pull request #585 from tntljc/master
Fix some synchronization flaws
2019-06-22 10:00:09 +02:00
JC Liang
b575a1ff1a Fix some synchronization flaws
- shader: add barrier at the end of each iteration to avoid writing before the reading finished
- cpp: add synchronization between compute and graphics, the image barrier is not enough for the data visibility between different submission

	modified:   data/shaders/computenbody/particle_calculate.comp
	modified:   data/shaders/computenbody/particle_calculate.comp.spv
	modified:   examples/computenbody/computenbody.cpp
2019-06-17 19:31:00 +08:00
Sascha Willems
10a908d20f Started work on descriptor indexing example
Refs #583
2019-06-10 13:07:48 +02:00
Sascha Willems
b2add91d2c Renamed compute shader ray tracing example 2019-05-11 12:41:46 +02:00
Sascha Willems
4b71da8049 Removed unused shader payload 2019-04-27 13:00:12 +02:00
Sascha Willems
8fdabb0019 Added VK_NV_ray_tracing reflections example 2019-04-27 11:05:29 +02:00
Sascha Willems
a1b21f6990 Added VK_NV_ray_tracing shadow casting example 2019-04-22 18:49:38 +02:00
Sascha Willems
85a13ec645 Color triangle using barycentric coordinates 2019-04-21 15:39:28 +02:00
Sascha Willems
b8b3fac9b4 Added basic VK_NV_ray_tracing example (wip) 2019-04-20 17:54:17 +02:00
Sascha Willems
bfdf821d31 Much improved cube map visualization
Now displays all six cube map faces as a single cross
2019-04-15 21:30:57 +02:00
Sascha Willems
a3c2f42859 Reworked texture array sample, code cleanup. refactoring 2019-04-13 13:38:17 +02:00
Sascha Willems
cd3ef3e713 Enabled shader clip distance feature (validation)
Regenerated shaders with current glslang compiler
2019-04-01 20:45:42 +02:00
Sascha Willems
8afe8d825d Cleanup, code comments 2019-03-29 08:07:20 +01:00
Sascha Willems
358ab9d550 Added new sample to demonstrate negative viewport height via VK_KHR_MAINTENANCE1
Refs #563
2019-03-28 23:51:50 +01:00
Gary Sweet
7632def9d6 Fix sample count limits in deferredmultisampling
The sample count was previously fixed at 8, which is not supported
on some platforms. The code now checks for the maximum supported
sample count and uses that instead.

If you would prefer the upper limit to be fixed at 8, that is
obviously trivial to change.
2019-03-06 12:58:28 +00:00
Sascha Willems
cf83c1b499 Nicer font for ImGui overlay 2019-02-20 20:57:38 +01:00
Sascha Willems
eec6444e3d Rebuild shaders with recent glslang compiler
Refs #544
2019-02-20 20:52:12 +01:00
Sascha Willems
047f9faeec Fixed image usage (validation), code cleanup
Moved model to asset pack
2019-02-20 20:03:12 +01:00
Sascha Willems
49ee3469b6 Merge branch 'master' of github.com:SaschaWillems/Vulkan 2019-01-31 20:10:04 +01:00
Sascha Willems
fbbfe62ff4 Updated shadow mapping SPIR-V shaders 2019-01-31 20:09:48 +01:00
Sascha Willems
3eec106b47
Merge pull request #539 from Lunarsong/patch-2
Removed redundant division by w
2019-01-31 20:07:23 +01:00
Shanee
a301ed7c5b
Removed redundant division by w 2019-01-29 23:28:12 -08:00
Shanee
715f3fd9b2
Removed redundant division by w 2019-01-29 23:25:02 -08:00
saschawillems
1f3cb12bd3 Removed GL_ARB_separate_shader_objects and GL_ARB_shading_language_420pack extensions from all shaders 2018-11-19 22:05:47 +01:00
saschawillems
648339bbe6 Removed gl_PerVertex overrides
Fixes #509
2018-10-20 18:00:32 +02:00
saschawillems
367fce5b46 Reworked inline uniform block example 2018-10-07 10:27:28 +02:00
saschawillems
f1a7e66de1 Removed fragment shader from shadow map generation pipeline 2018-09-16 21:39:31 +02:00
saschawillems
dff35dd336 Started work on inline uniform block example (VK_EXT_inline_uniform_block) 2018-09-13 22:46:17 +02:00
saschawillems
25e296be55 Updated shaders, UI 2018-09-04 21:18:14 +02:00
Sascha Willems
5206b8e4c0
Merge pull request #479 from sjfricke/master
cleaned up particlefire example
2018-08-26 09:52:49 +02:00
saschawillems
8f4d137cc4 Added conditional rendering example (wip) 2018-08-12 15:07:07 +02:00