This commit is contained in:
2025-11-13 17:40:28 +08:00
parent 962ab49609
commit 10156da245
5503 changed files with 805282 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a56b7973a4101455794ae134b800c663
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,146 @@
Shader "PXR_Debugger/Tool/Lit"
{
Properties
{
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
_LightColor_01("Light Color_01", Color) = (0.3921569,0.3921569,0.3921569,1)
_LightColor_02("Light Color_02", Color) = (0.3921569,0.3921569,0.3921569,1)
_MainTex("MainTex", 2D) = "white" {}
_Tint("Tint", Color) = (1,1,1,0)
_Matcap_01("Matcap_01", 2D) = "white" {}
_Matcap_02("Matcap_02", 2D) = "white" {}
_MatcapIntensity("MatcapIntensity", Range( 0 , 2)) = 0
_Light("Light", Vector) = (0,0,0,0)
_Light_Power("Light_Power", Range( 0 , 4)) = 1
[Toggle(_LIGHT_O_ON)] _Light_O("Light_O", Float) = 0
_Mask("Mask", 2D) = "white" {}
}
CGINCLUDE
#include "Lighting.cginc"
#pragma target 3.0
float4 _Tint;
float4 _LightColor_01;
float4 _LightColor_02;
float3 _Light;
float _MatcapIntensity;
float _Light_Power;
sampler2D _MainTex;
sampler2D _Matcap_01;
sampler2D _Matcap_02;
sampler2D _Mask;
struct VertexInput
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 texcoord : TEXCOORD0;
};
struct VertexOutput
{
float4 clipPos : SV_POSITION;
float4 uv : TEXCOORD3;
float4 vertex : TEXCOORD4;
float4 worldNormal : TEXCOORD5;
};
VertexOutput vert ( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
o.worldNormal.xyz = UnityObjectToWorldNormal(v.normal);
o.uv.xy = v.texcoord.xy;
o.vertex = v.vertex;
//float3 positionWS = mul(unity_ObjectToWorld, v.vertex.xyz);
float4 positionCS = UnityObjectToClipPos(v.vertex);
o.clipPos = positionCS;
return o;
}
half4 frag ( VertexOutput IN ) : SV_Target
{
float2 uv = IN.uv.xy * float2( 1,1 ) + float2( 0,0 );
float4 maintex = tex2D( _MainTex, uv );
float3 ViewPos = mul( UNITY_MATRIX_MV, float4( IN.vertex.xyz, 1 ) ).xyz;
ViewPos = normalize( ViewPos );
float3 worldNormal = normalize(IN.worldNormal.xyz);
float3 break80 = cross( ViewPos , mul( UNITY_MATRIX_V, float4( worldNormal , 0.0 ) ).xyz );
float2 MatCapUV = (float2(-break80.y , break80.x));
MatCapUV = (MatCapUV*0.5 + 0.5);
float4 mask = tex2D( _Mask, uv );
float4 lerpMatCap = lerp( tex2D( _Matcap_01, MatCapUV ) , tex2D( _Matcap_02, MatCapUV ) , mask.r);
float4 mainColor = ( ( maintex * _Tint ) * ( lerpMatCap * _MatcapIntensity ) );
mainColor+=mainColor;
float4 lerpLightColor = lerp( _LightColor_01 , _LightColor_02 , mask.r);
float lambert = dot( worldNormal , _Light );
float4 Color = ( mainColor + ( ( ( lerpLightColor * max( lambert , 0.0 ) ) / 20.0 ) * _Light_Power ) );
float4 finalCol = float4(Color.rgb, 1);
return finalCol;
}
ENDCG
SubShader
{
Tags
{
"RenderPipeline"="UniversalPipeline"
"Queue" = "Geometry"
"RenderType" = "Opaque"
}
Pass
{
Name "Forward"
Tags { "LightMode"="UniversalForward" }
Blend One Zero, One Zero
ZWrite On
ZTest LEqual
Offset 0,0
ColorMask RGBA
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDCG
}
}
SubShader
{
Tags
{
"Queue" = "Transparent"
"RenderType" = "Opaque"
"IgnoreProjector" = "True"
}
LOD 200
Pass
{
Name "Depth"
ZWrite On
ColorMask 0
}
Pass
{
Name "Interior"
Blend SrcAlpha OneMinusSrcAlpha
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c26458595b5ec4f6897364ee1a34bd19
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: f747315f0c8ac4ec4b56d53501ec21fe
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: e5503813bb9544a90b767d948177a75f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,176 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: tool-metal
m_Shader: {fileID: 4800000, guid: 296b2106775d132469d4ddadfa937fc4, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _LIGHT_O_ON
m_LightmapFlags: 6
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _EmissiveTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HighlightTex:
m_Texture: {fileID: 2800000, guid: 674e40a4815815440b1f5c6a63260ac7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 7b74cdd57e7be46b39571c8ffa2ae595, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Matcap:
m_Texture: {fileID: 2800000, guid: 1b486dd9692504f4f852148b8f2fd182, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Matcap2:
m_Texture: {fileID: 2800000, guid: 1e308ef411232ca42b498443156b90e0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MatcapTex:
m_Texture: {fileID: 2800000, guid: c49e9f056be7ab0468d21c8fffe1bcc0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Matcap_01:
m_Texture: {fileID: 2800000, guid: e5503813bb9544a90b767d948177a75f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Matcap_02:
m_Texture: {fileID: 2800000, guid: f747315f0c8ac4ec4b56d53501ec21fe, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NorTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex:
m_Texture: {fileID: 2800000, guid: cc5bd5c060be2b74f87d38bd724cecf7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Texture2D:
m_Texture: {fileID: 2800000, guid: 674e40a4815815440b1f5c6a63260ac7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Texture2D_1:
m_Texture: {fileID: 2800000, guid: 95a1ae9b50ef24a4cac8ec71828e553d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TextureSample1:
m_Texture: {fileID: 2800000, guid: adfd0344911d9c340951e341ad9367a9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Alpha: 1
- _AlphaClip: 0
- _AlphaCutoff: 0.5
- _Blend: 0
- _CastShadows: 1
- _Cull: 2
- _CullMode: 2
- _DstBlend: 0
- _Emission: 0
- _EmissiveIntensity: 1
- _Float: 0.48
- _Float_1: 0.3
- _Fre: -1
- _Fre_Range: 0
- _Fre_Strength: 0
- _FresPower: -0.09411765
- _FresScale: -0.11
- _FresScale1: -0.09411765
- _Fresnel: 0
- _Keyword0: 0
- _Light: 0
- _LightOn: 1
- _LightPower: 0.33
- _Light_O: 1
- _Light_Power: 1.4
- _MatcapIntensity: 1.2
- _MatcapStrength: 1.4
- _Metallic: 0
- _NormalScale: 1
- _NormalStrength: 0
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
- _RimScale: 3
- _ShadowPosition: 0
- _ShadowSoftness: 0.2
- _Smoothness: 0.155
- _SrcBlend: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZTest: 4
- _ZWrite: 1
- _ZWriteControl: 0
- _power2: 0.8
m_Colors:
- _Color: {r: 0.2924528, g: 0.29107332, b: 0.29107332, a: 1}
- _Color_1: {r: 0.13207549, g: 0.13207549, b: 0.13207549, a: 1}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 0}
- _FreColor: {r: 0.16981131, g: 0.16981131, b: 0.16981131, a: 0}
- _FresColor: {r: 0.62264144, g: 0.62264144, b: 0.62264144, a: 0}
- _FresColor1: {r: 0.62264144, g: 0.62264144, b: 0.62264144, a: 0}
- _HighlightColor: {r: 0.14150941, g: 0.14150941, b: 0.14150941, a: 1}
- _HighlightO: {r: 0.3, g: -0.15, b: 0, a: 0}
- _HighlightT: {r: 1, g: 1, b: 0, a: 0}
- _LDir: {r: 0.14, g: 1, b: -0.2, a: 0}
- _Light: {r: 0.28, g: 3.41, b: 1.24, a: 0}
- _LightColor: {r: 0.8104307, g: 0.8155927, b: 0.8207547, a: 1}
- _LightColor_01: {r: 0.5299631, g: 0.54144835, b: 0.5471698, a: 1}
- _LightColor_02: {r: 0.8104307, g: 0.8155927, b: 0.8207547, a: 1}
- _MainColor: {r: 0.39215687, g: 0.39215687, b: 0.39215687, a: 1}
- _MatcapColor: {r: 2.4748788, g: 2.4748788, b: 2.4748788, a: 0}
- _RimColor: {r: 0, g: 0, b: 0, a: 0}
- _Tint: {r: 0.7815355, g: 0.80573845, b: 0.8396226, a: 1}
- _Vector0: {r: 1, g: 1, b: 1, a: 0}
- _Vector2: {r: 1, g: 1, b: 0, a: 0}
- _Vector2_1: {r: 0.3, g: -0.15, b: 0, a: 0}
- _Vector4: {r: 3, g: 3.51, b: -0.3, a: -0.23}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6b9046cc491dc4c099511fe9f7d4bd34
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,192 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2151014827717308702
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: tool
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SPECULAR_SETUP
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2003
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 7b74cdd57e7be46b39571c8ffa2ae595, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 6d864c6dc60bd4abda05996d697b73a2, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: f43e3128d6deb4b22a1c7568a1f454c7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmssionCubemap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LayerAlphaMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LayerBaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LayerBumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 7b74cdd57e7be46b39571c8ffa2ae595, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 4eab66faa2dce4f79a9fc584a10f0458, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AdjustColorIntensity: 1
- _Advanced: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _ApplyEmissionVertexColor: 0
- _ApplyVertexColor: 0
- _BaseMapBias: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpMapBias: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _CloudShadowIntensity: 1
- _Cull: 2
- _CustomFogFragment: 0
- _CustomSpecularIntensity: 1
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailInputs: 0
- _DetailNormalMapScale: 1
- _DisableHeightmapRenderer: 0
- _DstBlend: 0
- _DstBlendAlpha: 0
- _Emission: 0
- _EmissionCubemapIntensity: 1
- _EmissionCubemapLod: 0
- _EnableBoxProjection: 0
- _EnableCustomSpecular: 0
- _EnableLayerBlend: 0
- _EnvironmentReflections: 1
- _FresnelBias: 0
- _FresnelPower: 4
- _FresnelScale: 1
- _GlobalCloudShadow: 0
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _LayerBlendGroup: 0
- _LayerBlendSmoothness: 1
- _LayerBlendStrength: 0.5
- _LayerBumpScale: 1
- _LayerEnableAlphaMap: 0
- _LayerMetallic: 0
- _LayerOcclusionStrength: 1
- _LayerSmoothness: 0.5
- _LightingModel: 1
- _LightmapSpecular: 1
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 3
- _ReceiveShadows: 1
- _Smoothness: 0.49
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _SurfaceInputs: 0
- _SurfaceOptions: 0
- _WeatherMode: 0
- _WorkflowMode: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BlingPhongSpecColor: {r: 0, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _LayerBaseColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 966a2b5b842b84a43bc613e3f660f5d8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4cfeffb6896ba4753a6a961b8b1015ab
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,138 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ruler
m_Shader: {fileID: 4800000, guid: d55a12de0072d429ab86764fa94a4775, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _Divisor: 5
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Height: 0.5
- _MeshLength: 6.66
- _Metallic: 0
- _NumOfTicks: 50
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _Width: 0.003
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BackgroundColor: {r: 1, g: 0.8098248, b: 0, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &8682915497277338284
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ee6fb112aa34742f386af4aa4d29a00a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,88 @@
Shader "PXR_Debugger/Tool/Ruler"
{
Properties
{
_Width ("Tick Width", Float) = 1
_Height ("Tick Height", Float) = 0.5
_MeshLength ("Mesh Length", Float) = 1.0 // 新增属性,表示网格长度
_Divisor ("Tick Thickness Divisor", Float) = 5.0
_BackgroundColor ("Background Color", Color) = (1,1,1,1)
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float _Width;
float _Height;
float _MeshLength; // 新增变量,表示网格长度
float _Divisor;
float4 _BackgroundColor;
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// 计算刻度数量
float _NumOfTicks = 100.0;
float numOfTicks = _MeshLength * _NumOfTicks;
float maxTickWidth = 0.001;
// 其余代码保持不变
float tickWidth = _MeshLength*_Width;
float tickHeight = _Height;
float tickIndex = round(i.uv.x * _MeshLength / maxTickWidth);
float remainder = fmod(tickIndex, _Divisor);
bool shouldBeThick = remainder == 0.0;
if (shouldBeThick) {
tickWidth *= 2.0;
tickHeight = _ScreenParams.y;
}
float tickHalfWidth = tickWidth * 0.5;
float tickCoordX = (tickIndex * maxTickWidth);
fixed4 color = _BackgroundColor;
if (i.uv.x * _MeshLength > tickCoordX - tickHalfWidth &&
i.uv.x * _MeshLength < tickCoordX + tickHalfWidth &&
i.uv.y * _ScreenParams.y > _ScreenParams.y - tickHeight)
{
color = fixed4(0, 0, 0, 1);
}
return color;
}
ENDCG
}
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d55a12de0072d429ab86764fa94a4775
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: