summaryrefslogtreecommitdiffstats
path: root/macros.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-12-09 01:16:52 -0800
committeryum <yum.food.vr@gmail.com>2024-12-09 01:16:52 -0800
commit81537629668cdda03f83b0b63870d53963ba5229 (patch)
tree6a648845e75d4278dfb7de7491f1becf6f883815 /macros.cginc
parent2356cdf85d2c52f70052828bb5a18419a30d4de9 (diff)
Add SDF mode to decals
Also: * add gen_sdf script, which converts solid color (ideally b&w) decals into sdf textures * add 6 more decal slots * add color, sdf options, alpha multiplier, tiling mode, and mask to decals * add token pasting macros (MERGE) to minimize code size of new decal slots
Diffstat (limited to 'macros.cginc')
-rw-r--r--macros.cginc11
1 files changed, 11 insertions, 0 deletions
diff --git a/macros.cginc b/macros.cginc
new file mode 100644
index 0000000..9c5e5fc
--- /dev/null
+++ b/macros.cginc
@@ -0,0 +1,11 @@
+#ifndef __MACROS_INC
+#define __MACROS_INC
+
+// https://isocpp.org/wiki/faq/misc-technical-issues#macros-with-token-pasting
+#define _MERGE_IMPL(a,b) a##b
+#define MERGE(a,b) _MERGE_IMPL(a,b)
+
+#define _MERGE_IMPL(a,b,c) a##b##c
+#define MERGE(a,b,c) _MERGE_IMPL(a,b,c)
+
+#endif \ No newline at end of file