浏览代码

Merge pull request #1514 from Unity-Technologies/lw/bugfixes

Lw/bugfixes
/main
GitHub 6 年前
当前提交
7b5dafbd
共有 6 个文件被更改,包括 15 次插入7 次删除
  1. 5
      com.unity.render-pipelines.lightweight/CHANGELOG.md
  2. 2
      com.unity.render-pipelines.lightweight/LWRP/Data/LightweightPipelineAsset.cs
  3. 2
      com.unity.render-pipelines.lightweight/LWRP/LightweightForwardRenderer.cs
  4. 2
      com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/Input.hlsl
  5. 5
      com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/InputSurfacePBR.hlsl
  6. 6
      com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/Lighting.hlsl

5
com.unity.render-pipelines.lightweight/CHANGELOG.md


and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Occlusion strength not being applied on LW standard shaders
- CopyDepth pass is being called even when a depth from prepass is available
- GLES2 shader compiler error in IntegrationTests
- Can't set RenderScale and ShadowDistance by script
## [2.0.1-preview]

2
com.unity.render-pipelines.lightweight/LWRP/Data/LightweightPipelineAsset.cs


public float renderScale
{
get { return m_RenderScale; }
set { m_RenderScale = value; }
}
public bool supportsDynamicBatching

public float shadowDistance
{
get { return m_ShadowDistance; }
set { m_ShadowDistance = value; }
}
public int cascadeCount

2
com.unity.render-pipelines.lightweight/LWRP/LightweightForwardRenderer.cs


bool requiresDepthAttachment = requiresCameraDepth && !requiresDepthPrepass;
bool requiresColorAttachment = RequiresIntermediateColorTexture(ref renderingData.cameraData, baseDescriptor, requiresDepthAttachment);
int[] colorHandles = (requiresColorAttachment) ? new[] {RenderTargetHandles.Color} : null;
int depthHandle = (requiresColorAttachment) ? RenderTargetHandles.DepthAttachment : -1;
int depthHandle = (requiresDepthAttachment) ? RenderTargetHandles.DepthAttachment : -1;
EnqueuePass(cmd, RenderPassHandles.ForwardLit, baseDescriptor, colorHandles, depthHandle, renderingData.cameraData.msaaSamples);
context.ExecuteCommandBuffer(cmd);

2
com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/Input.hlsl


float4 _ScaledScreenParams;
CBUFFER_END
#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
#endif
#define UNITY_MATRIX_M unity_ObjectToWorld
#define UNITY_MATRIX_I_M unity_WorldToObject

5
com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/InputSurfacePBR.hlsl


half SampleOcclusion(float2 uv)
{
#ifdef _OCCLUSIONMAP
#if (SHADER_TARGET < 30)
// SM20: instruction count limitation
// SM20: simpler occlusion
// TODO: Controls things like these by exposing SHADER_QUALITY levels (low, medium, high)
#if defined(SHADER_API_GLES)
return SAMPLE_TEXTURE2D(_OcclusionMap, sampler_OcclusionMap, uv).g;
#else
half occ = SAMPLE_TEXTURE2D(_OcclusionMap, sampler_OcclusionMap, uv).g;

6
com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/Lighting.hlsl


// If lightmap is not defined than we evaluate GI (ambient + probes) from SH
// We might do it fully or partially in vertex to save shader ALU
#if !defined(LIGHTMAP_ON)
#if defined(SHADER_API_GLES) || (SHADER_TARGET < 30) || !defined(_NORMALMAP)
// TODO: Controls things like these by exposing SHADER_QUALITY levels (low, medium, high)
#if defined(SHADER_API_GLES) || !defined(_NORMALMAP)
// Evaluates SH fully in vertex
#define EVALUATE_SH_VERTEX
#elif !SHADER_HINT_NICE_QUALITY

half ReflectivitySpecular(half3 specular)
{
#if (SHADER_TARGET < 30)
// SM2.0: instruction count limitation
#if defined(SHADER_API_GLES)
return specular.r; // Red channel - because most metals are either monocrhome or with redish/yellowish tint
#else
return max(max(specular.r, specular.g), specular.b);

正在加载...
取消
保存