summaryrefslogtreecommitdiffstats
path: root/texture_utils.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-04-23 16:30:01 -0700
committeryum <yum.food.vr@gmail.com>2025-04-23 16:30:01 -0700
commit7aae547b83c94ff3ecf62524809ecb21d6061d33 (patch)
tree8ddb859cb4a8926e553d08d120406304ca355d3c /texture_utils.cginc
parent4e8de4d6f93bce6d4951ad85fe4ae31b9e0cdedd (diff)
tweak how decal rotation works
Diffstat (limited to 'texture_utils.cginc')
-rw-r--r--texture_utils.cginc4
1 files changed, 3 insertions, 1 deletions
diff --git a/texture_utils.cginc b/texture_utils.cginc
index 5909c72..9d7bf2f 100644
--- a/texture_utils.cginc
+++ b/texture_utils.cginc
@@ -24,7 +24,9 @@ float2 get_uv_by_channel(v2f i, uint which_channel) {
}
}
-#define UV_SCOFF(i, tex_st, which_channel) get_uv_by_channel(i, round(which_channel)) * (tex_st).xy + (tex_st).zw
+#define UV_SCOFF_IMPL(uv, tex_st) (uv) * (tex_st).xy + (tex_st).zw
+
+#define UV_SCOFF(i, tex_st, which_channel) UV_SCOFF_IMPL(get_uv_by_channel(i, round(which_channel)), tex_st)
#endif // __TEXTURE_UTILS_INC