浏览代码

Merge pull request #1750 from Unity-Technologies/HDRP/staging

Merge Hdrp/staging
/main
GitHub 6 年前
当前提交
9ca2f35e
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 8
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl

8
com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs


mat.shader.name == "HDRenderPipeline/Decal"
)
{
// We don't handle embed material as we can't rewrite fbx files
if (Path.GetExtension(path).ToLower() == ".fbx")
{
continue;
}
// Get current version
float materialVersion = UpdateMaterial_GetVersion(path, mat);

[MenuItem("Edit/Render Pipeline/Upgrade all Materials to newer version", priority = CoreUtils.editMenuPriority3)]
static public void UpdateMaterialToNewerVersion()
{
// TODO: We need to handle material that are embed inside scene!
// TODO: We need to handle material that are embed inside scene! + How to handle embed material in fbx?
// Add here all the material upgrade functions
// Note: This is a slow path as we go through all files for each script + update the version number after each script execution,

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


DBufferType0 MERGE_NAME(NAME, 0) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 0), unCoord2); \
DBufferType1 MERGE_NAME(NAME, 1) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 1), unCoord2); \
DBufferType2 MERGE_NAME(NAME, 2) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 2), unCoord2); \
DBufferType3 MERGE_NAME(NAME, 3) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 3), unCoord2).xy;
DBufferType3 MERGE_NAME(NAME, 3) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 3), unCoord2).xy; // Caution: We do .xy to match #define DBufferType3 float2 and avoid a shader warning
#define ENCODE_INTO_DBUFFER(DECAL_SURFACE_DATA, NAME) EncodeIntoDBuffer(DECAL_SURFACE_DATA, MERGE_NAME(NAME,0), MERGE_NAME(NAME,1), MERGE_NAME(NAME,2), MERGE_NAME(NAME,3))
#define DECODE_FROM_DBUFFER(NAME, DECAL_SURFACE_DATA) DecodeFromDBuffer(MERGE_NAME(NAME,0), MERGE_NAME(NAME,1), MERGE_NAME(NAME,2), MERGE_NAME(NAME,3), DECAL_SURFACE_DATA)

正在加载...
取消
保存