From 989060744431636d581c93b201e29da308fabc75 Mon Sep 17 00:00:00 2001 From: the-butterfly Date: Mon, 22 Nov 2021 17:22:06 +0800 Subject: [PATCH] Update to 6.2.0.300 version, remove redundant files and upload .spv for compile convenient --- .../SaschaWillemsVulkan/vulkanexamplebase.cpp | 2 +- README_zh.md | 1 + .../vulkanSample/VulkanActivity.java | 58 --- android/examples/base/CMakeLists.txt | 1 - .../examples/hybridRayTracing/CMakeLists.txt | 2 +- android/examples/triangle/CMakeLists.txt | 2 +- .../vulkanSample/VulkanActivity.java | 58 --- .../glsl/hybridRayTracing/filtercube.vert.spv | Bin 0 -> 1044 bytes .../glsl/hybridRayTracing/fullscreen.frag.spv | Bin 0 -> 1680 bytes .../genbrdflut.frag.spv | Bin 8072 -> 8144 bytes .../genbrdflut.vert.spv | Bin 1160 -> 1232 bytes .../irradiancecube.frag.spv | Bin 2856 -> 2928 bytes .../pbr.frag.spv | Bin 20280 -> 20280 bytes .../prefilterenvmap.frag.spv | Bin 9060 -> 9132 bytes .../glsl/hybridRayTracing/raytracing.vert.spv | Bin 0 -> 8532 bytes .../scene.vert.spv | Bin 8428 -> 8532 bytes .../glsl/hybridRayTracing/skybox.frag.spv | Bin 0 -> 1744 bytes .../skybox.vert.spv | Bin 2296 -> 2368 bytes .../shaders/glsl/hybridreflection/common.glsl | 430 ------------------ .../glsl/hybridreflection/filtercube.vert | 19 - .../glsl/hybridreflection/filtercube.vert.spv | Bin 972 -> 0 bytes .../glsl/hybridreflection/fullscreen.frag | 25 - .../glsl/hybridreflection/fullscreen.frag.spv | Bin 1772 -> 0 bytes .../glsl/hybridreflection/genbrdflut.frag | 90 ---- .../glsl/hybridreflection/genbrdflut.vert | 9 - .../glsl/hybridreflection/generateRay.frag | 28 -- .../hybridreflection/generateRay.frag.spv | Bin 5168 -> 0 bytes .../glsl/hybridreflection/irradiancecube.frag | 37 -- data/shaders/glsl/hybridreflection/pbr.frag | 22 - .../hybridreflection/prefilterenvmap.frag | 105 ----- .../glsl/hybridreflection/reflection.frag | 78 ---- .../glsl/hybridreflection/reflection.frag.spv | Bin 31492 -> 0 bytes data/shaders/glsl/hybridreflection/scene.vert | 28 -- .../shaders/glsl/hybridreflection/skybox.frag | 62 --- .../glsl/hybridreflection/skybox.frag.spv | Bin 4444 -> 0 bytes .../shaders/glsl/hybridreflection/skybox.vert | 35 -- .../hybridRayTracing/HybridRayTracing.cpp | 8 - examples/hybridRayTracing/HybridRayTracing.h | 1 - 38 files changed, 4 insertions(+), 1097 deletions(-) delete mode 100644 android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java delete mode 100644 android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java create mode 100644 data/shaders/glsl/hybridRayTracing/filtercube.vert.spv create mode 100644 data/shaders/glsl/hybridRayTracing/fullscreen.frag.spv rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/genbrdflut.frag.spv (97%) rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/genbrdflut.vert.spv (52%) rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/irradiancecube.frag.spv (77%) rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/pbr.frag.spv (99%) rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/prefilterenvmap.frag.spv (97%) create mode 100644 data/shaders/glsl/hybridRayTracing/raytracing.vert.spv rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/scene.vert.spv (51%) create mode 100644 data/shaders/glsl/hybridRayTracing/skybox.frag.spv rename data/shaders/glsl/{hybridreflection => hybridRayTracing}/skybox.vert.spv (61%) delete mode 100644 data/shaders/glsl/hybridreflection/common.glsl delete mode 100644 data/shaders/glsl/hybridreflection/filtercube.vert delete mode 100644 data/shaders/glsl/hybridreflection/filtercube.vert.spv delete mode 100644 data/shaders/glsl/hybridreflection/fullscreen.frag delete mode 100644 data/shaders/glsl/hybridreflection/fullscreen.frag.spv delete mode 100644 data/shaders/glsl/hybridreflection/genbrdflut.frag delete mode 100644 data/shaders/glsl/hybridreflection/genbrdflut.vert delete mode 100644 data/shaders/glsl/hybridreflection/generateRay.frag delete mode 100644 data/shaders/glsl/hybridreflection/generateRay.frag.spv delete mode 100644 data/shaders/glsl/hybridreflection/irradiancecube.frag delete mode 100644 data/shaders/glsl/hybridreflection/pbr.frag delete mode 100644 data/shaders/glsl/hybridreflection/prefilterenvmap.frag delete mode 100644 data/shaders/glsl/hybridreflection/reflection.frag delete mode 100644 data/shaders/glsl/hybridreflection/reflection.frag.spv delete mode 100644 data/shaders/glsl/hybridreflection/scene.vert delete mode 100644 data/shaders/glsl/hybridreflection/skybox.frag delete mode 100644 data/shaders/glsl/hybridreflection/skybox.frag.spv delete mode 100644 data/shaders/glsl/hybridreflection/skybox.vert diff --git a/3rdparty/SaschaWillemsVulkan/vulkanexamplebase.cpp b/3rdparty/SaschaWillemsVulkan/vulkanexamplebase.cpp index 724d8ff..03c300f 100644 --- a/3rdparty/SaschaWillemsVulkan/vulkanexamplebase.cpp +++ b/3rdparty/SaschaWillemsVulkan/vulkanexamplebase.cpp @@ -565,7 +565,7 @@ VulkanExampleBase::VulkanExampleBase(bool enableValidation) #endif } -VulkanExampleBase::~VulkanExampleBase() +VulkanExampleBase::~VulkanExampleBase() noexcept { // Clean up Vulkan resources swapChain.cleanup(); diff --git a/README_zh.md b/README_zh.md index 864b4c3..dd8bd83 100644 --- a/README_zh.md +++ b/README_zh.md @@ -72,6 +72,7 @@ adb shell am start -n "com.huawei.rtcore.vkhybridrt/.VulkanActivity" ### [用混合渲染管线实现局部反射](examples/hybridreflection) 本例子搭建了一套基于光线追踪的混合渲染管线,实现了光追局部反射的后 处理效果,具体流程如下图。 + 1\. 通过传统光栅化的方法,实现了PBR的渲染管线(图中黄色虚线部分),具体参考代码: * `examples/hybridreRayTracing/HybridRayTracing` diff --git a/android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java deleted file mode 100644 index 12e14fc..0000000 --- a/android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de - * - * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) - */ -package de.saschawillems.vulkanSample; - -import android.app.AlertDialog; -import android.app.NativeActivity; -import android.content.DialogInterface; -import android.content.pm.ApplicationInfo; -import android.os.Bundle; - -import java.util.concurrent.Semaphore; - -public class VulkanActivity extends NativeActivity { - - static { - // Load native library - System.loadLibrary("native-lib"); - } - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - } - - // Use a semaphore to create a modal dialog - - private final Semaphore semaphore = new Semaphore(0, true); - - public void showAlert(final String message) - { - final VulkanActivity activity = this; - - ApplicationInfo applicationInfo = activity.getApplicationInfo(); - final String applicationName = applicationInfo.nonLocalizedLabel.toString(); - - this.runOnUiThread(new Runnable() { - public void run() { - AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert); - builder.setTitle(applicationName); - builder.setMessage(message); - builder.setPositiveButton("Close", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - semaphore.release(); - } - }); - builder.setCancelable(false); - AlertDialog dialog = builder.create(); - dialog.show(); - } - }); - try { - semaphore.acquire(); - } - catch (InterruptedException e) { } - } -} diff --git a/android/examples/base/CMakeLists.txt b/android/examples/base/CMakeLists.txt index 1cd88e9..558986d 100644 --- a/android/examples/base/CMakeLists.txt +++ b/android/examples/base/CMakeLists.txt @@ -30,7 +30,6 @@ add_library(libbase SHARED ${BASE_SRC} ${RAYSHOP_SRC_FILES}) include_directories(${BASE_DIR}) include_directories(${PROJ_ROOT}/3rdparty) include_directories(${PROJ_ROOT}/3rdparty/glm) -include_directories(${PROJ_ROOT}/3rdparty/gli) include_directories(${PROJ_ROOT}/3rdparty/imgui) include_directories(${PROJ_ROOT}/3rdparty/tinygltf) include_directories(${ANDROID_NDK}/sources/android/native_app_glue) diff --git a/android/examples/hybridRayTracing/CMakeLists.txt b/android/examples/hybridRayTracing/CMakeLists.txt index ff7f4e6..9bef060 100644 --- a/android/examples/hybridRayTracing/CMakeLists.txt +++ b/android/examples/hybridRayTracing/CMakeLists.txt @@ -14,7 +14,7 @@ add_library(native-lib SHARED ${EXAMPLE_SRC}) add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base) -add_subdirectory(../../../data ${CMAKE_SOURCE_DIR}/../../../data) +#add_subdirectory(../../../data ${CMAKE_SOURCE_DIR}/../../../data) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") diff --git a/android/examples/triangle/CMakeLists.txt b/android/examples/triangle/CMakeLists.txt index 6652203..b5be532 100644 --- a/android/examples/triangle/CMakeLists.txt +++ b/android/examples/triangle/CMakeLists.txt @@ -16,7 +16,7 @@ add_library(native-lib SHARED ${EXAMPLE_SRC}) add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base) -add_subdirectory(../../../data ${CMAKE_SOURCE_DIR}/../../../data) +#add_subdirectory(../../../data ${CMAKE_SOURCE_DIR}/../../../data) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") diff --git a/android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java deleted file mode 100644 index 12e14fc..0000000 --- a/android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de - * - * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) - */ -package de.saschawillems.vulkanSample; - -import android.app.AlertDialog; -import android.app.NativeActivity; -import android.content.DialogInterface; -import android.content.pm.ApplicationInfo; -import android.os.Bundle; - -import java.util.concurrent.Semaphore; - -public class VulkanActivity extends NativeActivity { - - static { - // Load native library - System.loadLibrary("native-lib"); - } - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - } - - // Use a semaphore to create a modal dialog - - private final Semaphore semaphore = new Semaphore(0, true); - - public void showAlert(final String message) - { - final VulkanActivity activity = this; - - ApplicationInfo applicationInfo = activity.getApplicationInfo(); - final String applicationName = applicationInfo.nonLocalizedLabel.toString(); - - this.runOnUiThread(new Runnable() { - public void run() { - AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert); - builder.setTitle(applicationName); - builder.setMessage(message); - builder.setPositiveButton("Close", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - semaphore.release(); - } - }); - builder.setCancelable(false); - AlertDialog dialog = builder.create(); - dialog.show(); - } - }); - try { - semaphore.acquire(); - } - catch (InterruptedException e) { } - } -} diff --git a/data/shaders/glsl/hybridRayTracing/filtercube.vert.spv b/data/shaders/glsl/hybridRayTracing/filtercube.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..bb5c62d15f22a1d1b3c95b6ffb392c15c7840eab GIT binary patch literal 1044 zcmYk4OH0F05QWFq*0;63-&VU6#D$6=Dk2gW1uLR1gS0^dH7QLhy7Mpim;6<31kaZ= zl3S)T=gi!hbMH;DP#-ZHvT>WTx}~dX1ur8ob93V~uH06)>qhZM$8$S=;JIzT=e1)0&7*EK zSLX+GdAGUhKUKicNW9a$)4h zei*2}m}rMD={GOm>_;z`VGzY?SXO^H*6Uk0saaIq&DA&qO`A!T85m6&zSb@@vEW&b z=E8Ab*SQ&`1gAO_{=XAFG97xvL^D0$=rN~%{I)n=jCfH|S-vJ)(hT;2$=8H=O=9?y z0p@PA{J3J?JOW)Da#D-g({e{EMqp>sb}Vj3_jbxs+j$^+JlyL85}F)HWb5g9~sB@1Bbq*l%RJ@ j#(wI_bFMG-P47LOO%3`u=Z=hfM<4pZHQBEw9n1az!mCSE literal 0 HcmV?d00001 diff --git a/data/shaders/glsl/hybridRayTracing/fullscreen.frag.spv b/data/shaders/glsl/hybridRayTracing/fullscreen.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..3c3c85a297fb25f65cee098b665378e715dd8ab1 GIT binary patch literal 1680 zcmYk6ZBG+H6om&$0YTnGKt!>CqJk1Xs4+2`0AeAjfy5{un{7KSn{2!5z99Ysf0w_? zFD9O6yVLBD+qw75xpVKFnWZwmGiA(}nK5(bzzoNd85d&AteMQ`dgE*3AW1t1uiw0a zF>fk45zc~{G83AyzUL2ExGme2Es6)O0we#H{EGg@HUH5D6RKQqH0$T*^~OoF9YxI~ z{T0||;16uG>=@@*^Yc5QrW{oYkt zT1TzY`la7VuLO;1(RV=3CqEwIGx@$%1yO9fevsPOc8;@_{o+Rrdu;<+RsK}Yo0Oll zy}+IwH4ghN-wx8z8rpZ%Sns=Uf1VAZEKRgF?0dSrcJd?hQa|JZ(dDk@tQC%QK|}5| z%+jHTL74Xnz9&5K`cYux)ZSz%iq&-+Xg(`jkewF#$u&FtXgCZ_!O+2BXbMJ;4ns#U z_H`IJV2dRT-N0%k42{4ZmoT&edsf1z2lhf%*Bjz3&Paxqua;mp)t)=Zz|P@5RNz^J{Vxh7+OY7?)@Dl+od zG{dEa>+OO3GXGJ*f&WB4x$dmQy9KtcFaN20dLzF)T)d%d?j0WcJugUL^iRB3U~lzy z=?$G3)cq@jcLtYx;eQSHawrrXd5>t1z8}P)mn9iE9L{@BhDPWBhqJHCz@sAPeu4c~ z4ts3K*azIzdMKY-=;dnh4#8cmntW=Zp{unezb13Fw&jDlT6_oW1Ad|UoR9B^9$5P* lB{(-2d!pUG4Bd#~^BuvtR6ck0QU(W{eC`bFpKj`%>^~gFizWa7 literal 0 HcmV?d00001 diff --git a/data/shaders/glsl/hybridreflection/genbrdflut.frag.spv b/data/shaders/glsl/hybridRayTracing/genbrdflut.frag.spv similarity index 97% rename from data/shaders/glsl/hybridreflection/genbrdflut.frag.spv rename to data/shaders/glsl/hybridRayTracing/genbrdflut.frag.spv index dc69c411dc71144c17da42a16e9a37df9959b3d6..5a84721bab8295a94889d651342dd6cd5fd90f0e 100644 GIT binary patch delta 95 zcmeCMzhKYJ%%sfDz`)4B#lSm}JJX#7$Z+?GclY;q_i>F+E+~jEE~(5(jnB! delta 23 ecmca$-(kF+E+~jEE~(5(jnB!*}=)p%%sfDz`)4B!N4(*J8|O{85RI90R%Vz diff --git a/data/shaders/glsl/hybridreflection/irradiancecube.frag.spv b/data/shaders/glsl/hybridRayTracing/irradiancecube.frag.spv similarity index 77% rename from data/shaders/glsl/hybridreflection/irradiancecube.frag.spv rename to data/shaders/glsl/hybridRayTracing/irradiancecube.frag.spv index c10943a0f54893f978311058dbb8312995ca7dbe..a56b27e90c3f1933ad99b5e9f1e6324e4f4fbe40 100644 GIT binary patch delta 95 zcmZ1>_CbuBnMs+Qfq{{Mi-C6{ccwcFkm2qV@9yvK?&BJtTu=~STvC~n8lRJyml~gv fS(KVwl3A9@z`(-5fut@oFFB_)1xdli;;mc&mLeQ> delta 23 ecmew$wnB`XnMs+Qfq{{MgMnircjm@DTetu?83jN9 diff --git a/data/shaders/glsl/hybridreflection/pbr.frag.spv b/data/shaders/glsl/hybridRayTracing/pbr.frag.spv similarity index 99% rename from data/shaders/glsl/hybridreflection/pbr.frag.spv rename to data/shaders/glsl/hybridRayTracing/pbr.frag.spv index 501995c77888ac898cc84887e2fba9b489246287..3013b295f1d2298d2d251ed59c835c8d40d13e86 100644 GIT binary patch delta 22 dcmdlnk8#I5Ms8*%Wp)MzMg}eh-i_S4{s27p1UUcz delta 22 dcmdlnk8#I5Ms8*%Wp)MzMg|TBj*Z;9{s27C1Tp{s diff --git a/data/shaders/glsl/hybridreflection/prefilterenvmap.frag.spv b/data/shaders/glsl/hybridRayTracing/prefilterenvmap.frag.spv similarity index 97% rename from data/shaders/glsl/hybridreflection/prefilterenvmap.frag.spv rename to data/shaders/glsl/hybridRayTracing/prefilterenvmap.frag.spv index 1fe4ac7e60d617b2efa4f324a00ddc11f494b999..4d5e8fa87e6bd72a33180fef5592721db1d7b30c 100644 GIT binary patch delta 95 zcmaFjw#J>CnMs+Qfq{{Mi-C6{ccD8Akm2qV@9yvK?&BJtTu=~STvC~n8lRJyml~gv fS(KVwl3A9@z`(-5fut@oFFB_)1xdli>X%9Yx$Ye+ delta 23 ecmZ4E{=|)&nMs+Qfq{{MgMnircj3k(FO&d3p9S>* diff --git a/data/shaders/glsl/hybridRayTracing/raytracing.vert.spv b/data/shaders/glsl/hybridRayTracing/raytracing.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..98d35afe4d4ad6befbd6faf686bef2b968551722 GIT binary patch literal 8532 zcmZvg2b^406~V9d|K9zE`y0HQlY7p0>OHr-O=e7AG&@PAC3BN~leyE9 zd>oie7m_6Nl3DpYGP-{Bq;{ur(vnk8#$dl>MsA1A{*o9oMYU2^hrdO1tLQe-?V_)W zz9;&==qIAPMKkm>UGvQfGE><{Mkhwb#zsb0O_ZC>iFW6*YC2KP>ghx!Yo+B*wmrpe zPGpzW%hhfrHW-jaT*rV`u)lJY8};pJXS7i+RW~#?H(J%oaoZeaZ0^jc&bD3 z>_pM0JA^e$trGRpw>$e}&ZY8g+!XYj(X5_}vY(awNb=U|#CY1;l(sslcCXk!a0a?Y zJIk9&-#Oomfn;`m&K27|SeLe^)>d-eK=Mz`+MjVs?jjvzoTnwpyi1R;rh24*PSz=BUJ5Esb zbnJH}o1E;nQ>%J9_PX6n%iU_pA*EAB1!SLhG+LKTRvY0?&&hH2xmU-AbZ19rZhgug z&dc@e?}Pgi8A{JtBnSIl^yvTV+4DwOFLqncPh?{MeWdrgBQ-0?fKpHM(1;>S?>(>u0fc-tSViIaOL$YV+RNhc~>3ujqCflataFd&YZS3zwCB+(+xv z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$am0@MBjlnR yxGD~R?9mgO!t|))=IW87cPCmObHyE#?zK?gq8aRTuWS8MsB6^>zOC%*CI15qk%?~r diff --git a/data/shaders/glsl/hybridRayTracing/skybox.frag.spv b/data/shaders/glsl/hybridRayTracing/skybox.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..f6c287f8cfe1f3e2acb558c88c992201d4198edd GIT binary patch literal 1744 zcmYk6TTc^F6orpKk^4miL=*}rUch<*jENDVhSY~fY7Fw&jO_rEOlO*DOY}`2{1Nzb z{8he~xW1X$WKOel&RTn&v-dvxOa})xt~+pLUXhwg>^eHZ-^~C+&dyW((P04L*K7Myp_Y$w&)p}SzIEMeN6LB~+O%E>WsUN@T!RDV63%{1W%1pDM^{}|I zY*F!fvtVi{3sV;ywk3>jO!oWoa(`P0emv*kG1E__e5*%8bABM^crqSU+YuN?BVRaW*mwMC0r6vY3|B5MTMoW+R|FAm;^L7o>BmO@OE4;5TIKqj$t44q9^J4)9wJ5448+l-KZ3YdD5+ jkFCH9jXZFEu_T fvnVyWB(p4)fq{jA14&(GUUE)p3X+12hfO&Ew;CL) delta 24 fcmX>g^h1!FnMs+Qfq{{MgMnir_s-2cj3yiaJYfWQ diff --git a/data/shaders/glsl/hybridreflection/common.glsl b/data/shaders/glsl/hybridreflection/common.glsl deleted file mode 100644 index a66c981..0000000 --- a/data/shaders/glsl/hybridreflection/common.glsl +++ /dev/null @@ -1,430 +0,0 @@ -/** - * Set 0: contains descriptors of the pipeline's own data - * 2 uniform buffers (matrices and params) - * 1 storage buffer (genrerate ray pipeline) - * or 3 storage buffer (hit result buffer, vertex buffer and index buffer) - * ***/ -layout(set = 0, binding = 0) uniform UBO -{ - mat4 projection; - mat4 model; - mat4 view; - vec3 camPos; -} -ubo; -layout(set = 0, binding = 1) uniform UBOParams -{ - float exposure; - float gamma; - uint framebufferHeight; - uint framebufferWidth; - vec4 lightDir; - float prefilteredCubeMipLevels; - float scaleIBLAmbient; - float debugViewInputs; - float debugViewEquation; -} -uboParams; - -#ifdef REFLECTION_PIPELINE -struct HitInfor { - float t; - uint triId; - float u; - float v; -}; - -layout(set = 0, binding = 2) buffer readonly HitInforBuffer -{ - HitInfor hitBuffer[]; -}; -struct Vertex { - vec4 pos; - vec4 normal; - vec4 uv; - vec4 color; - vec4 joint0; - vec4 weight0; - vec4 padding2; -}; -layout(set = 0, binding = 3) buffer readonly VertexBuffer -{ - Vertex vertexBuffer[]; -}; -layout(set = 0, binding = 4) buffer readonly IndexBuffer -{ - uint indexBuffer[]; -}; -#endif - -#ifdef GENERATERAY_PIPELINE -struct Ray { - vec3 origin; /* *< The ray origin, i.e., xyz. */ - float tmin; /* *< The min distance of potential ray hit. */ - vec3 dir; /* *< The ray direction in the same space of AS. */ - float tmax; /* *< The max distance of potential ray hit. */ -}; - -layout(set = 0, binding = 2) buffer writeonly RayBuffer -{ - Ray generatedRays[]; -}; -#endif - -/** - * Set 1: used for ibl, generated in VulkanImageBasedLighting pipeline - * 2 cube textures - * 1 2D texture - * ***/ -#ifndef GENERATERAY_PIPELINE -layout(set = 1, binding = 0) uniform samplerCube samplerIrradiance; -layout(set = 1, binding = 1) uniform samplerCube prefilteredMap; -layout(set = 1, binding = 2) uniform sampler2D samplerBRDFLUT; -#endif - -/** - * Set 2: binding material textures which are loaded in VulkanglTFModel - * 5 2d textures - * ***/ -layout(set = 2, binding = 0) uniform sampler2D colorMap; -layout(set = 2, binding = 1) uniform sampler2D physicalDescriptorMap; -layout(set = 2, binding = 2) uniform sampler2D normalMap; -layout(set = 2, binding = 3) uniform sampler2D aoMap; -layout(set = 2, binding = 4) uniform sampler2D emissiveMap; - -/** - * Set 3: binding each node's local and joint matrices, which are loaded in VulkanglTFModel - * 1 uniform buffer - * ***/ -#define MAX_NUM_JOINTS 128 -layout(set = 3, binding = 0) uniform UBONode -{ - mat4 matrix; - mat4 jointMatrix[MAX_NUM_JOINTS]; - float jointCount; -} -node; - -/** - * Push constant - * */ - -layout(push_constant) uniform Material -{ - vec4 baseColorFactor; - vec4 emissiveFactor; - vec4 diffuseFactor; - vec4 specularFactor; - float workflow; - int baseColorTextureSet; - int physicalDescriptorTextureSet; - int normalTextureSet; - int occlusionTextureSet; - int emissiveTextureSet; - float metallicFactor; - float roughnessFactor; - float alphaMask; - float alphaMaskCutoff; - uint meshId; -} -material; - -void convetLocalToWorld(inout vec3 inOutPos, inout vec3 inOutNormal, const vec4 joint0, const vec4 weight0) -{ - vec4 locPos; - vec3 outWorldPos; - vec3 outNormal; - if (node.jointCount > 0.0) { - // Mesh is skinned - mat4 skinMat = weight0.x * node.jointMatrix[int(joint0.x)] + weight0.y * node.jointMatrix[int(joint0.y)] + - weight0.z * node.jointMatrix[int(joint0.z)] + weight0.w * node.jointMatrix[int(joint0.w)]; - - locPos = ubo.model * node.matrix * skinMat * vec4(inOutPos.xyz, 1.0); - outNormal = normalize(transpose(inverse(mat3(ubo.model * node.matrix * skinMat))) * inOutNormal.xyz); - } else { - locPos = ubo.model * node.matrix * vec4(inOutPos.xyz, 1.0); - outNormal = normalize(transpose(inverse(mat3(ubo.model * node.matrix))) * inOutNormal.xyz); - } - locPos.y = -locPos.y; - outWorldPos = locPos.xyz / locPos.w; - - inOutPos = outWorldPos; - inOutNormal = outNormal; -} - -#ifdef FRAGMENT_SHADER -// Find the normal for this fragment, pulling either from a predefined normal map -// or from the interpolated mesh normal and tangent attributes. -vec3 getNormal(const vec2 uv, in vec3 worlPosition, in vec3 worldNormal) -{ - // Perturb normal, see http://www.thetenthplanet.de/archives/1180 - vec3 tangentNormal = texture(normalMap, uv).xyz * 2.0 - 1.0; - - vec3 q1 = dFdx(worlPosition); - vec3 q2 = dFdy(worlPosition); - vec2 st1 = dFdx(uv); - vec2 st2 = dFdy(uv); - - vec3 N = normalize(worldNormal); - vec3 T = normalize(q1 * st2.t - q2 * st1.t); - vec3 B = -normalize(cross(N, T)); - mat3 TBN = mat3(T, B, N); - - return normalize(TBN * tangentNormal); -} - -#ifndef GENERATERAY_PIPELINE - -// Encapsulate the various inputs used by the various functions in the shading equation -// We store values in this struct to simplify the integration of alternative implementations -// of the shading terms, outlined in the Readme.MD Appendix. -struct PBRInfo { - float NdotL; // cos angle between normal and light direction - float NdotV; // cos angle between normal and view direction - float NdotH; // cos angle between normal and half vector - float LdotH; // cos angle between light direction and half vector - float VdotH; // cos angle between view direction and half vector - float perceptualRoughness; // roughness value, as authored by the model creator (input to shader) - float metalness; // metallic value at the surface - vec3 reflectance0; // full reflectance color (normal incidence angle) - vec3 reflectance90; // reflectance color at grazing angle - float alphaRoughness; // roughness mapped to a more linear change in the roughness (proposed by [2]) - vec3 diffuseColor; // color contribution from diffuse lighting - vec3 specularColor; // color contribution from specular lighting -}; - -const float M_PI = 3.141592653589793; -const float c_MinRoughness = 0.04; - -const float PBR_WORKFLOW_METALLIC_ROUGHNESS = 0.0; -const float PBR_WORKFLOW_SPECULAR_GLOSINESS = 1.0f; - -#define MANUAL_SRGB 1 - -vec3 Uncharted2Tonemap(vec3 color) -{ - float A = 0.15; - float B = 0.50; - float C = 0.10; - float D = 0.20; - float E = 0.02; - float F = 0.30; - float W = 11.2; - return ((color * (A * color + C * B) + D * E) / (color * (A * color + B) + D * F)) - E / F; -} - -vec4 tonemap(vec4 color) -{ - vec3 outcol = Uncharted2Tonemap(color.rgb * uboParams.exposure); - outcol = outcol * (1.0f / Uncharted2Tonemap(vec3(11.2f))); - return vec4(pow(outcol, vec3(1.0f / uboParams.gamma)), color.a); -} - -vec4 SRGBtoLINEAR(vec4 srgbIn) -{ -#ifdef MANUAL_SRGB -#ifdef SRGB_FAST_APPROXIMATION - vec3 linOut = pow(srgbIn.xyz, vec3(2.2)); -#else // SRGB_FAST_APPROXIMATION - vec3 bLess = step(vec3(0.04045), srgbIn.xyz); - vec3 linOut = mix(srgbIn.xyz / vec3(12.92), pow((srgbIn.xyz + vec3(0.055)) / vec3(1.055), vec3(2.4)), bLess); -#endif // SRGB_FAST_APPROXIMATION - return vec4(linOut, srgbIn.w); - ; -#else // MANUAL_SRGB - return srgbIn; -#endif // MANUAL_SRGB -} - -// Calculation of the lighting contribution from an optional Image Based Light source. -// Precomputed Environment Maps are required uniform inputs and are computed as outlined in [1]. -// See our README.md on Environment Maps [3] for additional discussion. -vec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection) -{ - float lod = (pbrInputs.perceptualRoughness * uboParams.prefilteredCubeMipLevels); - // retrieve a scale and bias to F0. See [1], Figure 3 - vec3 brdf = (texture(samplerBRDFLUT, vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb; - vec3 diffuseLight = SRGBtoLINEAR(tonemap(texture(samplerIrradiance, n))).rgb; - - vec3 specularLight = SRGBtoLINEAR(tonemap(textureLod(prefilteredMap, reflection, lod))).rgb; - - vec3 diffuse = diffuseLight * pbrInputs.diffuseColor; - vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y); - - // For presentation, this allows us to disable IBL terms - // For presentation, this allows us to disable IBL terms - diffuse *= uboParams.scaleIBLAmbient; - specular *= uboParams.scaleIBLAmbient; - - return diffuse + specular; -} - -// Basic Lambertian diffuse -// Implementation from Lambert's Photometria https://archive.org/details/lambertsphotome00lambgoog -// See also [1], Equation 1 -vec3 diffuse(PBRInfo pbrInputs) -{ - return pbrInputs.diffuseColor / M_PI; -} - -// The following equation models the Fresnel reflectance term of the spec equation (aka F()) -// Implementation of fresnel from [4], Equation 15 -vec3 specularReflection(PBRInfo pbrInputs) -{ - return pbrInputs.reflectance0 + - (pbrInputs.reflectance90 - pbrInputs.reflectance0) * pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0); -} - -// This calculates the specular geometric attenuation (aka G()), -// where rougher material will reflect less light back to the viewer. -// This implementation is based on [1] Equation 4, and we adopt their modifications to -// alphaRoughness as input as originally proposed in [2]. -float geometricOcclusion(PBRInfo pbrInputs) -{ - float NdotL = pbrInputs.NdotL; - float NdotV = pbrInputs.NdotV; - float r = pbrInputs.alphaRoughness; - - float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL))); - float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV))); - return attenuationL * attenuationV; -} - -// The following equation(s) model the distribution of microfacet normals across the area being drawn (aka D()) -// Implementation from "Average Irregularity Representation of a Roughened Surface for Ray Reflection" by T. S. -// Trowbridge, and K. P. Reitz Follows the distribution function recommended in the SIGGRAPH 2013 course notes from EPIC -// Games [1], Equation 3. -float microfacetDistribution(PBRInfo pbrInputs) -{ - float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness; - float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0; - return roughnessSq / (M_PI * f * f); -} - -// Gets metallic factor from specular glossiness workflow inputs -float convertMetallic(vec3 diffuse, vec3 specular, float maxSpecular) -{ - float perceivedDiffuse = - sqrt(0.299 * diffuse.r * diffuse.r + 0.587 * diffuse.g * diffuse.g + 0.114 * diffuse.b * diffuse.b); - float perceivedSpecular = - sqrt(0.299 * specular.r * specular.r + 0.587 * specular.g * specular.g + 0.114 * specular.b * specular.b); - if (perceivedSpecular < c_MinRoughness) { - return 0.0; - } - float a = c_MinRoughness; - float b = - perceivedDiffuse * (1.0 - maxSpecular) / (1.0 - c_MinRoughness) + perceivedSpecular - 2.0 * c_MinRoughness; - float c = c_MinRoughness - perceivedSpecular; - float D = max(b * b - 4.0 * a * c, 0.0); - return clamp((-b + sqrt(D)) / (2.0 * a), 0.0, 1.0); -} - -vec4 pbrRendering(const vec2 drawSampleUV, const vec3 drawPosition, const vec3 drawNormal, bool useNormalTexture) -{ - float perceptualRoughness; - float metallic; - vec3 diffuseColor; - vec4 baseColor; - - vec3 f0 = vec3(0.04); - if (material.workflow == PBR_WORKFLOW_METALLIC_ROUGHNESS) { - // Metallic and Roughness material properties are packed together - // In glTF, these factors can be specified by fixed scalar values - // or from a metallic-roughness map - perceptualRoughness = material.roughnessFactor; - metallic = material.metallicFactor; - if (material.physicalDescriptorTextureSet > -1) { - // Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel. - // This layout intentionally reserves the 'r' channel for (optional) occlusion map data - vec4 mrSample = texture(physicalDescriptorMap, drawSampleUV); - perceptualRoughness = mrSample.g * perceptualRoughness; - metallic = mrSample.b * metallic; - } else { - perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0); - metallic = clamp(metallic, 0.0, 1.0); - } - // Roughness is authored as perceptual roughness; as is convention, - // convert to material roughness by squaring the perceptual roughness [2]. - - // The albedo may be defined from a base texture or a flat color - if (material.baseColorTextureSet > -1) { - baseColor = SRGBtoLINEAR(texture(colorMap, drawSampleUV)) * material.baseColorFactor; - } else { - baseColor = material.baseColorFactor; - } - } - - diffuseColor = baseColor.rgb * (vec3(1.0) - f0); - diffuseColor *= 1.0 - metallic; - - float alphaRoughness = perceptualRoughness * perceptualRoughness; - - vec3 specularColor = mix(f0, baseColor.rgb, metallic); - - // Compute reflectance. - float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); - - // For typical incident reflectance range (between 4% to 100%) set the grazing reflectance to 100% for typical - // fresnel effect. For very low reflectance range on highly diffuse objects (below 4%), incrementally reduce grazing - // reflecance to 0%. - float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0); - vec3 specularEnvironmentR0 = specularColor.rgb; - vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90; - vec3 n; - if (useNormalTexture) { - n = (material.normalTextureSet > -1) ? getNormal(drawSampleUV, drawPosition, drawNormal) - : normalize(drawNormal); - } else { - n = normalize(drawNormal); - } - - vec3 v = normalize(ubo.camPos - drawPosition); // Vector from surface point to camera - vec3 l = normalize(uboParams.lightDir.xyz); // Vector from surface point to light - vec3 h = normalize(l + v); // Half vector between both l and v - vec3 reflection = -normalize(reflect(v, n)); - reflection.y *= -1.0f; - - float NdotL = clamp(dot(n, l), 0.001, 1.0); - float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0); - float NdotH = clamp(dot(n, h), 0.0, 1.0); - float LdotH = clamp(dot(l, h), 0.0, 1.0); - float VdotH = clamp(dot(v, h), 0.0, 1.0); - - PBRInfo pbrInputs = PBRInfo(NdotL, NdotV, NdotH, LdotH, VdotH, perceptualRoughness, metallic, specularEnvironmentR0, - specularEnvironmentR90, alphaRoughness, diffuseColor, specularColor); - - // Calculate the shading terms for the microfacet specular shading model - vec3 F = specularReflection(pbrInputs); - float G = geometricOcclusion(pbrInputs); - float D = microfacetDistribution(pbrInputs); - - const vec3 u_LightColor = vec3(1.0); - - // Calculation of analytical lighting contribution - vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs); - vec3 specContrib = F * G * D / (4.0 * NdotL * NdotV); - // Obtain final intensity as reflectance (BRDF) scaled by the energy of the light (cosine law) - vec3 color = NdotL * u_LightColor * (diffuseContrib + specContrib); - - // Calculate lighting contribution from image based lighting source (IBL) - color += getIBLContribution(pbrInputs, n, reflection); - - const float u_OcclusionStrength = 1.0f; - // Apply optional PBR terms for additional (optional) shading - if (material.occlusionTextureSet > -1) { - float ao = texture(aoMap, drawSampleUV).r; - color = mix(color, color * ao, u_OcclusionStrength); - } - - const float u_EmissiveFactor = 1.0f; - if (material.emissiveTextureSet > -1) { - vec3 emissive = SRGBtoLINEAR(texture(emissiveMap, drawSampleUV)).rgb * u_EmissiveFactor; - color += emissive; - } - - return vec4(color, baseColor.a); -} - -#endif // end of not GENERATERAY_PIPELINE - -#endif // end of FRAGMENT_SHADER diff --git a/data/shaders/glsl/hybridreflection/filtercube.vert b/data/shaders/glsl/hybridreflection/filtercube.vert deleted file mode 100644 index 1226e28..0000000 --- a/data/shaders/glsl/hybridreflection/filtercube.vert +++ /dev/null @@ -1,19 +0,0 @@ -#version 450 - -layout (location = 0) in vec3 inPos; - -layout(push_constant) uniform PushConsts { - layout (offset = 0) mat4 mvp; -} pushConsts; - -layout (location = 0) out vec3 outUVW; - -out gl_PerVertex { - vec4 gl_Position; -}; - -void main() -{ - outUVW = inPos; - gl_Position = pushConsts.mvp * vec4(inPos.xyz, 1.0); -} diff --git a/data/shaders/glsl/hybridreflection/filtercube.vert.spv b/data/shaders/glsl/hybridreflection/filtercube.vert.spv deleted file mode 100644 index f369a0fc035b5453e9ba0711bb218fbf09c6dacd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 972 zcmYk4$w~uJ5JjJfiSrQW*{DlFT&M`5A}->>MMTu42nG$9w4_^c=`Z+8ew7=+bGp-# z*Ho(N)^uOJ6boAeA@qeozO9g*N+^JYFcQkCu3cVV?!?LC&ffm68RMatCYm!rou?mZ zJv7_eL&yj+i4^$?=x>rsWcB9hn;X3)H@A0L+`4AF9>wSq^T*LoFZcCE=eE&F8Xvfz z8Ln+CiknF@YLj0~XNs5jX3+Jw`1w3)#|aI~%oFpp-e1$4IqcV-oLZODTACGtzMOLZ zf+{(A#630Uih0kAo*AXo&v;<|@7EqV50;;DwuhKKrukKGfVpYyIjl0eip(>^I(_3+ zd|yFZ{HW`@+dMvu?R({Meff*oZwzfe-)D^~?;~dK3ABC0?5&@@Z3wgY75pk^+N?r*s-Ia4Z;y)n1 z!!f9LA4RrN9<6on7emI}&61Vj`Es-mLx2FAo_0*F9TQxc>6G*f$8CYdsIF32PJTt1b5 zOkCe|4w=*JoW0k+&f3$dj5j8X88dbLw$13wnQ?4$1i##3Ot%uUnNdjBPInQybgvUe>XngJH{_+mKO}Kat1P zq$fZ8&>ro!b_Simo~4&QcX(Hcf?t0m`|14@tv%Ae^#`Rs5?G9x)uq~p0Eo8vGz z27?!e!7&&!I}BdIsOvCtz-CJrJc4;849>vrmoT^jdsM>c2liBQpm&OynT6+pqjd?# z*=y379~*wker)_MAD&hvoOz+(Yx!F}idmG-oStM!^_UNvI8QdSfg$)Ob>oKv{BS)c z0e@H6a0Rv?`?_vV!r3hB>5-Y|vnOJyxvFYBJ32xx;(9uqo8I%fnUfrPW5X91y%%(Q z66(_%dr?x6kiVpxSbDhG?np1k-z#Ex_6O4G?eZT=hZpc=eF@kpe)7x5*(=I?EC+G) ze^La2F+Vo@BqbPXi{bg6| zVUgmccs${eqAr#OK{iAlTI%< zcfHo6dlJ`cT{@WS)sRjd@MHDodHKIF1HKPp1|Gnu3D^A3;2E3vXA)vgln>WU2{GVp zG0A?POTZD%m<0Z*53l&CN9-#J7&i4@OW0dmU9h(bj5zkk&ftw5Qjb_-{;A7b$$y%u Be5(Ke diff --git a/data/shaders/glsl/hybridreflection/genbrdflut.frag b/data/shaders/glsl/hybridreflection/genbrdflut.frag deleted file mode 100644 index b6290dd..0000000 --- a/data/shaders/glsl/hybridreflection/genbrdflut.frag +++ /dev/null @@ -1,90 +0,0 @@ -#version 450 - -layout (location = 0) in vec2 inUV; -layout (location = 0) out vec4 outColor; -layout (constant_id = 0) const uint NUM_SAMPLES = 1024u; - -const float PI = 3.1415926536; - -// Based omn http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ -float random(vec2 co) -{ - float a = 12.9898; - float b = 78.233; - float c = 43758.5453; - float dt= dot(co.xy ,vec2(a,b)); - float sn= mod(dt,3.14); - return fract(sin(sn) * c); -} - -vec2 hammersley2d(uint i, uint N) -{ - // Radical inverse based on http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html - uint bits = (i << 16u) | (i >> 16u); - bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); - bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); - bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); - bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); - float rdi = float(bits) * 2.3283064365386963e-10; - return vec2(float(i) /float(N), rdi); -} - -// Based on http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_slides.pdf -vec3 importanceSample_GGX(vec2 Xi, float roughness, vec3 normal) -{ - // Maps a 2D point to a hemisphere with spread based on roughness - float alpha = roughness * roughness; - float phi = 2.0 * PI * Xi.x + random(normal.xz) * 0.1; - float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (alpha*alpha - 1.0) * Xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - - // Tangent space - vec3 up = abs(normal.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(up, normal)); - vec3 tangentY = normalize(cross(normal, tangentX)); - - // Convert to world Space - return normalize(tangentX * H.x + tangentY * H.y + normal * H.z); -} - -// Geometric Shadowing function -float G_SchlicksmithGGX(float dotNL, float dotNV, float roughness) -{ - float k = (roughness * roughness) / 2.0; - float GL = dotNL / (dotNL * (1.0 - k) + k); - float GV = dotNV / (dotNV * (1.0 - k) + k); - return GL * GV; -} - -vec2 BRDF(float NoV, float roughness) -{ - // Normal always points along z-axis for the 2D lookup - const vec3 N = vec3(0.0, 0.0, 1.0); - vec3 V = vec3(sqrt(1.0 - NoV*NoV), 0.0, NoV); - - vec2 LUT = vec2(0.0); - for(uint i = 0u; i < NUM_SAMPLES; i++) { - vec2 Xi = hammersley2d(i, NUM_SAMPLES); - vec3 H = importanceSample_GGX(Xi, roughness, N); - vec3 L = 2.0 * dot(V, H) * H - V; - - float dotNL = max(dot(N, L), 0.0); - float dotNV = max(dot(N, V), 0.0); - float dotVH = max(dot(V, H), 0.0); - float dotNH = max(dot(H, N), 0.0); - - if (dotNL > 0.0) { - float G = G_SchlicksmithGGX(dotNL, dotNV, roughness); - float G_Vis = (G * dotVH) / (dotNH * dotNV); - float Fc = pow(1.0 - dotVH, 5.0); - LUT += vec2((1.0 - Fc) * G_Vis, Fc * G_Vis); - } - } - return LUT / float(NUM_SAMPLES); -} - -void main() -{ - outColor = vec4(BRDF(inUV.s, 1.0-inUV.t), 0.0, 1.0); -} \ No newline at end of file diff --git a/data/shaders/glsl/hybridreflection/genbrdflut.vert b/data/shaders/glsl/hybridreflection/genbrdflut.vert deleted file mode 100644 index f3dd233..0000000 --- a/data/shaders/glsl/hybridreflection/genbrdflut.vert +++ /dev/null @@ -1,9 +0,0 @@ -#version 450 - -layout (location = 0) out vec2 outUV; - -void main() -{ - outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); - gl_Position = vec4(outUV * 2.0f - 1.0f, 0.0f, 1.0f); -} \ No newline at end of file diff --git a/data/shaders/glsl/hybridreflection/generateRay.frag b/data/shaders/glsl/hybridreflection/generateRay.frag deleted file mode 100644 index db48312..0000000 --- a/data/shaders/glsl/hybridreflection/generateRay.frag +++ /dev/null @@ -1,28 +0,0 @@ -#version 450 -layout (early_fragment_tests) in; -#extension GL_GOOGLE_include_directive : enable -#define GENERATERAY_PIPELINE -#define FRAGMENT_SHADER -#include "common.glsl" -const float INFINITE = 10.0f; - -layout(location = 0) in vec4 inWorldPosMeshId; -layout(location = 1) in vec3 inNormal; -layout(location = 2) in vec2 inUV; - -void main() -{ - const vec3 inWorldPos = inWorldPosMeshId.xyz; - const uint pixelIndex = uint(gl_FragCoord.y) * uboParams.framebufferWidth + uint(gl_FragCoord.x); - vec3 n = normalize(inNormal); - vec3 camPos = vec3(ubo.camPos.xyz); - camPos.y = -camPos.y; - // Reflection - vec3 inDirection = inWorldPos.xyz - camPos.xyz; - vec3 outDirection = normalize(reflect(inDirection, n)); - generatedRays[pixelIndex].origin = inWorldPos.xyz + 0.01 * outDirection; - generatedRays[pixelIndex].dir = outDirection; - generatedRays[pixelIndex].tmin = 0.01f; - generatedRays[pixelIndex].tmax = INFINITE; - -} \ No newline at end of file diff --git a/data/shaders/glsl/hybridreflection/generateRay.frag.spv b/data/shaders/glsl/hybridreflection/generateRay.frag.spv deleted file mode 100644 index 653a156ec782eec3e709db58086b1b75a97b8a56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5168 zcmZvfX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h^G+{_ zSlBZsVu71IZ#wp;z5Qce#{O~7bLPBGtXn#{Oy&yjK8XbP-|Fw8&m!Hxvu5ZPm!#-RlpHRNvNr4^lcDxZ7`6A!) zn91>kygMPcCuF`K7Wpw>C%P|sMsim>GXk6UZzD1|d6Uzgc53X2$N`x*3v6D$5^rl~ z_95X*Zzl;nB=X@5{$IuWK`hQdPCdrA*cXo>J#yx;3#tPJpPkv zBZqfIVCM6lc=I79GB(zW55zNHlRp%X{VzI`8b7LZR;jdUsgf z_^*hly(PjHz4iUFcy#m~JMwF42PYnP;u8_`v-lh0!+ftwZi;^M`EH2^+Z6rmv2F4A zp<7l~%=1&xy69sOXRvcVIQDk_XX3;2uS;%CQS=WKCeJni diff --git a/data/shaders/glsl/hybridreflection/irradiancecube.frag b/data/shaders/glsl/hybridreflection/irradiancecube.frag deleted file mode 100644 index 3232db4..0000000 --- a/data/shaders/glsl/hybridreflection/irradiancecube.frag +++ /dev/null @@ -1,37 +0,0 @@ -// Generates an irradiance cube from an environment map using convolution - -#version 450 - -layout (location = 0) in vec3 inPos; -layout (location = 0) out vec4 outColor; -layout (binding = 0) uniform samplerCube samplerEnv; - -layout(push_constant) uniform PushConsts { - layout (offset = 64) float deltaPhi; - layout (offset = 68) float deltaTheta; -} consts; - -#define PI 3.1415926535897932384626433832795 - -void main() -{ - vec3 N = normalize(inPos); - vec3 up = vec3(0.0, 1.0, 0.0); - vec3 right = normalize(cross(up, N)); - up = cross(N, right); - - const float TWO_PI = PI * 2.0; - const float HALF_PI = PI * 0.5; - - vec3 color = vec3(0.0); - uint sampleCount = 0u; - for (float phi = 0.0; phi < TWO_PI; phi += consts.deltaPhi) { - for (float theta = 0.0; theta < HALF_PI; theta += consts.deltaTheta) { - vec3 tempVec = cos(phi) * right + sin(phi) * up; - vec3 sampleVector = cos(theta) * N + sin(theta) * tempVec; - color += texture(samplerEnv, sampleVector).rgb * cos(theta) * sin(theta); - sampleCount++; - } - } - outColor = vec4(PI * color / float(sampleCount), 1.0); -} diff --git a/data/shaders/glsl/hybridreflection/pbr.frag b/data/shaders/glsl/hybridreflection/pbr.frag deleted file mode 100644 index 2b857a1..0000000 --- a/data/shaders/glsl/hybridreflection/pbr.frag +++ /dev/null @@ -1,22 +0,0 @@ -// PBR shader based on the Khronos WebGL PBR implementation -// See https://github.com/KhronosGroup/glTF-WebGL-PBR -// Supports both metallic roughness and specular glossiness inputs - -#version 450 -#extension GL_GOOGLE_include_directive : enable -#define FRAGMENT_SHADER -#include "common.glsl" -layout(location = 0) in vec4 inWorldPosMeshId; -layout(location = 1) in vec3 inNormal; -layout(location = 2) in vec2 inUV; - -layout(location = 0) out vec4 outColor; - -void main() -{ - const vec3 inWorldPos = inWorldPosMeshId.xyz; - - outColor = pbrRendering(inUV, inWorldPos, inNormal, true); - - outColor.xyz = pow(outColor.xyz, 1.0 / vec3(2.2)); -} diff --git a/data/shaders/glsl/hybridreflection/prefilterenvmap.frag b/data/shaders/glsl/hybridreflection/prefilterenvmap.frag deleted file mode 100644 index ae1212e..0000000 --- a/data/shaders/glsl/hybridreflection/prefilterenvmap.frag +++ /dev/null @@ -1,105 +0,0 @@ -#version 450 - -layout (location = 0) in vec3 inPos; -layout (location = 0) out vec4 outColor; - -layout (binding = 0) uniform samplerCube samplerEnv; - -layout(push_constant) uniform PushConsts { - layout (offset = 64) float roughness; - layout (offset = 68) uint numSamples; -} consts; - -const float PI = 3.1415926536; - -// Based omn http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ -float random(vec2 co) -{ - float a = 12.9898; - float b = 78.233; - float c = 43758.5453; - float dt= dot(co.xy ,vec2(a,b)); - float sn= mod(dt,3.14); - return fract(sin(sn) * c); -} - -vec2 hammersley2d(uint i, uint N) -{ - // Radical inverse based on http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html - uint bits = (i << 16u) | (i >> 16u); - bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); - bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); - bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); - bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); - float rdi = float(bits) * 2.3283064365386963e-10; - return vec2(float(i) /float(N), rdi); -} - -// Based on http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_slides.pdf -vec3 importanceSample_GGX(vec2 Xi, float roughness, vec3 normal) -{ - // Maps a 2D point to a hemisphere with spread based on roughness - float alpha = roughness * roughness; - float phi = 2.0 * PI * Xi.x + random(normal.xz) * 0.1; - float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (alpha*alpha - 1.0) * Xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - - // Tangent space - vec3 up = abs(normal.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(up, normal)); - vec3 tangentY = normalize(cross(normal, tangentX)); - - // Convert to world Space - return normalize(tangentX * H.x + tangentY * H.y + normal * H.z); -} - -// Normal Distribution function -float D_GGX(float dotNH, float roughness) -{ - float alpha = roughness * roughness; - float alpha2 = alpha * alpha; - float denom = dotNH * dotNH * (alpha2 - 1.0) + 1.0; - return (alpha2)/(PI * denom*denom); -} - -vec3 prefilterEnvMap(vec3 R, float roughness) -{ - vec3 N = R; - vec3 V = R; - vec3 color = vec3(0.0); - float totalWeight = 0.0; - float envMapDim = float(textureSize(samplerEnv, 0).s); - for(uint i = 0u; i < consts.numSamples; i++) { - vec2 Xi = hammersley2d(i, consts.numSamples); - vec3 H = importanceSample_GGX(Xi, roughness, N); - vec3 L = 2.0 * dot(V, H) * H - V; - float dotNL = clamp(dot(N, L), 0.0, 1.0); - if(dotNL > 0.0) { - // Filtering based on https://placeholderart.wordpress.com/2015/07/28/implementation-notes-runtime-environment-map-filtering-for-image-based-lighting/ - - float dotNH = clamp(dot(N, H), 0.0, 1.0); - float dotVH = clamp(dot(V, H), 0.0, 1.0); - - // Probability Distribution Function - float pdf = D_GGX(dotNH, roughness) * dotNH / (4.0 * dotVH) + 0.0001; - // Slid angle of current smple - float omegaS = 1.0 / (float(consts.numSamples) * pdf); - // Solid angle of 1 pixel across all cube faces - float omegaP = 4.0 * PI / (6.0 * envMapDim * envMapDim); - // Biased (+1.0) mip level for better result - float mipLevel = roughness == 0.0 ? 0.0 : max(0.5 * log2(omegaS / omegaP) + 1.0, 0.0f); - color += textureLod(samplerEnv, L, mipLevel).rgb * dotNL; - totalWeight += dotNL; - - } - } - return (color / totalWeight); -} - - -void main() -{ - vec3 N = normalize(inPos); - outColor = vec4(prefilterEnvMap(N, consts.roughness), 1.0); -} diff --git a/data/shaders/glsl/hybridreflection/reflection.frag b/data/shaders/glsl/hybridreflection/reflection.frag deleted file mode 100644 index f69840b..0000000 --- a/data/shaders/glsl/hybridreflection/reflection.frag +++ /dev/null @@ -1,78 +0,0 @@ -// PBR shader based on the Khronos WebGL PBR implementation -// See https://github.com/KhronosGroup/glTF-WebGL-PBR -// Supports both metallic roughness and specular glossiness inputs - -#version 450 -#extension GL_GOOGLE_include_directive : enable -#define REFLECTION_PIPELINE -#define FRAGMENT_SHADER -#include "common.glsl" -layout(location = 0) in vec4 inWorldPosMeshId; -layout(location = 1) in vec3 inNormal; -layout(location = 2) in vec2 inUV; - -layout(location = 0) out vec4 outColor; - -void getHitInformation(const ivec3 triangleIndices, const vec2 centerUV, out vec2 hitSampeUV, out vec3 hitPosition, - out vec3 hitNormal) -{ - vec2 hitSampleUV0 = vertexBuffer[triangleIndices.x].uv.xy; - vec2 hitSampleUV1 = vertexBuffer[triangleIndices.y].uv.xy; - vec2 hitSampleUV2 = vertexBuffer[triangleIndices.z].uv.xy; - - vec3 hitPosition0 = vec3(vertexBuffer[triangleIndices.x].pos.xyz); - vec3 hitPosition1 = vec3(vertexBuffer[triangleIndices.y].pos.xyz); - vec3 hitPosition2 = vec3(vertexBuffer[triangleIndices.z].pos.xyz); - - vec3 hitNormal0 = vec3(vertexBuffer[triangleIndices.x].normal.xyz); - vec3 hitNormal1 = vec3(vertexBuffer[triangleIndices.y].normal.xyz); - vec3 hitNormal2 = vec3(vertexBuffer[triangleIndices.z].normal.xyz); - - vec4 joint0_0 = vertexBuffer[triangleIndices.x].joint0; - vec4 joint0_1 = vertexBuffer[triangleIndices.y].joint0; - vec4 joint0_2 = vertexBuffer[triangleIndices.z].joint0; - - vec4 weight0_0 = vertexBuffer[triangleIndices.x].weight0; - vec4 weight0_1 = vertexBuffer[triangleIndices.y].weight0; - vec4 weight0_2 = vertexBuffer[triangleIndices.z].weight0; - - convetLocalToWorld(hitPosition0, hitNormal0, joint0_0, weight0_0); - convetLocalToWorld(hitPosition1, hitNormal1, joint0_1, weight0_1); - convetLocalToWorld(hitPosition2, hitNormal2, joint0_2, weight0_2); - - hitSampeUV = hitSampleUV0 * (1 - centerUV.x - centerUV.y) + hitSampleUV1 * centerUV.x + hitSampleUV2 * centerUV.y; - hitPosition = hitPosition0 * (1 - centerUV.x - centerUV.y) + hitPosition1 * centerUV.x + hitPosition2 * centerUV.y; - hitNormal = hitNormal0 * (1 - centerUV.x - centerUV.y) + hitNormal1 * centerUV.x + hitNormal2 * centerUV.y; -} - -void main() -{ - const uint currentMeshId = uint(inWorldPosMeshId.w); - const uint pixelIndex = uint(gl_FragCoord.y) * uboParams.framebufferWidth + uint(gl_FragCoord.x); - const float isHit = hitBuffer[pixelIndex].t; - const uint triangleId = hitBuffer[pixelIndex].triId; - const ivec3 triangleIndices = - ivec3(indexBuffer[triangleId * 3], indexBuffer[triangleId * 3 + 1], indexBuffer[triangleId * 3 + 2]); - // mesh id is stored in w of postion; - const uint hitMeshId = uint(vertexBuffer[triangleIndices.x].pos.w); - vec2 drawSampleUV; - vec3 drawPosition; - vec3 drawNormal; - - if (isHit < 0 && currentMeshId == material.meshId) { - // Draw relection mesh - drawSampleUV = inUV; - drawPosition = inWorldPosMeshId.xyz; - drawNormal = inNormal.xyz; - } else if (isHit > 0 && hitMeshId == material.meshId) { - // draw hit mesh - const vec2 hitTriangelUv = vec2(hitBuffer[pixelIndex].u, hitBuffer[pixelIndex].v); - getHitInformation(triangleIndices, hitTriangelUv, drawSampleUV, drawPosition, drawNormal); - } else { - discard; - return; - } - - outColor = pbrRendering(drawSampleUV, drawPosition, drawNormal, false); - outColor.xyz = pow(outColor.xyz, 1.0 / vec3(2.2)); -} diff --git a/data/shaders/glsl/hybridreflection/reflection.frag.spv b/data/shaders/glsl/hybridreflection/reflection.frag.spv deleted file mode 100644 index 7ec37305fdedab7101eb263944ffbe435fa06b03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31492 zcmbuHcYt11x%FSjOcII|r3;t>f(R&0q^A-BAwZ}q8YVN7WMnck%uE6(Du^f+q$nt; zfC_@#3yNaHf?~mfVnSonUw^X@g-dG-GDc`p0zwbt|OXFt1~ea?9kGim*q zQ(CR{T2uMI8@pP~wRvlOlvZn_*5syMu;}j+)}+QypG{jEwrplu z)iW@pVJ74mlo86Al&dJ4(T1u;XP`;+&}!XDfG*lEShRG(F~=-eG=FLD$jH*M@v{f} zmktgL^)Kxk813&JA6V0`-_*))V5oO+bzkk!jfe4*LpRxP3hx~rTGKziXt=j$@Py%$ zherqdc3rc4pM%1X!-Q>6xd`16wy9HhCUAo%mApIw`o`QY#8u8@T7PciNx*QlE7;fgy zT(&HF-$cJtTicRFQEFp9je2~-i$OMe zS8GS=wSH4tGvLQBSukgOc+tYe^Jgz1WaI4Erehl$U9oH-naOv8A3JBs!lC8E^w8aK zq}JlT;qgV((cBkmCsms3t#(AExr-KcXs+Q&6WY|Kk8ZS){?Xq4k@3|%gG+{2uUI+M zKQ=~xlN{;8@ zgl$7?eFMvvuO924Tc&%$<{law>F-@V*fSbqcWdj`Zs_cZg>x3o9UdAV9ay&7)!ub%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W_-_7;ddMYPCkKkdN#h&+#C|9NhHUF0dl)dCUsI9kgu zTk9k4C|oTNaZjV2YbXxoI|f$^MBE9qx^d4B^?wqs7KpfK(YVj`QTG&FEijW;^d{W1 zabNl2z8$mhyv1ys=lQlGL(Th;`&)A8e~;OYG_u*Og+dAVv#j>{V)Oh*X zq(%I9@WsFWwKn$gJzOmibu-@M&1!iOY4ZQ)PXMZDp2lL$T zpuCQF_x>($-*WZSz@y!uvA-MEjy6rir(I%?rRgFOwXH_@rJ zJ^^PEm@0d;hU?vj{^;v7Y_->@=i1MK+HSB7&Aa~ss5?UY5?jsl3+=0R`8t=FO z;!Q^{#{5H-mB9C44gZF5_$^&Q&%OiyZt-nQVD@eJoty!T4?c4k_wS9o|C(X^+F^Xo zFg`bNd$pF|VQuTUe{E~{{na-A>|~p}CfVk_F4^Xs2jU&f$98XW&*pkyt?=J~tv}w$ zjo50&#hRP2?IZZj*!FlTy`u%##;7+_#WPt5)B`8d+24X@4gIb+b`h{oeNkgEw)+jf z1lv7F&0DdJQIDESvDE`nvlh)7`psv}Wgvepx54x0vOM|YTvouR!Oriw4({E?p4Van3)}U^>o>P=O+EkCrokQgw>A~-Tf2fe-c}EG z{;eHO+}?d#y})(xw)&E$?ufS)XVagwCCp`Dymw?BeUbMu?0nuMa5dqGyzvg6Kr`kj zh#XI1=W{#-R}+rN5#NO4XvQ1^k@p$wocA z)gE1IjC=Mh^~c&5vDMGT=HDO%Z diff --git a/data/shaders/glsl/hybridreflection/skybox.vert b/data/shaders/glsl/hybridreflection/skybox.vert deleted file mode 100644 index b263d5a..0000000 --- a/data/shaders/glsl/hybridreflection/skybox.vert +++ /dev/null @@ -1,35 +0,0 @@ -#version 450 - -#extension GL_ARB_separate_shader_objects : enable -#extension GL_ARB_shading_language_420pack : enable - -layout(location = 0) in vec4 inPos; -layout(location = 1) in vec4 inNormal; -layout(location = 2) in vec4 inUV; - -layout(binding = 0) uniform UBO -{ - mat4 projection; - mat4 model; -} -ubo; - -layout(location = 0) out vec3 outUVW; -layout(location = 1) out vec3 outNormal; -layout(location = 2) out vec3 outWorldPos; - -out gl_PerVertex -{ - vec4 gl_Position; -}; - -void main() -{ - outUVW = inPos.xyz; - gl_Position = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0); - outWorldPos = vec3(ubo.model * vec4(inPos.xyz, 1.0)); - // Normal in world space - mat3 mNormal = transpose(inverse(mat3(ubo.model))); - outNormal = mNormal * normalize(inNormal.xyz); - outNormal = normalize(outNormal); -} diff --git a/examples/hybridRayTracing/HybridRayTracing.cpp b/examples/hybridRayTracing/HybridRayTracing.cpp index 84db1db..07d069f 100644 --- a/examples/hybridRayTracing/HybridRayTracing.cpp +++ b/examples/hybridRayTracing/HybridRayTracing.cpp @@ -366,13 +366,6 @@ void HybridRayTracing::UpdateResourceAsyncly() if (!paused) { size_t passId = m_models.index * m_rtShaders.size() + m_rtIndex; - if (m_enableAnimate && (!m_models.scene[passId].animations.empty())) { - m_animationTimer += frameTimer; - if (m_animationTimer > m_models.scene[passId].animations[0].end) { - m_animationTimer -= m_models.scene[passId].animations[0].end; - } - m_models.scene[passId].updateAnimation(0, m_animationTimer); - } if (m_enableRT) { m_rayTracingPasses[passId]->UpdateBVH(m_models.scene[passId], m_uboMatrices.scene[passId].model); } @@ -432,7 +425,6 @@ void HybridRayTracing::OnUpdateUIOverlay(vks::UIOverlay *overlay) // if enable shader choice. overlay->comboBox("rtShaders", &m_rtIndex, m_rtShaders); reBuild |= (overlay->checkBox("RayTrace", &m_enableRT)); - overlay->checkBox("Animate", &m_enableAnimate); if (overlay->checkBox("Stat", &m_showStat)) { m_rtIndex = m_showStat ? 1 : 0; reBuild = true; diff --git a/examples/hybridRayTracing/HybridRayTracing.h b/examples/hybridRayTracing/HybridRayTracing.h index eeab6e1..f309866 100644 --- a/examples/hybridRayTracing/HybridRayTracing.h +++ b/examples/hybridRayTracing/HybridRayTracing.h @@ -81,7 +81,6 @@ class HybridRayTracing : public VulkanExampleBase { std::vector> m_rayTracingPasses; // n_model x n_rtShader bool m_enableRT = true; float m_downScale = 1.0f; - bool m_enableAnimate = false; bool m_showStat = false; float m_reflectArea = 0.0f;