浏览代码

Fixed depth issue on GLES - temporary fix

/main
Andre McGrail 6 年前
当前提交
c5e98cad
共有 3 个文件被更改,包括 12 次插入6 次删除
  1. 2
      Assets/Shaders/Vegetation/LWVegetationShader.shader
  2. 11
      Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.asset
  3. 5
      Packages/com.verasl.water-system/Scripts/Water.cs

2
Assets/Shaders/Vegetation/LWVegetationShader.shader


// Lighting.hlsl will include the light functions/data to abstract light constants. You should use GetMainLight and GetLight functions
// that initialize Light struct. Lighting.hlsl also include GI, Light BDRF functions. It also includes Shadows.
//#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
// Not required but included here for simplicity. This defines all material related constants for the Standard surface shader like _Color, _MainTex, and so on.
// Not required but included here for simplicity. This defines all material related constants for the Standard surface shader like _Color, _MainTex, and so on.
// These are specific to this shader. You should define your own constants.
#include "InputSurfaceVegetation.hlsl"
#include "Vegetation.hlsl"

11
Packages/com.verasl.water-system/Scripts/Data/WaterSurfaceData.asset


m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_GeneratorAsset: {fileID: 0}
_waterMaxVisibility: 40
_waterMaxVisibility: 20
key0: {r: 0.8820755, g: 0.9656054, b: 1, a: 1}
key1: {r: 0.13333333, g: 0.77513605, b: 0.8666667, a: 1}
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 0.18396229, g: 0.89963174, b: 1, a: 1}
key2: {r: 0.021626905, g: 0.49048996, b: 0.509434, a: 0}
key3: {r: 0, g: 0.275, b: 0.44, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}

ctime0: 0
ctime1: 4819
ctime1: 6746
ctime2: 20817
ctime3: 43581
ctime4: 65535

key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 9830
ctime1: 12914
ctime2: 27525
ctime3: 65535
ctime4: 0

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


//Generate RT
if (!_depthTex)
_depthTex = new RenderTexture(1024, 1024, 24, RenderTextureFormat.Depth, RenderTextureReadWrite.Linear);
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES2 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3)
{
_depthTex.filterMode = FilterMode.Point;
_depthTex.wrapMode = TextureWrapMode.Clamp;
}
_depthTex.name = "WaterDepthMap";
//do depth capture
_depthCam.targetTexture = _depthTex;

正在加载...
取消
保存