summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc')
-rw-r--r--3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc22
1 files changed, 22 insertions, 0 deletions
diff --git a/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc b/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc
new file mode 100644
index 00000000000..56026da168a
--- /dev/null
+++ b/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc
@@ -0,0 +1,22 @@
+$input v_normal
+
+/*
+ * Copyright 2016 Joseph Cherlin. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include "../common/common.sh"
+
+uniform vec4 u_tint;
+
+void main()
+{
+#if BGFX_SHADER_LANGUAGE_HLSL && (BGFX_SHADER_LANGUAGE_HLSL < 4)
+ vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * vec2_splat(0.5);
+#else
+ vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy;
+#endif
+
+ gl_FragData[0].xyz = u_tint.xyz; // Color of light sphere
+ gl_FragData[0].w = -v_normal.z; // Radius of light sphere
+}