浏览代码

tweaks to the cloud system

/feature-new-clouds
Andrem 4 年前
当前提交
5cf50635
共有 10 个文件被更改,包括 1288 次插入1481 次删除
  1. 3
      Assets/Objects/environment/Clouds/CloudLayer.mat
  2. 773
      Assets/Objects/environment/Clouds/CloudLayers.shadergraph
  3. 748
      Assets/Objects/environment/Clouds/Clouds.shadergraph
  4. 14
      Assets/Objects/environment/Clouds/ComputeLightmap.shadersubgraph
  5. 6
      Assets/Objects/environment/Clouds/Shader Graphs_Clouds.mat
  6. 11
      Assets/Scripts/Environment/CloudRenderer.cs
  7. 10
      Assets/Scripts/Utility/SkyboxSystem.cs
  8. 193
      Assets/scenes/demo_Island.unity
  9. 1001
      Assets/Objects/environment/Clouds/TransformWorldToSkybox.shadersubgraph
  10. 10
      Assets/Objects/environment/Clouds/TransformWorldToSkybox.shadersubgraph.meta

3
Assets/Objects/environment/Clouds/CloudLayer.mat


m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 3300
stringTagMap: {}
disabledShaderPasses:
- SHADOWCASTER

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- Vector1_5938df77fca14c0db6439fcfee84628c: 0
- _AlphaClip: 0

773
Assets/Objects/environment/Clouds/CloudLayers.shadergraph
文件差异内容过多而无法显示
查看文件

748
Assets/Objects/environment/Clouds/Clouds.shadergraph
文件差异内容过多而无法显示
查看文件

14
Assets/Objects/environment/Clouds/ComputeLightmap.shadersubgraph


"m_Node": {
"m_Id": "84ce803260cc450a9e4b0b3233c63858"
},
"m_SlotId": 2
"m_SlotId": 1
}
},
{

"m_Node": {
"m_Id": "84ce803260cc450a9e4b0b3233c63858"
},
"m_SlotId": 1
"m_SlotId": 2
}
}
],

"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -446.0,
"y": 254.99998474121095,
"x": -445.0000305175781,
"y": 210.99998474121095,
"width": 101.0,
"height": 34.0
}

"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -447.9999694824219,
"y": 208.00003051757813,
"width": 103.0,
"x": -447.0000305175781,
"y": 245.0,
"width": 102.99999237060547,
"height": 34.0
}
},

6
Assets/Objects/environment/Clouds/Shader Graphs_Clouds.mat


m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 3600
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:

m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- BOOLEAN_68600FB702FC441CA4969E5B54503936: 1
- Cloud_Fade: 0

m_Colors: []
m_Colors:
- _Color: {r: 0, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []

11
Assets/Scripts/Environment/CloudRenderer.cs


{
var camPos = Camera.main.transform.position;
ps.GetParticles(parts);
var l = parts.ToList().OrderByDescending(x => Vector3.Distance(x.position * 64f, camPos));
var l = parts.ToList().OrderByDescending(x => Vector3.Distance(x.position, camPos));
parts = l.ToArray();
}
}

if (!cloudMaterial || cloudMeshes == null || cloudMeshes.Length == 0) return;
var camPos = camera.transform.position * (1f / 64f);
var camPos = camera.transform.position;
var pos = particle.position * SkyboxSystem.SkyboxScale + camPos * (1 - SkyboxSystem.SkyboxScale);
var q = Quaternion.LookRotation(particle.position - camPos);
Random.InitState((int)particle.randomSeed);
var mesh = cloudMeshes[Random.Range(0, cloudMeshes.Length)];

m.SetColors(colors);
m.UploadMeshData(true);*/
Graphics.DrawMesh(mesh, Matrix4x4.TRS(particle.position, q, particle.startSize3D), cloudMaterial, LayerMask.NameToLayer("3DSkybox"), camera);
MaterialPropertyBlock mpb = new MaterialPropertyBlock();
mpb.SetFloat("Cloud_Fade", particle.GetCurrentColor(ps).a / 255f);
Graphics.DrawMesh(mesh, Matrix4x4.TRS(pos, q, particle.startSize3D * SkyboxSystem.SkyboxScale), cloudMaterial, LayerMask.NameToLayer("3DSkybox"), camera, 0, mpb, false, false, false);
}
}
}

10
Assets/Scripts/Utility/SkyboxSystem.cs


{
public int scalefactor = 64;
public static float SkyboxScale { get; set; }
public Renderer[] renderList;
private void OnEnable()

CollectRenderers();
}

private void OnCamera(ScriptableRenderContext context, Camera camera)
{
transform.position = Vector3.Lerp(camera.transform.position, Vector3.zero, 1f / scalefactor);
var scaleRatio = 1.0f / scalefactor;
SkyboxScale = scaleRatio;
transform.position = camera.transform.position * (1 - scaleRatio);
transform.localScale = Vector3.one * scaleRatio;
transform.localScale = Vector3.one;
}
}

193
Assets/scenes/demo_Island.unity


NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &136724319
MonoBehaviour:
m_ObjectHideFlags: 0

FieldOfView: 60
OrthographicSize: 10
NearClipPlane: 3
FarClipPlane: 1600
FarClipPlane: 200
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 2.322169, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

m_Mode: 0
m_NumColorKeys: 4
m_NumAlphaKeys: 2
_northHeading: 268.5
_northHeading: 45
_tilt: 27.6
_ambientColour:
serializedVersion: 2

type: 3}
m_PrefabInstance: {fileID: 6589000189408555943}
m_PrefabAsset: {fileID: 0}
--- !u!84 &353454963
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WaterDepthMap
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 3
m_Width: 1024
m_Height: 1024
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 2
m_ColorFormat: 142
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
--- !u!1 &532100838
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 545559182}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 60, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1692014444}

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 545559182}
m_Enabled: 1
m_Enabled: 0
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 545559182}
serializedVersion: 8
serializedVersion: 7
lengthInSec: 10
simulationSpeed: 1
stopAction: 0

emitterVelocityMode: 0
useRigidbodyForVelocity: 1
startDelay:
serializedVersion: 2
minMaxState: 0

startSize:
serializedVersion: 2
minMaxState: 0
scalar: 200
scalar: 30
minScalar: 1
maxCurve:
serializedVersion: 2

m_RotationOrder: 4
randomizeRotationDirection: 0
maxNumParticles: 150
customEmitterVelocity: {x: 0, y: 0, z: 0}
size3D: 0
rotation3D: 0
gravityModifier:

boxThickness: {x: 0, y: 0, z: 0}
radiusThickness: 0.8
donutRadius: 0.2
m_Position: {x: 0, y: 10, z: 0}
m_Position: {x: 0, y: 120, z: 0}
m_Rotation: {x: 90, y: 0, z: 0}
m_Scale: {x: 1, y: 1, z: 1}
placementMode: 0

sphericalDirectionAmount: 0
randomPositionAmount: 0
radius:
value: 1000
value: 2000
mode: 0
spread: 0
speed:

rateOverTime:
serializedVersion: 2
minMaxState: 0
scalar: 2
scalar: 1
minScalar: 10
maxCurve:
serializedVersion: 2

flipU: 0
flipV: 0
VelocityModule:
enabled: 0
enabled: 1
scalar: 0
scalar: 2
minScalar: 0
maxCurve:
serializedVersion: 2

z:
serializedVersion: 2
minMaxState: 0
scalar: 0
scalar: -5
minScalar: 0
maxCurve:
serializedVersion: 2

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 545559182}
m_Enabled: 0
m_Enabled: 1
cloudMeshes: []
cloudMeshes:
- {fileID: 382919693584978386, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: 6318552779758539284, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: -955443974493614115, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: 8443598604222542702, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: -3765698233524180676, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: 8141766512691762901, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: 8099458318676092648, guid: 8b7e5305947554a418af3eb802471592, type: 2}
- {fileID: -5931177623366898132, guid: 8b7e5305947554a418af3eb802471592, type: 2}
cloudMaterial: {fileID: 2100000, guid: dd76f393b89c7c043a07be4d99495f5d, type: 2}
ps: {fileID: 545559185}
--- !u!1 &598956450

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

m_GameObject: {fileID: 625153744}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 3, y: 2, z: 3}
m_LocalScale: {x: 4, y: 3, z: 4}
m_Children: []
m_Father: {fileID: 1692014444}
m_RootOrder: 1

m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

serializedVersion: 6
m_Component:
- component: {fileID: 1692014444}
- component: {fileID: 1692014443}
m_Layer: 0
m_Name: 3DSkybox
m_TagString: Untagged

m_IsActive: 1
--- !u!114 &1692014443
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1692014442}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c2fa06bbaa7034232800d93136e0d361, type: 3}
m_Name:
m_EditorClassIdentifier:
scalefactor: 64
renderList:
- {fileID: 545559184}
- {fileID: 625153746}
--- !u!4 &1692014444
Transform:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!84 &1729339692
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WaterDepthMap
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 3
m_Width: 1024
m_Height: 1024
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 2
m_ColorFormat: 142
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
--- !u!1 &1819032311
GameObject:
m_ObjectHideFlags: 0

NearClipPlane: 0.5
FarClipPlane: 500
Dutch: 0
ModeOverride: 0
GateFit: 0
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

- target: {fileID: 7096263784801332180, guid: e70416e3bc35d4004a9981d0ac102ba5,
type: 3}
propertyPath: m_Color.b
value: 0.7287736
value: 0.12972099
value: 0.89161044
value: 0.46709222
value: 0.9716981
value: 0.96337306
objectReference: {fileID: 0}
- target: {fileID: 7121332023826027706, guid: e70416e3bc35d4004a9981d0ac102ba5,
type: 3}

- target: {fileID: 8115735017685696522, guid: e70416e3bc35d4004a9981d0ac102ba5,
type: 3}
propertyPath: m_LocalRotation.w
value: -0.44779894
value: 0.7795137
value: -0.53654194
value: 0.45351806
value: -0.66060746
value: -0.17112681
value: 0.27422032
value: 0.3967308
objectReference: {fileID: 0}
- target: {fileID: 8367957410019747705, guid: e70416e3bc35d4004a9981d0ac102ba5,
type: 3}

- target: {fileID: 7003470173341666312, guid: 530da10d6c4d9442e9e8d5eeb77a25d8,
type: 3}
propertyPath: m_LocalPosition.x
value: 94.45
value: 79.31467
value: 1
value: 4.2
value: 86.1
value: 75.14782
value: 0.5130581
value: 0.75855076
value: -0.059816625
value: -0.0078001926
value: -0.85050625
value: -0.6515342
value: -0.099159166
value: -0.006561775
objectReference: {fileID: 0}
- target: {fileID: 7003470173341666312, guid: 530da10d6c4d9442e9e8d5eeb77a25d8,
type: 3}

- target: {fileID: 7003470173341666315, guid: 530da10d6c4d9442e9e8d5eeb77a25d8,
type: 3}
propertyPath: field of view
value: 50
value: 60
value: 1600
value: 200
objectReference: {fileID: 0}
- target: {fileID: 7003470173341666315, guid: 530da10d6c4d9442e9e8d5eeb77a25d8,
type: 3}

1001
Assets/Objects/environment/Clouds/TransformWorldToSkybox.shadersubgraph
文件差异内容过多而无法显示
查看文件

10
Assets/Objects/environment/Clouds/TransformWorldToSkybox.shadersubgraph.meta


fileFormatVersion: 2
guid: d6d87caf0f410467690bdefce482256b
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
正在加载...
取消
保存