Replace TownSquare with HomeCamp art and land humanoid bots, LittleBear, and LmGirl review assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
udx
2026-11-03 20:33:08 +08:00
co-authored by Cursor
parent 45e62132c8
commit 9eec364f30
838 changed files with 57978 additions and 12225 deletions
@@ -10,9 +10,13 @@ Shader "Test/HomeCampXPbr"
[Toggle(_ALPHATEST_ON)] _AlphaTest("Alpha As Transparency (Clip)", Float) = 0
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Metallic("Metallic", Range(0.0, 1.0)) = 0.8
_Roughness("Roughness", Range(0.0, 1.0)) = 0.6
_Metallic("Metallic", Range(0.0, 1.0)) = 0.15
_Roughness("Roughness", Range(0.0, 1.0)) = 1.0
// Caps PBR smoothness so candy/plaster props stay matte; fountain bake A~0.2 would otherwise be 0.8 shiny.
_SmoothnessScale("Smoothness Scale", Range(0.0, 1.0)) = 0.4
_AO("AO", Range(0.0, 1.0)) = 1.0
// <1 lifts baked shade (opens crushed blacks toward PBR bounce).
_LightmapShadeGamma("Lightmap Shade Gamma", Range(0.3, 1.5)) = 1.0
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
@@ -47,6 +51,8 @@ Shader "Test/HomeCampXPbr"
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile_fog
#pragma multi_compile_instancing
#pragma shader_feature_local_fragment _ALPHATEST_ON
@@ -54,6 +60,8 @@ Shader "Test/HomeCampXPbr"
#pragma fragment frag
#include "XPbr_Base.hlsl"
half _SmoothnessScale;
half _LightmapShadeGamma;
Varyings vert(Attributes input)
{
@@ -131,7 +139,7 @@ Shader "Test/HomeCampXPbr"
SurfaceData surfaceData = (SurfaceData)0;
surfaceData.albedo = albedoAlpha.rgb * _BaseColor.rgb;
surfaceData.metallic = saturate(mixTex.b * _Metallic);
surfaceData.smoothness = 1.0 - saturate(mixTex.a * _Roughness);
surfaceData.smoothness = (1.0 - saturate(mixTex.a * _Roughness)) * _SmoothnessScale;
surfaceData.alpha = alpha;
surfaceData.normalTS = normalTS;
surfaceData.specular = half3(0.0, 0.0, 0.0);
@@ -143,6 +151,15 @@ Shader "Test/HomeCampXPbr"
InputData inputData;
input.normalWS.rgb = normalWS;//法线需要传入
InitializeInputData(input, surfaceData.normalTS, inputData);
#if defined(LIGHTMAP_ON)
{
half3 gi = pow(max(inputData.bakedGI, half3(0, 0, 0)), max(_LightmapShadeGamma, half(0.05)));
half lum = saturate(dot(gi, half3(0.2126h, 0.7152h, 0.0722h)));
// Soft sky fill into crushed shade (~half the blackness vs raw lightmap).
gi += half3(0.18h, 0.21h, 0.26h) * (half(1) - lum);
inputData.bakedGI = gi;
}
#endif
half4 color = UniversalFragmentPBR(inputData, surfaceData);
@@ -287,6 +304,7 @@ Shader "Test/HomeCampXPbr"
half _Cutoff;
half _Metallic;
half _Roughness;
half _SmoothnessScale;
half _AO;
CBUFFER_END
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
@@ -332,7 +350,7 @@ Shader "Test/HomeCampXPbr"
half4 mixTex = SAMPLE_TEXTURE2D(_MixTex, sampler_MixTex, input.uv);
half3 albedo = albedoAlpha.rgb * _BaseColor.rgb;
half metallic = saturate(mixTex.b * _Metallic);
half smoothness = 1.0 - saturate(mixTex.a * _Roughness);
half smoothness = (1.0 - saturate(mixTex.a * _Roughness)) * _SmoothnessScale;
half alpha = 1.0;
BRDFData brdfData;
@@ -46,6 +46,8 @@ Shader "Test/XPbr"
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile_fog
#pragma multi_compile_instancing
#pragma shader_feature_local_fragment _ALPHATEST_ON
@@ -15,6 +15,10 @@ Shader "XWorld/XTerrain"
_Roughness("Roughness", Range(0.0, 2.0)) = 0.3
_Metallic("Metallic", Range(0.0, 2.0)) = 0.3
_AO("AO", Range(0.0, 3.0)) = 1.0
// Remap baked GI luminance so cast shadows stay readable on busy grass/stone albedo.
_LightmapContrast("Lightmap Contrast", Range(0.5, 3.0)) = 1.0
_LightmapShadeMul("Lightmap Shade Mul", Range(0.2, 1.0)) = 1.0
_LightmapShadeTint("Lightmap Shade Tint", Color) = (0.55, 0.62, 0.78, 1)
//_EmissiveIntensity("EmissiveIntensity", Range(0.0, 2.0)) = 0.3
}
@@ -43,9 +47,13 @@ Shader "XWorld/XTerrain"
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
#pragma multi_compile _ SHADOWS_SHADOWMASK
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile _ _MIXTEX_ON
#pragma multi_compile_fog
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
@@ -17,10 +17,13 @@ half _BumpScale;
half _Roughness;
half _Metallic;
half _AO;
half _EmissiveIntensity;
half _useCustomGI;
half3 _CustomGIColor;
half _EmissiveIntensity;
half _useCustomGI;
half3 _CustomGIColor;
float4 _LayerTex0_TexelSize;
half _LightmapContrast;
half _LightmapShadeMul;
half3 _LightmapShadeTint;
CBUFFER_END
half _XRuntimeAmbientEnabled;
half4 _XRuntimeAmbientSky;
@@ -144,13 +147,22 @@ void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS);
#elif defined(LIGHTMAP_ON)
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, inputData.normalWS);
// Open crushed shade: gamma < 1 + cool fill into darks so plaza shade stays PBR, not ink.
{
half3 gi = max(inputData.bakedGI, half3(0, 0, 0));
gi = pow(gi, max(_LightmapContrast, half(0.05)));
half lum = saturate(dot(gi, half3(0.2126h, 0.7152h, 0.0722h)));
half3 fill = _LightmapShadeTint * max(_LightmapShadeMul, half(0.05)) * half(0.22);
inputData.bakedGI = gi + fill * (half(1) - lum);
}
#else
inputData.bakedGI = SampleSH(inputData.normalWS);
#endif
// 仅在运行时全局环境光开启后才覆盖(Game.cs 设置);否则保留场景自身 SH/光照贴图,
// 避免编辑器预览比 URP Lit 亮(旧写法无条件覆盖成硬编码的高强度三色环境光)
// Runtime ambient is for probe/SH meshes only — never replace lightmaps (that erases baked cast shadows).
#if !defined(LIGHTMAP_ON) && !defined(DYNAMICLIGHTMAP_ON)
if (_XRuntimeAmbientEnabled > 0.5h)
inputData.bakedGI = SampleXRuntimeAmbient(inputData.normalWS);
#endif
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV);
@@ -148,11 +148,10 @@ void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, inputData.normalWS);
#else
inputData.bakedGI = SampleSH(inputData.normalWS);
#endif
// 仅在运行时全局环境光开启后才覆盖(Game.cs 设置);否则保留场景自身 SH/光照贴图,
// 避免编辑器预览比 URP Lit 亮(旧写法无条件覆盖成硬编码的高强度三色环境光)
// Runtime ambient for probe/SH only — never replace lightmaps (keeps baked cast shadows).
if (_XRuntimeAmbientEnabled > 0.5h)
inputData.bakedGI = SampleXRuntimeAmbient(inputData.normalWS);
#endif
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV);