summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/tools/texturev/common.sh
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/tools/texturev/common.sh')
-rw-r--r--3rdparty/bgfx/tools/texturev/common.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/3rdparty/bgfx/tools/texturev/common.sh b/3rdparty/bgfx/tools/texturev/common.sh
new file mode 100644
index 00000000000..c91876813ca
--- /dev/null
+++ b/3rdparty/bgfx/tools/texturev/common.sh
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2011-2017 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include <bgfx_shader.sh>
+
+uniform vec4 u_params;
+#define u_textureLod u_params.x
+#define u_textureLayer u_params.y
+#define u_ev u_params.w
+
+vec4 toEv(vec4 _color)
+{
+ return vec4(_color.xyz * pow(2.0, u_ev), _color.w);
+}