feat: Main shader LOD detail map

This commit is contained in:
Alexandre Coirier
2026-06-02 07:55:45 +02:00
parent 2f3cd8dc7e
commit 713933b932
16 changed files with 2496 additions and 338 deletions
+4
View File
@@ -84,8 +84,11 @@ Material:
- _ClipInvert: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailSize: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _FogMax: 15
- _FogMin: 0
- _GrainSize: 0.4
- _GrainStrength: 0.2
- _HighlightMax: 1
@@ -114,6 +117,7 @@ Material:
m_Colors:
- _BaseColor: {r: 0.754717, g: 0.754717, b: 0.754717, a: 1}
- _Color: {r: 0.8588235, g: 0.8588235, b: 0.8588235, a: 1}
- _FogColor: {r: 1, g: 1, b: 1, a: 0}
- _GrainColor: {r: 1, g: 1, b: 1, a: 0.09803922}
- _HighlightColor: {r: 2.118547, g: 2.118547, b: 2.118547, a: 1}
- _ShadowColor: {r: 0.14117646, g: 0.16862747, b: 0.16470587, a: 1}
@@ -73,6 +73,9 @@ Material:
m_Floats:
- _ClipDistance: 0
- _ClipInvert: 0
- _DetailSize: 1
- _FogMax: 15
- _FogMin: 0
- _GrainSize: 0.4
- _GrainStrength: 0.2
- _HighlightMax: 1
@@ -97,6 +100,7 @@ Material:
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.8588235, g: 0.8588235, b: 0.8588235, a: 1}
- _FogColor: {r: 1, g: 1, b: 1, a: 0}
- _GrainColor: {r: 1, g: 1, b: 1, a: 0.09803922}
- _HighlightColor: {r: 2.118547, g: 2.118547, b: 2.118547, a: 1}
- _ShadowColor: {r: 0.14117646, g: 0.16862747, b: 0.16470587, a: 1}
@@ -73,6 +73,9 @@ Material:
m_Floats:
- _ClipDistance: 0
- _ClipInvert: 0
- _DetailSize: 1
- _FogMax: 15
- _FogMin: 0
- _GrainSize: 0.4
- _GrainStrength: 0.2
- _HighlightMax: 1
@@ -97,6 +100,7 @@ Material:
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.8588235, g: 0.8588235, b: 0.8588235, a: 1}
- _FogColor: {r: 1, g: 1, b: 1, a: 0}
- _GrainColor: {r: 1, g: 1, b: 1, a: 0.09803922}
- _HighlightColor: {r: 2.118547, g: 2.118547, b: 2.118547, a: 1}
- _ShadowColor: {r: 0.14117646, g: 0.16862747, b: 0.16470587, a: 1}
@@ -40,6 +40,10 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 2da59fbd756c92a4bb2018abf06c4e07, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@@ -102,6 +106,7 @@ Material:
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DetailSize: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
@@ -116,6 +121,7 @@ Material:
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _ProjectionBlend: 0.1
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
@@ -40,6 +40,10 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 2da59fbd756c92a4bb2018abf06c4e07, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@@ -110,9 +114,12 @@ Material:
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DetailSize: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _FogMax: 7
- _FogMin: 0
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
@@ -124,6 +131,7 @@ Material:
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _ProjectionBlend: 0.1
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
@@ -141,6 +149,7 @@ Material:
- _Surface: 0
- _Test: 0
- _TriplanarBlend: 0
- _VertexColor: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
@@ -151,6 +160,7 @@ Material:
- _EmissionColor: {r: 256, g: 256, b: 256, a: 1}
- _Emission_intensity: {r: 128, g: 128, b: 128, a: 1}
- _Emissive_intensity: {r: 16, g: 16, b: 16, a: 1}
- _FogColor: {r: 1.8679246, g: 0.62325984, b: 0.25551805, a: 0.5686275}
- _GrainColor: {r: 1, g: 1, b: 1, a: 0.09803922}
- _HighlightColor: {r: 2.118547, g: 2.118547, b: 2.118547, a: 1}
- _ShadowColor: {r: 0.14117646, g: 0.16862747, b: 0.16470587, a: 1}
@@ -55,7 +55,7 @@ Material:
- _QueueControl: 0
- _QueueOffset: 0
m_Colors:
- _ColorA: {r: 1.244819, g: 0.500609, b: 0.2289997, a: 1}
- _ColorA: {r: 1.4980392, g: 0.6024425, b: 0.27558267, a: 1}
- _ColorB: {r: 0.7924528, g: 0.2773978, b: 0.09344961, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -28,25 +28,30 @@ void Fog_float
//float test = RidgedNoise3D(PositionWS, 10, 2, 2, .5);
float3 camPos = _WorldSpaceCameraPos.xyz;
float depth = distance(camPos, PositionWS);
float depthAtten = smoothstep(10, 100, depth);
float depthAtten = smoothstep(5, 30, depth);
float mask = smoothstep(0, lerp(.3, .1, depthAtten), PositionOS.y) * pow(smoothstep(1, .5, PositionOS.y), 2);
float t = _Time.y * .7;
float s = lerp(Scale.x, 1, .3);
float3 p = PositionWS;// - PivotWS;
p += float3(t, t * .2, t);
p += RidgedNoise3D(p - PivotWS * .9, .1, 3, 1.6, 1) * 3;
float noise = RidgedNoise3D(p - PivotWS * .9, .1, 5, 1.6, 1);
p += noise * 3;
float fog = FBMNoise3D((p - PivotWS * .5), 10 / s, 3, 1.5, .5);
float4 col = lerp(ColorA, ColorB, saturate(RidgedNoise3D((p - PivotWS * .7) * float3(1, 1.6, 1), 3 / s, 3, 1.6, 1)));
float4 col = lerp(ColorA, ColorB, saturate(RidgedNoise3D((p - PivotWS * .9) * float3(1, 1.6, 1), 3 / s, 3, 1.6, 1)));
float mask = smoothstep(0, lerp(.3, .1, depthAtten), PositionOS.y) * pow(smoothstep(1, .5, PositionOS.y - .15 + noise * .3), 2);
// Output
Output = col.rgb;
Alpha = lerp(fog, smoothstep(1, .5, PositionOS.y), depthAtten * mask) * lerp(.2, 1, smoothstep(0, 30, depth)) * mask * col.a;
Alpha = lerp(fog, smoothstep(1, .5, PositionOS.y), depthAtten * mask) * lerp(.2, 1, smoothstep(0, 15, depth)) * mask * col.a;
}
#endif
@@ -0,0 +1,75 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-5120607745848675954
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: M_ray_Omnissiah
m_Shader: {fileID: -6465566751694194690, guid: 41e1af50dce5647448137abb3f85e49b, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _SampleTexture2D_45427f0cc3994257be048fc580e65bba_Texture_1_Texture2D:
m_Texture: {fileID: 2800000, guid: dffef66376be4fa480fb02b19edbe903, type: 3}
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:
- _Debug: 0
- _Demo: 0
- _IgnoreAtten: 1
- _Intendity: 0.828
- _Intensity: 1
- _Noise: 0.786
- _QueueControl: 0
- _QueueOffset: 0
- _Size: 3.92
- _Speed: 2
- _Stop: 1
- _UV: 0
m_Colors:
- _Color: {r: 10.556064, g: 0, b: 0.17448205, a: 0.105882354}
- _Direction: {r: 0, g: 0, b: 1, a: 0}
- _Size: {r: 3, g: 1, b: 0, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f0a42f4b97d23e4599d257dabb0f97d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -606,6 +606,133 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &2025796757643683946
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8224314324322834591}
- component: {fileID: 5375479894882030970}
- component: {fileID: 4099810627939101736}
m_Layer: 21
m_Name: Point Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8224314324322834591
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2025796757643683946}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.006, y: 1.765, z: 19.533}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1381325834594434730}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &5375479894882030970
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2025796757643683946}
m_Enabled: 1
serializedVersion: 12
m_Type: 2
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_Intensity: 1
m_Range: 1.41
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize2D: {x: 0.5, y: 0.5}
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 2
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!114 &4099810627939101736
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2025796757643683946}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalLightData
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_CustomShadowLayers: 0
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0
m_RenderingLayersMask:
serializedVersion: 0
m_Bits: 2
m_ShadowRenderingLayersMask:
serializedVersion: 0
m_Bits: 1
m_Version: 4
m_LightLayerMask: 1
m_ShadowLayerMask: 1
m_RenderingLayers: 1
m_ShadowRenderingLayers: 1
--- !u!1 &3318401582161600079
GameObject:
m_ObjectHideFlags: 0
@@ -1010,6 +1137,10 @@ Transform:
- {fileID: 8594930595872363770}
- {fileID: 1866815096823659602}
- {fileID: 1285827998720199852}
- {fileID: 8224314324322834591}
- {fileID: 1780869142280226392}
- {fileID: 2835732385966090374}
- {fileID: 4926732054180342176}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6092940326754491008
@@ -1455,15 +1586,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 24.46808
value: 12.357114
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 24.46808
value: 12.357114
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -1527,6 +1658,84 @@ Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
m_PrefabInstance: {fileID: 449932605634398781}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1241588351530013389
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1381325834594434730}
m_Modifications:
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.x
value: 0.5566465
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.y
value: 1.691537
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.z
value: 1.9077115
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.x
value: -0.046449997
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.y
value: 1.6624899
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.z
value: 19.344181
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.w
value: 0.93732494
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.x
value: -0.3484567
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -40.786
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2541733693143394657, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_Name
value: Ray 1
objectReference: {fileID: 0}
- target: {fileID: 3666808908055770611, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 2f0a42f4b97d23e4599d257dabb0f97d, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
--- !u!4 &1780869142280226392 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
m_PrefabInstance: {fileID: 1241588351530013389}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1990321800832301919
PrefabInstance:
m_ObjectHideFlags: 0
@@ -1537,15 +1746,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 89.137085
value: 45.0169
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 89.137085
value: 45.0169
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -1619,15 +1828,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 115.92279
value: 58.544483
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 15.995324
value: 12.784271
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 115.92279
value: 58.544483
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -1701,15 +1910,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 31.805193
value: 16.062576
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 31.805193
value: 16.062576
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -1783,15 +1992,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 69.047554
value: 34.871086
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 15.041685
value: 12.022074
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 69.047554
value: 34.871086
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -1855,6 +2064,84 @@ Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
m_PrefabInstance: {fileID: 3161278443421299005}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3375274880855489555
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1381325834594434730}
m_Modifications:
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.x
value: 0.5566466
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.y
value: 1.6915368
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.z
value: 1.9077115
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.x
value: 0.13055
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.y
value: 1.5764899
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.z
value: 19.33318
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.w
value: 0.80491567
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.x
value: -0.56803125
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.y
value: -0.15220204
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.z
value: -0.079283416
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -69.813
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -26.68
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 7.539
objectReference: {fileID: 0}
- target: {fileID: 2541733693143394657, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_Name
value: Ray 2
objectReference: {fileID: 0}
- target: {fileID: 3666808908055770611, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 2f0a42f4b97d23e4599d257dabb0f97d, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
--- !u!4 &2835732385966090374 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
m_PrefabInstance: {fileID: 3375274880855489555}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &4199400061159544012
PrefabInstance:
m_ObjectHideFlags: 0
@@ -1865,15 +2152,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 40.307537
value: 20.356514
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 4.3782487
value: 3.4993174
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 40.307537
value: 20.356514
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -1947,15 +2234,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 159.98505
value: 80.79724
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 159.98505
value: 80.79724
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -2019,6 +2306,84 @@ Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
m_PrefabInstance: {fileID: 5236161718308951774}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5607735495772077365
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1381325834594434730}
m_Modifications:
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.x
value: 0.5566465
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.y
value: 1.691537
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalScale.z
value: 1.9077116
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.x
value: -0.23945001
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.y
value: 1.6264901
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalPosition.z
value: 19.38618
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.w
value: 0.829742
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.x
value: -0.54430974
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.y
value: 0.014115494
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalRotation.z
value: 0.12270251
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -65.058
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -15.142
objectReference: {fileID: 0}
- target: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 26.515
objectReference: {fileID: 0}
- target: {fileID: 2541733693143394657, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: m_Name
value: Ray 3
objectReference: {fileID: 0}
- target: {fileID: 3666808908055770611, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 2f0a42f4b97d23e4599d257dabb0f97d, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
--- !u!4 &4926732054180342176 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 688462554248565909, guid: 2db7add660a81a342a80b1ba7a331929, type: 3}
m_PrefabInstance: {fileID: 5607735495772077365}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5718038900406380094
PrefabInstance:
m_ObjectHideFlags: 0
@@ -2029,15 +2394,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 14.300449
value: 7.2221556
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 14.300449
value: 7.2221556
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -2111,15 +2476,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 53.488106
value: 27.013096
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 53.488106
value: 27.013096
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
@@ -2193,15 +2558,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.x
value: 19.237616
value: 9.715572
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.y
value: 3.2581105
value: 2.604046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalScale.z
value: 19.237616
value: 9.715572
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 4ff3091676a78724ca2ae5d60353d400, type: 3}
propertyPath: m_LocalPosition.x
File diff suppressed because it is too large Load Diff
@@ -33,7 +33,6 @@ float3 GetScale(float3 PivotWS)
float GetShadow(float3 PositionWS)
{
float4 shadowCoord = TransformWorldToShadowCoord(PositionWS);
Light mainLight = GetMainLight(shadowCoord);
float shadow = 1 - mainLight.shadowAttenuation;
@@ -52,6 +51,31 @@ float GetShadow(float3 PositionWS)
return saturate(shadow);
}
void GetDetailLOD
(
float Depth,
float DetailSize,
float LODJitter,
out float DetailSizeA,
out float DetailSizeB,
out float LODBlend
)
{
const float lodRatio = 4;
const float lodSize = DetailSize / lodRatio * 2;
float dist = max(Depth, 1e-5);
float lod = log(dist) / log(lodRatio) + LODJitter; // log2(dist);
float lodFloor = floor(lod);
float lodFrac = lod - lodFloor;
LODBlend = lodFrac * lodFrac * (3 - 2 * lodFrac);
DetailSizeA = lodSize * pow(lodRatio, lodFloor);
DetailSizeB = lodSize * pow(lodRatio, lodFloor + 1);
}
float4 SampleBombedTexture
(
UnityTexture2D Tex,
@@ -116,7 +140,7 @@ ProjectionData GetProjections
(
float3 PositionOS,
float3 NormalOS,
float Blend
float ProjectionBlend
)
{
ProjectionData data;
@@ -134,7 +158,7 @@ ProjectionData GetProjections
float3(0, 0, 1)
};
float sharpness = lerp(2, 32, saturate(Blend));
float sharpness = lerp(2, 32, saturate(ProjectionBlend));
float maskSum = 0;
@@ -171,6 +195,69 @@ ProjectionData GetProjections
return data;
}
float4 SampleProjectedDetailLOD
(
UnityTexture2D DetailTex,
float3 PositionOS,
float3 NormalOS,
float ProjectionBlend,
float DetailSize,
float Depth
)
{
const float lodJitterStrength = .8;
const float lodJitterSize = 1.5;
float4 detail = 0;
float totalMask = 0;
ProjectionData projections = GetProjections
(
PositionOS,
NormalOS,
ProjectionBlend
);
[unroll]
for (int i = 0; i < 7; i++)
{
float mask = projections.mask[i];
float lodJitter = (Hash1From2D(floor(projections.uv[i] * lodJitterSize) + i * 17.13) - .5) * lodJitterStrength;
float detailSizeA;
float detailSizeB;
float lodBlend;
GetDetailLOD
(
Depth,
DetailSize,
lodJitter,
detailSizeA,
detailSizeB,
lodBlend
);
float4 detailA = SampleBombedTexture
(
DetailTex,
projections.uv[i] / detailSizeA
);
float4 detailB = SampleBombedTexture
(
DetailTex,
projections.uv[i] / detailSizeB
);
detail += lerp(detailA, detailB, lodBlend) * mask;
totalMask += mask;
}
return detail / max(totalMask, 1e-5);
}
void EnkiBillal_float
(
float4 Color,
@@ -179,6 +266,10 @@ void EnkiBillal_float
float3 PositionWS,
float3 NormalWS,
float ProjectionsBlend,
float DetailSize,
float4 FogColor,
float FogMin,
float FogMax,
out float3 Output
)
{
@@ -201,38 +292,26 @@ void EnkiBillal_float
// Detail
float4 detail = 0;
ProjectionData projections = GetProjections
(
positionOS,
normalOS,
ProjectionsBlend
);
float totalMask = 0;
[unroll]
for (int i = 0; i < 7; i++)
{
float mask = projections.mask[i];
detail += SampleBombedTexture
float4 detail = SampleProjectedDetailLOD
(
DetailTex,
projections.uv[i]
) * mask;
positionOS,
normalOS,
ProjectionsBlend,
DetailSize,
depth
totalMask += mask;
}
);
detail /= max(totalMask, 1e-5);
float detailMask = smoothstep(0, .8, detail.a);
// Fog
// Output
Output = Color.rgb;
Output = lerp(Color.rgb, Color.rgb * detail.rgb, detail.a);
//Output *= shadowAtten;
Output = lerp(Output.rgb, detail.rgb, detailMask);
Output = lerp(Output.rgb, FogColor.rgb, smoothstep(FogMin, FogMax, depth) * FogColor.a);
}
#endif
Binary file not shown.
@@ -106,6 +106,19 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 512
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
+2 -2
View File
@@ -1,11 +1,11 @@
<Solution>
<Project Path="Assembly-CSharp.csproj" />
<Project Path="Assembly-CSharp-Editor.csproj" />
<Project Path="AK.Wwise.Unity.MonoBehaviour.csproj" />
<Project Path="OctoCore.Runtime.csproj" />
<Project Path="Assembly-CSharp-Editor.csproj" />
<Project Path="AK.Wwise.Unity.API.csproj" />
<Project Path="AK.Wwise.Unity.MonoBehaviour.Editor.csproj" />
<Project Path="AK.Wwise.Unity.API.Editor.csproj" />
<Project Path="Assembly-CSharp.csproj" />
<Project Path="AK.Wwise.Unity.ProjectDatabase.csproj" />
<Project Path="AK.Wwise.Unity.Timeline.csproj" />
<Project Path="OctoCore.Editor.csproj" />