diff options
| author | yum <yum.food.vr@gmail.com> | 2024-08-09 11:50:18 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-08-09 11:50:18 -0700 |
| commit | 2f48ee027587845df67214607f9cefc0e620d653 (patch) | |
| tree | c1b18c059bf99b66d4f00214e987805ee5d41f39 | |
| parent | 674df2324fa891e23e982a95e46d8fda3378c0c3 (diff) | |
Decal tweaks
Move decals after matcap but before rim lighting. I use matcaps for
ghetto tonemapping, which causes black decals (tattoos) to look washed
out.
Also fix decal emission. It's now rgb instead of grayscale.
| -rw-r--r-- | tooner.shader | 2 | ||||
| -rw-r--r-- | tooner_lighting.cginc | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/tooner.shader b/tooner.shader index ec515b3..ddf9aaa 100644 --- a/tooner.shader +++ b/tooner.shader @@ -388,7 +388,6 @@ Shader "yum_food/tooner" #include "tooner_lighting.cginc" ENDCG } - /* Pass { Tags { "RenderType" = "Opaque" @@ -459,7 +458,6 @@ Shader "yum_food/tooner" #include "mochie_shadow_caster.cginc" ENDCG } - */ } CustomEditor "ToonerGUI" } diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc index 00594ef..3ed4ae5 100644 --- a/tooner_lighting.cginc +++ b/tooner_lighting.cginc @@ -663,7 +663,7 @@ void getOverlayAlbedoRoughness(inout PbrOverlay ov, void applyDecalAlbedoImpl( inout float4 albedo, - inout float decal_emission, + inout float3 decal_emission, v2f i, texture2D tex, float4 tex_st, @@ -698,7 +698,7 @@ void applyDecalAlbedoImpl( } void applyDecalAlbedo(inout float4 albedo, - inout float decal_emission, + inout float3 decal_emission, v2f i) { #if defined(_DECAL0) @@ -1083,12 +1083,6 @@ float4 effect(inout v2f i) } #endif - mixOverlayAlbedoRoughness(albedo, roughness, ov); -#if defined(_DECAL0) || defined(_DECAL1) || defined(_DECAL2) || defined(_DECAL3) - float decal_emission = 0; - applyDecalAlbedo(albedo, decal_emission, i); -#endif - #if defined(_MATCAP0) || defined(_MATCAP1) || defined(_RIM_LIGHTING0) || defined(_RIM_LIGHTING1) float3 matcap_emission = 0; float2 matcap_uv; @@ -1237,6 +1231,13 @@ float4 effect(inout v2f i) #endif // _MATCAP1 } #endif // _MATCAP0 || _MATCAP1 + + mixOverlayAlbedoRoughness(albedo, roughness, ov); +#if defined(_DECAL0) || defined(_DECAL1) || defined(_DECAL2) || defined(_DECAL3) + float3 decal_emission = 0; + applyDecalAlbedo(albedo, decal_emission, i); +#endif + #if defined(_RIM_LIGHTING0) || defined(_RIM_LIGHTING1) { // identity: (a, b, c) and (c, c, -(a +b)) are perpendicular to each other |
