wip: HouseOfLeaves lookdev

This commit is contained in:
Alexandre Coirier
2026-06-10 00:38:26 +02:00
parent 53c07af7a7
commit 13b5909faa
9 changed files with 3174 additions and 425 deletions
@@ -117,7 +117,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Progression: 0
- _Progression: 0.84
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
@@ -134,6 +134,11 @@ Material:
m_Colors:
- _BaseColor: {r: 0.8714051, g: 0.7282247, b: 0.42010283, a: 1}
- _Color: {r: 0.8714051, g: 0.7282247, b: 0.4201028, a: 1}
- _ColorA: {r: 0.058823504, g: 0.10980386, b: 0.03921569, a: 1}
- _ColorB: {r: 0.16078427, g: 0.24313727, b: 0.17647055, a: 1}
- _ColorC: {r: 0.29019606, g: 0.49411762, b: 0.30196077, a: 1}
- _ColorD: {r: 0.7607843, g: 0.5803921, b: 0.21960783, a: 1}
- _ColorE: {r: 0.9921569, g: 0.9490196, b: 0.7019608, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SandColor: {r: 0.98742133, g: 0.7008138, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
File diff suppressed because it is too large Load Diff
+239 -1
View File
@@ -202,7 +202,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 300277218}
m_Enabled: 1
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
@@ -645,6 +645,14 @@ PrefabInstance:
propertyPath: _firstPerson.GamepadSensitivityY
value: 150
objectReference: {fileID: 0}
- target: {fileID: 6989128982853398086, guid: 6493d77978c5c1246a0410d1f9204524, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6989128982853398086, guid: 6493d77978c5c1246a0410d1f9204524, type: 3}
propertyPath: m_RenderPostProcessing
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8162540767767967414, guid: 6493d77978c5c1246a0410d1f9204524, type: 3}
propertyPath: m_Name
value: OctoPlayerFP
@@ -707,6 +715,118 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 8162540767767967414, guid: 6493d77978c5c1246a0410d1f9204524, type: 3}
m_PrefabInstance: {fileID: 917697128}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1330692871
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1330692875}
- component: {fileID: 1330692874}
- component: {fileID: 1330692873}
- component: {fileID: 1330692872}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!135 &1330692872
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330692871}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 0
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1330692873
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330692871}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1330692874
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330692871}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1330692875
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330692871}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.48, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1358030458
GameObject:
m_ObjectHideFlags: 0
@@ -771,6 +891,118 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1384323713
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1384323714}
- component: {fileID: 1384323717}
- component: {fileID: 1384323716}
- component: {fileID: 1384323715}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1384323714
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1384323713}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.4, z: 50}
m_LocalScale: {x: 3, y: 3, z: 200}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1920554116}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1384323715
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1384323713}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1384323716
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1384323713}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -876546973899608171, guid: 335a9317bc21e2d47b3825d718411b21, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1384323717
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1384323713}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1440149443
GameObject:
m_ObjectHideFlags: 0
@@ -1226,6 +1458,10 @@ PrefabInstance:
propertyPath: m_Name
value: houseOfLeaves
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: bc77fc4360cf7554d882153c57d02f91, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: bc77fc4360cf7554d882153c57d02f91, type: 3}
propertyPath: m_StaticEditorFlags
value: 2147483647
@@ -1667,6 +1903,7 @@ Transform:
m_Children:
- {fileID: 1490996584}
- {fileID: 300277222}
- {fileID: 1384323714}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
@@ -1679,3 +1916,4 @@ SceneRoots:
- {fileID: 1920554116}
- {fileID: 115224640}
- {fileID: 758186735}
- {fileID: 1330692875}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6258fd24575ee324985ac65fcbea502d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 335a9317bc21e2d47b3825d718411b21
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 0
exposeTemplateAsShader: 0
template:
name:
category:
description:
icon: {instanceID: 0}
thumbnail: {instanceID: 0}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 81f2c6150b6eae3489f5886d0aeeb72e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,190 @@
#ifndef HOUSE_OF_LEAVES_INCLUDED
#define HOUSE_OF_LEAVES_INCLUDED
#include "Assets/_Content/Shaders/Include/Noises.hlsl"
float Hash(float n)
{
return frac(sin(n * 127.1) * 43758.5453123);
}
float3 ColorRemapRandom
(
float rnd,
float3 ColorA,
float3 ColorB,
float3 ColorC,
float3 ColorD,
float3 ColorE,
float wA,
float wB,
float wC,
float wD
)
{
if (rnd < wA)
return ColorA;
if (rnd < wA + wB)
return ColorB;
if (rnd < wA + wB + wC)
return ColorC;
if (rnd < wA + wB + wC + wD)
return ColorD;
return ColorE;
}
float3 ColorRemapLinear
(
float Gradient,
float3 ColorA,
float3 ColorB,
float3 ColorC,
float3 ColorD,
float3 ColorE
)
{
float3 col = ColorA;
col = lerp(col, ColorB, smoothstep(0.0, .25, Gradient));
col = lerp(col, ColorC, smoothstep(.25, .50, Gradient));
col = lerp(col, ColorD, smoothstep(.50, .75, Gradient));
col = lerp(col, ColorE, smoothstep(.75, 1.0, Gradient));
return col;
}
void Sand_float
(
float4 ColorA,
float4 ColorB,
float4 ColorC,
float4 ColorD,
float4 ColorE,
float Progression,
float3 PositionWS,
float3 NormalWS,
out float3 Color,
out float3 Position,
out float Height,
out float Alpha
)
{
float t = Progression;
t -= RidgedNoise3D(PositionWS, .3, 1, 2, .5) * .3;
float depth = length(PositionWS - _WorldSpaceCameraPos.xyz);
float arkMask = 0;
// Sand
float sandLayers = 6;
float sandDirection = cos(t * sandLayers * 3.14);
float sandPatern = RidgedNoise3D(PositionWS + float3(sandDirection, 0, 0), .6, 1, 2, .5) * .8;
sandPatern += 1 - RidgedNoise3D(PositionWS + float3(0, 0, t * sandLayers * 2), .8, 2, 2, .5) * .2;
float sandDensity = sqrt(smoothstep(0, 2, abs(PositionWS.x) + sandPatern));
float sandGradientSign = (floor(t * sandLayers) % 2 == 0) ? 1 : -1;
float sandGradient = smoothstep(2 * -sandGradientSign, 2 * sandGradientSign, PositionWS.x);
float sandPhase = frac(t * sandLayers);
float sandFlow = smoothstep(sandPhase * 2, sandPhase * 2 - 1, sandGradient);
sandFlow = (sandFlow + floor(t * sandLayers)) / sandLayers;
float sandMask = sandFlow * 1.5 - t * .8 + (sandPatern * 2 - 1) * sandDensity * t * .3;
sandMask *= sandDensity * .7 + .3;
// Output
Color = ColorRemapLinear(saturate(pow(smoothstep(5, 30, depth * sandPatern), .5)), ColorA, ColorB, ColorC, ColorD, ColorE);
Position = PositionWS;
Position.y += sandMask;
Height = sandMask;
Alpha = smoothstep(1, .5, abs(smoothstep(-20, 20, PositionWS.x) * 2 - 1));
}
void HouseOfLeaves_float
(
float4 ColorA,
float4 ColorB,
float4 ColorC,
float4 ColorD,
float4 ColorE,
float3 PositionWS,
float3 NormalWS,
out float3 Output
)
{
float n0 = FBMNoise3D(PositionWS, 01, 2, 2, .5);
float n1 = FBMNoise3D(PositionWS * float3(1, 1, .5) + n0 + float3(floor(_Time.y * 1.6), 0, 0), 60, 2, 2, .5);
float n2 = PerlinNoise3D(PositionWS * float3(1, 1, 30) + float3(floor(_Time.y * 4), 0, 0), 1);
float n3 = RidgedNoise3D(PositionWS * float3(n0, n1, n2 + 4) + float3(floor(_Time.y * 1), 0, 0), .3, 2, 2, 1);
float depth = distance(_WorldSpaceCameraPos.xyz, PositionWS);
float gradient = smoothstep(-30, 100, PositionWS.z);
gradient += ((n1 * 2 - 1) * step(n0, .5)) * .001;
gradient += n2 * .006;
gradient -= NormalWS.y * .001;
float t = 0;
float bands = 300 + t;
float bandPos = gradient * bands;
float bandIndex = floor(bandPos);
float bandFrac = frac(bandPos);
float wA = pow(1.0 - gradient, 4.0);
float wB = pow(1.0 - abs(gradient - .25) * 2.0, 2.0);
float wC = pow(1.0 - abs(gradient - .50) * 2.0, 2.0);
float wD = pow(1.0 - abs(gradient - .75) * 2.0, 2.0);
float wE = .1 + pow(gradient, 4.0);
float total = wA + wB + wC + wD + wE;
wA /= total;
wB /= total;
wC /= total;
wD /= total;
wE /= total;
float rnd0 = Hash(bandIndex);
float3 col0 = ColorRemapRandom(
rnd0,
ColorA.rgb,
ColorB.rgb,
ColorC.rgb,
ColorD.rgb,
ColorE.rgb,
wA, wB, wC, wD
);
float depthAtten = smoothstep(50, 100, depth);
float3 col = lerp(col0, _ColorB, n0 - n1);
col = lerp(col, _ColorA, smoothstep(.8 - gradient, .7 - gradient, n3) * .8);
col = lerp(col, _ColorE, pow(depthAtten, 2));
col = lerp(col, _ColorA, pow(smoothstep(.2 + n2 * 4, 0, PositionWS.y), 2) * (1 - depthAtten) * .95);
col = lerp(col, _ColorA * .1, smoothstep(0, -30, PositionWS.z));
float blendWidth = .05;
float blend = smoothstep(
1.0 - blendWidth,
1.0,
bandFrac
);
Output = col;
}
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9c8656d649d6e8b4f9e05b6ac390d1c9
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: