浏览代码

small updates, new data script to hold settings

/feature-infinite-sea
Andrem 3 年前
当前提交
420497fe
共有 9 个文件被更改,包括 147 次插入52 次删除
  1. 89
      Assets/scenes/Testing/InfiniteWater.unity
  2. 2
      Packages/com.verasl.water-system/Materials/InfiniteWater.mat
  3. 2
      Packages/com.verasl.water-system/Scripts/Data/WaterSettingsData.cs
  4. 2
      Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.cs
  5. 1
      Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs
  6. 1
      Packages/com.verasl.water-system/Scripts/Water.cs
  7. 99
      Packages/com.verasl.water-system/Scripts/Data/Data.cs
  8. 3
      Packages/com.verasl.water-system/Scripts/Data/Data.cs.meta
  9. 0
      .gitmodules

89
Assets/scenes/Testing/InfiniteWater.unity


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

objectReference: {fileID: 0}
- target: {fileID: 4554327062270080, guid: 2cac2e60f3f6f2447ad9b550450f60ed, type: 3}
propertyPath: m_RootOrder
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4554327062270080, guid: 2cac2e60f3f6f2447ad9b550450f60ed, type: 3}
propertyPath: m_LocalPosition.x

- target: {fileID: 114943683913522278, guid: 2cac2e60f3f6f2447ad9b550450f60ed,
type: 3}
propertyPath: m_Enabled
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114943683913522278, guid: 2cac2e60f3f6f2447ad9b550450f60ed,
type: 3}

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

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

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

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 611616626}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!84 &752176023
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 &867751506
GameObject:
m_ObjectHideFlags: 0

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

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1704475455}
m_LocalRotation: {x: 0.06903013, y: -0.3816137, z: 0.028593214, w: 0.921297}
m_LocalPosition: {x: 1.7, y: 5.62, z: 0}
m_LocalRotation: {x: 0.2719544, y: -0.2764688, z: -0.49521503, w: 0.77741104}
m_LocalPosition: {x: 9.56, y: 13.44, z: -15.93}
m_LocalEulerAnglesHint: {x: 8.57, y: -45.000004, z: 0}
m_LocalEulerAnglesHint: {x: 8.57, y: -45.000004, z: -68.55}
--- !u!114 &1704475460
MonoBehaviour:
m_ObjectHideFlags: 0

m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
--- !u!84 &1705656474
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!1001 &2012797122
PrefabInstance:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0694fda6617df4cd6a3d240f5eeb580b, type: 3}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0694fda6617df4cd6a3d240f5eeb580b, type: 3}
propertyPath: m_LocalScale.x

2
Packages/com.verasl.water-system/Materials/InfiniteWater.mat


m_PrefabAsset: {fileID: 0}
m_Name: InfiniteWater
m_Shader: {fileID: 4800000, guid: 5f51d4f8f480441339ead24ab495af7d, type: 3}
m_ShaderKeywords:
m_ShaderKeywords: _DEBUG_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

2
Packages/com.verasl.water-system/Scripts/Data/WaterSettingsData.cs


using UnityEngine;
using UnityEngine.Rendering.Universal;
namespace WaterSystem.Data
namespace WaterSystem
{
/// <summary>
/// This scriptable object stores teh graphical/rendering settings for a water system

2
Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.cs


using Unity.Mathematics;
using UnityEngine;
namespace WaterSystem.Data
namespace WaterSystem
{
/// <summary>
/// This scriptable object contains setting for how the water looks visually

1
Packages/com.verasl.water-system/Scripts/GerstnerWavesJobs.cs


using Unity.Mathematics;
using Unity.Collections;
using UnityEngine.Rendering.Universal;
using WaterSystem.Data;
namespace WaterSystem
{

1
Packages/com.verasl.water-system/Scripts/Water.cs


using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering.Universal;
using WaterSystem.Data;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;

99
Packages/com.verasl.water-system/Scripts/Data/Data.cs


using System.Collections.Generic;
using UnityEngine;
using Unity.Mathematics;
namespace WaterSystem
{
public class Data
{
/// <summary>
/// This class stores the settings for a water system
/// </summary>
[System.Serializable]
public class WaterSettings
{
// General
public GeometryType waterGeomType; // The type of geometry, either vertex offset or tessellation
public ReflectionType refType = ReflectionType.PlanarReflection; // How the reflections are generated
public bool isInfinite; // Is the water infinite (shader incomplete)
public int randomSeed = 3234;
// Cubemap settings
public Cubemap cubemapRefType;
// Visual Surface
public float _waterMaxVisibility = 40.0f;
public Gradient _absorptionRamp;
public Gradient _scatterRamp;
// Waves
public List<Wave> _waves = new List<Wave>();
public bool _customWaves = false;
public BasicWaves _basicWaveSettings = new BasicWaves(1.5f, 45.0f, 5.0f);
}
/// <summary>
/// Basic wave type, this is for the base Gerstner wave values
/// it will drive automatic generation of n amount of waves
/// </summary>
[System.Serializable]
public class BasicWaves
{
public int numWaves = 6;
public float amplitude;
public float direction;
public float wavelength;
public BasicWaves(float amp, float dir, float len)
{
numWaves = 6;
amplitude = amp;
direction = dir;
wavelength = len;
}
}
/// <summary>
/// Class to describe a single Gerstner Wave
/// </summary>
[System.Serializable]
public struct Wave
{
public float amplitude; // height of the wave in units(m)
public float direction; // direction the wave travels in degrees from Z+
public float wavelength; // distance between crest>crest
public float2 origin; // Omi directional point of origin
public float onmiDir; // Is omni?
public Wave(float amp, float dir, float length, float2 org, bool omni)
{
amplitude = amp;
direction = dir;
wavelength = length;
origin = org;
onmiDir = omni ? 1 : 0;
}
}
/// <summary>
/// The type of reflection source, custom cubemap, closest refelction probe, planar reflection
/// </summary>
[System.Serializable]
public enum ReflectionType
{
Cubemap,
ReflectionProbe,
PlanarReflection
}
/// <summary>
/// The type of geometry, either vertex offset or tessellation
/// </summary>
[System.Serializable]
public enum GeometryType
{
VertexOffset,
Tesselation
}
}
}

3
Packages/com.verasl.water-system/Scripts/Data/Data.cs.meta


fileFormatVersion: 2
guid: 1b95c6b10a7f44339ecf5526d79dba74
timeCreated: 1620826726

0
.gitmodules

正在加载...
取消
保存