From 547c6064f6a8ab2749f496ce7ea2856e8cc1bcda Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 18 Feb 2025 16:35:22 -0800 Subject: Add matcaps and rim lighting * Add min brightness * MainTex and BumpMap can be independently tiled * Fix outlines * Remove lightDirTS (unused) * Normalize i.normal in pixel shader * Elide unused AO when locked * Wrap lines at 80 columns --- globals.cginc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'globals.cginc') diff --git a/globals.cginc b/globals.cginc index 5ca95a8..948b69a 100644 --- a/globals.cginc +++ b/globals.cginc @@ -1,6 +1,8 @@ #ifndef __GLOBALS_INC #define __GLOBALS_INC +#include "features.cginc" + SamplerState linear_repeat_s; sampler2D _MainTex; @@ -8,18 +10,26 @@ float4 _MainTex_ST; fixed4 _Color; sampler2D _BumpMap; +float4 _BumpMap_ST; half _BumpScale; float _BumpShadowHeightScale; float _BumpShadowHardness; +#if defined(_AMBIENT_OCCLUSION) sampler2D _OcclusionMap; float _OcclusionStrength; +#endif float _Shadow_Strength; -//ifex _Wrap_NoL_Strength>0 + +#if defined(_WRAPPED_LIGHTING) float _Wrap_NoL_Diffuse_Strength; float _Wrap_NoL_Specular_Strength; -//endex +#endif + +#if defined(_MIN_BRIGHTNESS) +float _Min_Brightness; +#endif float _Clip; int _Mode; @@ -39,4 +49,41 @@ texture2D _Outline_Mask; #endif #endif +#define MATCAP_MODE_REPLACE 0 +#define MATCAP_MODE_ADD 1 +#define MATCAP_MODE_MULTIPLY 2 +#define MATCAP_MODE_SUBTRACT 3 +#define MATCAP_MODE_ADD_PRODUCT 4 + +#if defined(_MATCAP0) +texture2D _Matcap0; +uint _Matcap0_Mode; +float _Matcap0_Invert; +float _Matcap0_Strength; +#if defined(_MATCAP0_MASK) +texture2D _Matcap0_Mask; +#endif +#endif + +#if defined(_RIM_LIGHTING0) +uint _Rim_Lighting0_Mode; +float _Rim_Lighting0_Center; +float _Rim_Lighting0_Power; +float3 _Rim_Lighting0_Color; +float _Rim_Lighting0_Brightness; +#if defined(_RIM_LIGHTING0_MASK) +texture2D _Rim_Lighting0_Mask; +#endif +#endif +#if defined(_RIM_LIGHTING1) +uint _Rim_Lighting1_Mode; +float _Rim_Lighting1_Center; +float _Rim_Lighting1_Power; +float3 _Rim_Lighting1_Color; +float _Rim_Lighting1_Brightness; +#if defined(_RIM_LIGHTING1_MASK) +texture2D _Rim_Lighting1_Mask; +#endif +#endif + #endif // __GLOBALS_INC -- cgit v1.2.3