|
|
|
|
|
|
#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); |
|
|
|
|
|
|
|