浏览代码

Latest changes

/main
Andre McGrail 6 年前
当前提交
ed67b62e
共有 6 个文件被更改,包括 348 次插入42 次删除
  1. 19
      Assets/Data/LightweightAsset.asset
  2. 12
      Assets/Shaders/Vegetation/ShadowPassVegetation.hlsl
  3. 334
      Assets/scenes/Island.unity
  4. 2
      Packages/com.verasl.water-system/Scripts/Rendering/PlanerReflections.cs
  5. 10
      Packages/com.verasl.water-system/Scripts/Water.cs
  6. 13
      Packages/manifest.json

19
Assets/Data/LightweightAsset.asset


m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_GeneratorAsset: {fileID: 0}
m_RequireOpaqueTexture: 1
m_RequireOpaqueTexture: 0
m_OpaqueDownsampling: 0
m_SupportsHDR: 1
m_MSAA: 4

m_AdditionalLightsPerObjectLimit: 4
m_AdditionalLightShadowsSupported: 0
m_AdditionalLightsShadowmapResolution: 512
m_ShadowDistance: 250
m_ShadowCascades: 2
m_Cascade2Split: 0.13998428
m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
m_ShadowDistance: 20
m_ShadowCascades: 1
m_Cascade2Split: 0.2065341
m_Cascade4Split: {x: 0.08992797, y: 0.2670195, z: 0.54989254}
m_ShadowDepthBias: 1
m_ShadowNormalBias: 1
m_SavedXRConfig:
renderScale: 1
viewportScale: 1
useOcclusionMesh: 1
occlusionMaskScale: 1
m_ShadowType: 2
m_LocalShadowsSupported: 0
m_LocalShadowsAtlasResolution: 512

m_ShaderVariantLogLevel: 0

12
Assets/Shaders/Vegetation/ShadowPassVegetation.hlsl


#define SHADOW_PASS_VEGETATION_INCLUDED
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Shadows.hlsl"
// x: global clip space bias, y: normal world space bias
float4 _ShadowBias;
float3 _LightDirection;
struct VertexInput

VertexPositionInputs vertexPosition = GetVertexPositionInputs(input.positionOS);
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
float invNdotL = 1.0 - saturate(dot(_LightDirection, normalWS));
float scale = invNdotL * _ShadowBias.y;
float4 clipPos = TransformWorldToHClip(ApplyShadowBias(vertexPosition.positionWS, normalWS, _LightDirection));
// normal bias is negative since we want to apply an inset normal offset
float3 positionWS = normalWS * scale.xxx + vertexPosition.positionWS;
float4 clipPos = TransformWorldToHClip(positionWS);
// _ShadowBias.x sign depens on if platform has reversed z buffer
clipPos.z += _ShadowBias.x;
#if UNITY_REVERSED_Z
clipPos.z = min(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);

334
Assets/scenes/Island.unity
文件差异内容过多而无法显示
查看文件

2
Packages/com.verasl.water-system/Scripts/Rendering/PlanerReflections.cs


LWRPAdditionalCameraData lwrpCamData =
go.AddComponent(typeof(LWRPAdditionalCameraData)) as LWRPAdditionalCameraData;
lwrpCamData.renderShadows = false; // turn off shadows for the reflection camera
lwrpCamData.requiresColorOption = CameraOverrideOption.Off;
lwrpCamData.requiresDepthOption = CameraOverrideOption.Off;
var reflectionCamera = go.GetComponent<Camera>();
reflectionCamera.transform.SetPositionAndRotation(transform.position, transform.rotation);
reflectionCamera.targetTexture = m_ReflectionTexture;

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


_depthCam.nearClipPlane =0.1f;
_depthCam.farClipPlane = surfaceData._waterMaxVisibility;
_depthCam.allowHDR = false;
//_depthCam.allowMSAA = false;
_depthCam.allowMSAA = false;
_depthCam.cullingMask = (1 << 10);
//Generate RT
if (!_depthTex)

//Vector4 zParams = new Vector4(1-f/n, f/n, (1-f/n)/f, (f/n)/f);//2015
Shader.SetGlobalVector("_depthCamZParams", zParams);
#if UNITY_EDITOR
/* Texture2D tex2D = new Texture2D(1024, 1024, TextureFormat.Alpha8, false);
/* #if UNITY_EDITOR
Texture2D tex2D = new Texture2D(1024, 1024, TextureFormat.Alpha8, false);
System.IO.File.WriteAllBytes(Application.dataPath + "/WaterDepth.png", image);*/
#endif
System.IO.File.WriteAllBytes(Application.dataPath + "/WaterDepth.png", image);
#endif*/
_depthCam.enabled = false;
_depthCam.targetTexture = null;

13
Packages/manifest.json


"dependencies": {
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.0.9",
"com.unity.burst": "0.2.4-preview.30",
"com.unity.burst": "0.2.4-preview.35",
"com.unity.mathematics": "0.0.12-preview.17",
"com.unity.mathematics": "0.0.12-preview.19",
"com.unity.postprocessing": "2.0.15-preview",
"com.unity.postprocessing": "2.0.17-preview",
"com.unity.render-pipelines.core": "file:D:/UnityProject/ScriptableRenderPipeline/com.unity.render-pipelines.core",
"com.unity.render-pipelines.lightweight": "file:D:/UnityProject/ScriptableRenderPipeline/com.unity.render-pipelines.lightweight",
"com.unity.shadergraph": "file:D:/UnityProject/ScriptableRenderPipeline/com.unity.shadergraph",
"com.unity.render-pipelines.core": "file:/Users/andremcgrail/Documents/UnityProjects/SRP/ScriptableRenderPipeline/Assets/com.unity.render-pipelines.core",
"com.unity.render-pipelines.lightweight": "file:/Users/andremcgrail/Documents/UnityProjects/SRP/ScriptableRenderPipeline/Assets/com.unity.render-pipelines.lightweight",
"com.unity.shadergraph": "file:/Users/andremcgrail/Documents/UnityProjects/SRP/ScriptableRenderPipeline/Assets/com.unity.shadergraph",
"com.unity.xr.legacyinputhelpers": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",

正在加载...
取消
保存