浏览代码

Remove subsurface related properties.

/main
Yao Xiaoling 7 年前
当前提交
5836d560
共有 3 个文件被更改,包括 1 次插入42 次删除
  1. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/LayeredLit/TerrainLitUI.cs
  2. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/TerrainLit.shader
  3. 28
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/TerrainLitData.hlsl

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/LayeredLit/TerrainLitUI.cs


CoreUtils.SetKeyword(material, "_HEIGHTMAP" + i, material.GetTexture(kHeightMap + i));
CoreUtils.SetKeyword(material, "_SUBSURFACE_MASK_MAP" + i, material.GetTexture(kSubsurfaceMaskMap + i));
CoreUtils.SetKeyword(material, "_THICKNESSMAP" + i, material.GetTexture(kThicknessMap + i));
}

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/TerrainLit.shader


_DiffusionProfile2("Diffusion Profile2", Int) = 0
_DiffusionProfile3("Diffusion Profile3", Int) = 0
_SubsurfaceMask0("Subsurface Mask0", Range(0.0, 1.0)) = 1.0
_SubsurfaceMask1("Subsurface Mask1", Range(0.0, 1.0)) = 1.0
_SubsurfaceMask2("Subsurface Mask2", Range(0.0, 1.0)) = 1.0
_SubsurfaceMask3("Subsurface Mask3", Range(0.0, 1.0)) = 1.0
_SubsurfaceMaskMap0("Subsurface Mask Map0", 2D) = "white" {}
_SubsurfaceMaskMap1("Subsurface Mask Map1", 2D) = "white" {}
_SubsurfaceMaskMap2("Subsurface Mask Map2", 2D) = "white" {}
_SubsurfaceMaskMap3("Subsurface Mask Map3", 2D) = "white" {}
_Thickness0("Thickness", Range(0.0, 1.0)) = 1.0
_Thickness1("Thickness", Range(0.0, 1.0)) = 1.0
_Thickness2("Thickness", Range(0.0, 1.0)) = 1.0

#pragma shader_feature _HEIGHTMAP1
#pragma shader_feature _HEIGHTMAP2
#pragma shader_feature _HEIGHTMAP3
#pragma shader_feature _SUBSURFACE_MASK_MAP0
#pragma shader_feature _SUBSURFACE_MASK_MAP1
#pragma shader_feature _SUBSURFACE_MASK_MAP2
#pragma shader_feature _SUBSURFACE_MASK_MAP3
#pragma shader_feature _THICKNESSMAP0
#pragma shader_feature _THICKNESSMAP1
#pragma shader_feature _THICKNESSMAP2

28
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/TerrainLitData.hlsl


#define SAMPLER_HEIGHTMAP_IDX sampler_HeightMap3
#endif
#if defined(_SUBSURFACE_MASK_MAP0)
#define SAMPLER_SUBSURFACE_MASK_MAP_IDX sampler_SubsurfaceMaskMap0
#elif defined(_SUBSURFACE_MASK_MAP1)
#define SAMPLER_SUBSURFACE_MASK_MAP_IDX sampler_SubsurfaceMaskMap1
#elif defined(_SUBSURFACE_MASK_MAP2)
#define SAMPLER_SUBSURFACE_MASK_MAP_IDX sampler_SubsurfaceMaskMap2
#elif defined(_SUBSURFACE_MASK_MAP3)
#define SAMPLER_SUBSURFACE_MASK_MAP_IDX sampler_SubsurfaceMaskMap3
#endif
#if defined(_THICKNESSMAP0)
#define SAMPLER_THICKNESSMAP_IDX sampler_ThicknessMap0
#elif defined(_THICKNESSMAP1)

#endif
#ifdef _NORMALMAP_TANGENT_SPACE0
#define _NORMALMAP_TANGENT_SPACE_IDX
#endif
#ifdef _SUBSURFACE_MASK_MAP0
#define _SUBSURFACE_MASK_MAP_IDX
#endif
#ifdef _THICKNESSMAP0
#define _THICKNESSMAP_IDX

#undef ADD_IDX
#undef _NORMALMAP_IDX
#undef _NORMALMAP_TANGENT_SPACE_IDX
#undef _SUBSURFACE_MASK_MAP_IDX
#undef _THICKNESSMAP_IDX
#undef _MASKMAP_IDX
#undef _BENTNORMALMAP_IDX

#endif
#ifdef _NORMALMAP_TANGENT_SPACE1
#define _NORMALMAP_TANGENT_SPACE_IDX
#endif
#ifdef _SUBSURFACE_MASK_MAP1
#define _SUBSURFACE_MASK_MAP_IDX
#endif
#ifdef _THICKNESSMAP1
#define _THICKNESSMAP_IDX

#undef ADD_IDX
#undef _NORMALMAP_IDX
#undef _NORMALMAP_TANGENT_SPACE_IDX
#undef _SUBSURFACE_MASK_MAP_IDX
#undef _THICKNESSMAP_IDX
#undef _MASKMAP_IDX
#undef _BENTNORMALMAP_IDX

#ifdef _NORMALMAP_TANGENT_SPACE2
#define _NORMALMAP_TANGENT_SPACE_IDX
#endif
#ifdef _SUBSURFACE_MASK_MAP2
#define _SUBSURFACE_MASK_MAP_IDX
#endif
#ifdef _THICKNESSMAP2
#define _THICKNESSMAP_IDX
#endif

#undef ADD_IDX
#undef _NORMALMAP_IDX
#undef _NORMALMAP_TANGENT_SPACE_IDX
#undef _SUBSURFACE_MASK_MAP_IDX
#undef _THICKNESSMAP_IDX
#undef _MASKMAP_IDX
#undef _BENTNORMALMAP_IDX

#ifdef _NORMALMAP_TANGENT_SPACE3
#define _NORMALMAP_TANGENT_SPACE_IDX
#endif
#ifdef _SUBSURFACE_MASK_MAP3
#define _SUBSURFACE_MASK_MAP_IDX
#endif
#ifdef _THICKNESSMAP3
#define _THICKNESSMAP_IDX
#endif

#undef ADD_IDX
#undef _NORMALMAP_IDX
#undef _NORMALMAP_TANGENT_SPACE_IDX
#undef _SUBSURFACE_MASK_MAP_IDX
#undef _THICKNESSMAP_IDX
#undef _MASKMAP_IDX
#undef _BENTNORMALMAP_IDX

surfaceData.ambientOcclusion = SURFACEDATA_BLEND_SCALAR(surfaceData, ambientOcclusion, weights);
surfaceData.metallic = SURFACEDATA_BLEND_SCALAR(surfaceData, metallic, weights);
surfaceData.tangentWS = normalize(input.worldToTangent[0].xyz); // The tangent is not normalize in worldToTangent for mikkt. Tag: SURFACE_GRADIENT
surfaceData.subsurfaceMask = SURFACEDATA_BLEND_SCALAR(surfaceData, subsurfaceMask, weights);
surfaceData.subsurfaceMask = 0;
surfaceData.thickness = SURFACEDATA_BLEND_SCALAR(surfaceData, thickness, weights);
surfaceData.diffusionProfile = SURFACEDATA_BLEND_DIFFUSION_PROFILE(surfaceData, diffusionProfile, weights);

正在加载...
取消
保存