浏览代码

Merge pull request #1877 from Unity-Technologies/fabric-light-vol-fix

Fixing a warning in the fabric shader compilation
/hdrp-staging
GitHub 6 年前
当前提交
ac20dcb1
共有 4 个文件被更改,包括 10 次插入2 次删除
  1. 7
      com.unity.render-pipelines.high-definition/HDRP/Debug/DebugLightVolume.shader
  2. 1
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs
  3. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs
  4. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Fabric/FabricData.hlsl

7
com.unity.render-pipelines.high-definition/HDRP/Debug/DebugLightVolume.shader


struct AttributesDefault
{
float4 positionOS : POSITION;
float3 positionOS : POSITION;
};
struct VaryingsDefault

float3 _Range;
float3 _Offset;
float4 _Color;
float _RequireToFlipInputTexture;
VaryingsDefault vert(AttributesDefault att)
{

output.positionCS = TransformWorldToHClip(positionRWS);
if (_RequireToFlipInputTexture > 0.0)
{
output.positionCS.y = 1.0 - output.positionCS.y;
}
return output;
}

1
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CustomEditor(typeof(DecalProjectorComponent))]
[CanEditMultipleObjects]
public class DecalProjectorComponentEditor : Editor
{
private MaterialEditor m_MaterialEditor = null;

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


if (currentHDRLight == null) continue;
MaterialPropertyBlock materialBlock = new MaterialPropertyBlock();
materialBlock.SetFloat(HDShaderIDs._RequireToFlipInputTexture, hdCamera.camera.cameraType != CameraType.SceneView ? 1.0f : 0.0f);
Matrix4x4 positionMat = Matrix4x4.Translate(currentLegacyLight.transform.position);
if(currentLegacyLight.type == LightType.Point || currentLegacyLight.type == LightType.Area)

HDAdditionalReflectionData currentHDProbe = currentLegacyProbe.GetComponent<HDAdditionalReflectionData>();
MaterialPropertyBlock materialBlock = new MaterialPropertyBlock();
materialBlock.SetFloat(HDShaderIDs._RequireToFlipInputTexture, hdCamera.camera.cameraType != CameraType.SceneView ? 1.0f : 0.0f);
Mesh targetMesh = null;
if (currentHDProbe.influenceVolume.shape == InfluenceShape.Sphere)
{

2
com.unity.render-pipelines.high-definition/HDRP/Material/Fabric/FabricData.hlsl


InitBuiltinData(alpha, surfaceData.normalWS, -input.worldToTangent[2], input.positionRWS, input.texCoord1, input.texCoord2, builtinData);
// Support the emissive color and map
builtinData.emissiveColor = _EmissiveColor * lerp(float3(1.0, 1.0, 1.0), surfaceData.baseColor.rgb, _AlbedoAffectEmissive);
builtinData.emissiveColor = _EmissiveColor.rgb * lerp(float3(1.0, 1.0, 1.0), surfaceData.baseColor.rgb, _AlbedoAffectEmissive);
#ifdef _EMISSIVE_COLOR_MAP
// Generate the primart uv coordinates
float2 uvEmissive = _UVMappingMaskEmissive.x * input.texCoord0 +

正在加载...
取消
保存