diff options
| author | yum <yum.food.vr@gmail.com> | 2025-03-17 19:35:50 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-03-17 19:35:50 -0700 |
| commit | ee3db7ea6f80e31e31958848b5138e2a5c848af5 (patch) | |
| tree | 46d3a08a1d94ead2bc3f1bb028c2588737e6ea1f /decals.cginc | |
| parent | 1f96ed7dd57831f0d4c817dacebb1ecd2dfcca9f (diff) | |
finish converting decals to static branching with shitty hacks
Diffstat (limited to 'decals.cginc')
| -rw-r--r-- | decals.cginc | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/decals.cginc b/decals.cginc index bf09b6c..c120c79 100644 --- a/decals.cginc +++ b/decals.cginc @@ -130,21 +130,21 @@ void applyDecals(in v2f i, inout float4 albedo, inout float3 normal_tangent, ino #else
APPLY_DECAL_SEC01_SDF_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.tiling_mode == DECAL_TILING_MODE_CLAMP) {
- APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL0_TILING_MODE)
+ APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL0_MASK)
APPLY_DECAL_SEC03_MASK_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
APPLY_DECAL_SEC03_MASK_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.alpha_blend_mode == DECAL_ALPHA_BLEND_MODE_ALPHA_BLEND) {
- APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL0_REPLACE_ALPHA)
+ APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL0_NORMAL)
APPLY_DECAL_SEC05_NORMAL_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
@@ -166,21 +166,21 @@ void applyDecals(in v2f i, inout float4 albedo, inout float3 normal_tangent, ino #else
APPLY_DECAL_SEC01_SDF_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.tiling_mode == DECAL_TILING_MODE_CLAMP) {
- APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL1_TILING_MODE)
+ APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL1_MASK)
APPLY_DECAL_SEC03_MASK_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
APPLY_DECAL_SEC03_MASK_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.alpha_blend_mode == DECAL_ALPHA_BLEND_MODE_ALPHA_BLEND) {
- APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL1_REPLACE_ALPHA)
+ APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL1_NORMAL)
APPLY_DECAL_SEC05_NORMAL_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
@@ -202,21 +202,21 @@ void applyDecals(in v2f i, inout float4 albedo, inout float3 normal_tangent, ino #else
APPLY_DECAL_SEC01_SDF_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.tiling_mode == DECAL_TILING_MODE_CLAMP) {
- APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL2_TILING_MODE)
+ APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL2_MASK)
APPLY_DECAL_SEC03_MASK_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
APPLY_DECAL_SEC03_MASK_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.alpha_blend_mode == DECAL_ALPHA_BLEND_MODE_ALPHA_BLEND) {
- APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL2_REPLACE_ALPHA)
+ APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL2_NORMAL)
APPLY_DECAL_SEC05_NORMAL_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
@@ -238,21 +238,21 @@ void applyDecals(in v2f i, inout float4 albedo, inout float3 normal_tangent, ino #else
APPLY_DECAL_SEC01_SDF_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.tiling_mode == DECAL_TILING_MODE_CLAMP) {
- APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL3_TILING_MODE)
+ APPLY_DECAL_SEC02_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC02_CLAMP_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL3_MASK)
APPLY_DECAL_SEC03_MASK_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
APPLY_DECAL_SEC03_MASK_OFF(i, albedo, normal_tangent, metallic, smoothness, decal);
#endif
- if (decal.alpha_blend_mode == DECAL_ALPHA_BLEND_MODE_ALPHA_BLEND) {
- APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
- } else {
- APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
- }
+ #if defined(_DECAL3_REPLACE_ALPHA)
+ APPLY_DECAL_SEC04_BLEND_MODE_REPLACE(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #else
+ APPLY_DECAL_SEC04_BLEND_MODE_ALPHA_BLEND(i, albedo, normal_tangent, metallic, smoothness, decal);
+ #endif
#if defined(_DECAL3_NORMAL)
APPLY_DECAL_SEC05_NORMAL_ON(i, albedo, normal_tangent, metallic, smoothness, decal);
#else
|
