浏览代码

HDRenderLoop: Fix compile with Surface Gradient

- The looks seems not correct
/Branch_Batching2
Sebastien Lagarde 8 年前
当前提交
a3352be4
共有 4 个文件被更改,包括 13 次插入11 次删除
  1. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  2. 2
      Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMapping.hlsl
  3. 4
      Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMappingNormalInternal.hlsl
  4. 12
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test details.mat

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


//-------------------------------------------------------------------------------------
// Fill SurfaceData/Builtin data function
//-------------------------------------------------------------------------------------
#include "../MaterialUtilities.hlsl"
#include "../MaterialUtilities.hlsl"
void GetBuiltinData(FragInputs input, SurfaceData surfaceData, float alpha, float depthOffset, out BuiltinData builtinData)
{

// tangent basis for each UVSet - up to 4 for now
float3 vertexTangentWS0, vertexBitangentWS0;
float3 vertexTangentWS1, vertexBitangentWS1;
float3 vertexTangentWS2, vertexBitangentWS1;
float3 vertexTangentWS3, vertexBitangentWS2;
float3 vertexTangentWS2, vertexBitangentWS2;
float3 vertexTangentWS3, vertexBitangentWS3;
#endif
};

2
Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMapping.hlsl


// This structure abstract uv mapping inside one struct.
// It represent a mapping of any uv (with its associated tangent space for derivative if SurfaceGradient mode) - UVSet0 to 4, planar, triplanar
#include "ShaderLibrary/NormalSurfaceGradient.hlsl"
#define UV_MAPPING_UVSET 0
#define UV_MAPPING_PLANAR 1
#define UV_MAPPING_TRIPLANAR 2

4
Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMappingNormalInternal.hlsl


// Assume derivXplane, derivYPlane and derivZPlane sampled using (z,y), (z,x) and (x,y) respectively.
// TODO: Check with morten convention! Do it follow ours ?
float3 volumeGrad = float3(derivZPlane.x + derivYPlane.y, derivZPlane.y + derivXplane.y, derivXplane.x + derivYPlane.x);
return surfgradFromVolumeGradient(uvMapping.normalWS, volumeGrad);
return SurfaceGradientFromVolumeGradient(uvMapping.normalWS, volumeGrad);
#else
float3 val = float3(0.0, 0.0, 0.0);

float2 derivYPlane = UNPACK_DERIVATIVE_FUNC(SAMPLE_TEXTURE_FUNC(textureName, samplerName, uvMapping.uvXZ, param), scale);
// See comment above
float3 volumeGrad = float3(derivYPlane.y, 0.0, derivYPlane.x);
return surfgradFromVolumeGradient(uvMapping.normalWS, volumeGrad);
return SurfaceGradientFromVolumeGradient(uvMapping.normalWS, volumeGrad);
}
#endif
else

12
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test details.mat


m_PrefabInternal: {fileID: 0}
m_Name: test details
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _DETAIL_MAP _NORMALMAP _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: d734753529ca78148a43944515a64bc5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: d896c388b98bb614ebe6bb48e0f56dcf, type: 3}
m_Scale: {x: 0.99, y: 1}
m_Offset: {x: 1.52, y: 1}
m_Texture: {fileID: 2800000, guid: 75bfcd5e2d2d5954ca601a85db5d1a73, type: 3}
m_Scale: {x: 0.83, y: 1}
m_Offset: {x: 0.96, y: 1}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 11f99173903c31f49b05339fc71c7919, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

正在加载...
取消
保存