From 10a1ecaf7bbcbc316c83f7c52742baaba0ae2f45 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Wed, 29 Apr 2020 18:39:15 +0200 Subject: [PATCH] Re-Added missing shaders Fixes #703 --- android/examples/multisampling/build.gradle | 2 +- data/shaders/multisampling/mesh.frag | 24 +++++++++++++ data/shaders/multisampling/mesh.frag.spv | Bin 0 -> 2008 bytes data/shaders/multisampling/mesh.vert | 38 ++++++++++++++++++++ data/shaders/multisampling/mesh.vert.spv | Bin 0 -> 2748 bytes examples/multisampling/multisampling.cpp | 4 +-- 6 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 data/shaders/multisampling/mesh.frag create mode 100644 data/shaders/multisampling/mesh.frag.spv create mode 100644 data/shaders/multisampling/mesh.vert create mode 100644 data/shaders/multisampling/mesh.vert.spv diff --git a/android/examples/multisampling/build.gradle b/android/examples/multisampling/build.gradle index e3369442..a398cc85 100644 --- a/android/examples/multisampling/build.gradle +++ b/android/examples/multisampling/build.gradle @@ -49,7 +49,7 @@ task copyTask { } copy { - from '../../../data/shaders/mesh' + from '../../../data/shaders/multisampling' into 'assets/shaders/mesh' include '*.*' } diff --git a/data/shaders/multisampling/mesh.frag b/data/shaders/multisampling/mesh.frag new file mode 100644 index 00000000..2dcdae5f --- /dev/null +++ b/data/shaders/multisampling/mesh.frag @@ -0,0 +1,24 @@ +#version 450 + +layout (set = 0, binding = 1) uniform sampler2D samplerColorMap; + +layout (location = 0) in vec3 inNormal; +layout (location = 1) in vec3 inColor; +layout (location = 2) in vec2 inUV; +layout (location = 3) in vec3 inViewVec; +layout (location = 4) in vec3 inLightVec; + +layout (location = 0) out vec4 outFragColor; + +void main() +{ + vec4 color = texture(samplerColorMap, inUV) * vec4(inColor, 1.0); + + vec3 N = normalize(inNormal); + vec3 L = normalize(inLightVec); + vec3 V = normalize(inViewVec); + vec3 R = reflect(-L, N); + vec3 diffuse = max(dot(N, L), 0.0) * inColor; + vec3 specular = pow(max(dot(R, V), 0.0), 16.0) * vec3(0.75); + outFragColor = vec4(diffuse * color.rgb + specular, 1.0); +} \ No newline at end of file diff --git a/data/shaders/multisampling/mesh.frag.spv b/data/shaders/multisampling/mesh.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..86e30e4e91a2b9b158e0418c1ade41309ad70de9 GIT binary patch literal 2008 zcmZ9NOH)%p5QRrVB1+^T3MwiWqDBSd3lK#Jh=PxRuQIMvA>geFNh%5DQe3!oIeao1P}~&C6z4{uOT>t(#r+_F8dH)v2>40W;wo&t!84&O%*mW(BsW z7eqgp0SoMpkhFHV%!Kd8V!0FVKWXQV+4*BO?>WimO($*MH1>+>F}ooNbHipfXC=(# zvrYwXOaccS4)>mrFpKy8i{SnAFm3;_O97+5#+wWnJ$R?=OYlk z_3=~Re5=97{NeG<*;&@5uSwu=7TzwH)qXCW^I`Lrm^*Let-d7gvKcUN7H8n?@xJiW zYjVJ|oG+zQ=X>D1k`52t-tlYc;4H)5NC%^aVfj`AI4n zA z#2n$n<4l(1ToGrD)i|+n!)V0G{fjGddA5FEQR|7`TfhC@f+~Rr3YcTxtoKvg_x*}} zui~dAwm-|crDqLrhFE(QRzGVUU5&rBiQTV*=ajbm=@L7m*q?_TcXD5BZ{@<@ndu+< z&dhz!vwxmvEuOcORbP4i#m+R&TaImP?2Dao8&Y{QI%2H|}&0+u4Y%@ob6p(SM}G`owv6u%n*4rER?DJ8$2R@qv9q;$ysSc4F^9Z{y=EcB67iaC@-jW>vVo zC1<}TxVin^hZ?WH`_A<{dEFaAJzpPdcFqS-->3KT-eUdYPKU8)-suROeAIswyITJ- zu$&V0AIFxf)_N}8&T2Euoto00>ymi=vbEup$&P(*Y zoJZwV#Tu