init commit
This commit is contained in:
8
Assets/Plugins/Terrain To Mesh.meta
Normal file
8
Assets/Plugins/Terrain To Mesh.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93929f726ec4b488a9070c8496338d4a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Plugins/Terrain To Mesh/Editor.meta
Normal file
8
Assets/Plugins/Terrain To Mesh/Editor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 734b6cb8c870141af88230df4da0f554
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd1f58e77560bd14483ed32444ed4145
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Plugins/Terrain To Mesh/Scripts.meta
Normal file
8
Assets/Plugins/Terrain To Mesh/Scripts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2c72cd8e4ecc4eb887481150a44d6b5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 459b4a6900a65d846b2cca6dc357533a
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Plugins/Terrain To Mesh/Shaders.meta
Normal file
8
Assets/Plugins/Terrain To Mesh/Shaders.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33629c8d9fe1748ca88f650e3ec73d2e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Plugins/Terrain To Mesh/Shaders/Splatmap.meta
Normal file
8
Assets/Plugins/Terrain To Mesh/Shaders/Splatmap.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 904536510c61b4c159ffa9927d81a361
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
109
Assets/Plugins/Terrain To Mesh/Shaders/Splatmap/Splatmap.cginc
Normal file
109
Assets/Plugins/Terrain To Mesh/Shaders/Splatmap/Splatmap.cginc
Normal file
@@ -0,0 +1,109 @@
|
||||
#ifndef VACUUM_SHADERS_T2M_DEFERRED_CGINC
|
||||
#define VACUUM_SHADERS_T2M_DEFERRED_CGINC
|
||||
|
||||
|
||||
#define TERRAIN_TO_MESH_RP_UNIVERSAL
|
||||
|
||||
#if (SHADERPASS == SHADERPASS_DEPTHONLY) || (SHADERPASS == SHADERPASS_DEPTHNORMALS) || (SHADERPASS == SHADERPASS_SHADOWCASTER)
|
||||
#if defined(TERRAIN_TO_MESH_NEED_NORMAL)
|
||||
#undef TERRAIN_TO_MESH_NEED_NORMAL
|
||||
#endif
|
||||
|
||||
#if defined(TERRAIN_TO_MESH_NEED_METALLIC_SMOOTHNESS_OCCLUSION)
|
||||
#undef TERRAIN_TO_MESH_NEED_METALLIC_SMOOTHNESS_OCCLUSION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "../cginc/Core.cginc"
|
||||
|
||||
|
||||
#if defined(TERRAIN_TO_MESH_FALLBACK)
|
||||
TEXTURE2D(_BaseMap); SAMPLER(sampler_BaseMap);
|
||||
TEXTURE2D(_BumpMap);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//Curved World//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void SHG_TerrainToMeshCurvedWorld_float(float3 inVertex, float3 inNormal, float4 inTangent, out float3 outVertex, out float3 outNormal)
|
||||
{
|
||||
float4 vertex = float4(inVertex, 1);
|
||||
float3 normal = inNormal;
|
||||
float4 tangent = inTangent;
|
||||
|
||||
//Curved World
|
||||
#if defined(CURVEDWORLD_IS_INSTALLED) && !defined(CURVEDWORLD_DISABLED_ON)
|
||||
#ifdef CURVEDWORLD_NORMAL_TRANSFORMATION_ON
|
||||
CURVEDWORLD_TRANSFORM_VERTEX_AND_NORMAL(vertex, normal, tangent)
|
||||
#else
|
||||
CURVEDWORLD_TRANSFORM_VERTEX(vertex)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
outVertex = vertex.xyz;
|
||||
outNormal = normal.xyz;
|
||||
}
|
||||
|
||||
void SHG_TerrainToMeshCurvedWorld_half(float3 inVertex, float3 inNormal, float4 inTangent, out float3 outVertex, out float3 outNormal)
|
||||
{
|
||||
SHG_TerrainToMeshCurvedWorld_float(inVertex, inNormal, inTangent, outVertex, outNormal);
|
||||
}
|
||||
|
||||
|
||||
//Holes//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void SHG_TerrainToMeshCalculateClipValue_float(float4 uv, out float clipValue)
|
||||
{
|
||||
clipValue = TerrainToMeshCalculateClipValue(uv.xy);
|
||||
}
|
||||
|
||||
void SHG_TerrainToMeshCalculateClipValue_half(float4 uv, out float clipValue)
|
||||
{
|
||||
SHG_TerrainToMeshCalculateClipValue_float(uv, clipValue);
|
||||
}
|
||||
|
||||
|
||||
//Layers//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void SHG_TerrainToMeshCalculateLayersBlend_float(float4 uv, out float3 albedoValue, out float alphaValue, out float3 normalValue, out float metallicValue, out float smoothnessValue, out float occlusionValue)
|
||||
{
|
||||
#if defined(TERRAIN_TO_MESH_FALLBACK)
|
||||
|
||||
float4 baseColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, uv.xy);
|
||||
albedoValue = baseColor.rgb;
|
||||
alphaValue = baseColor.a;
|
||||
|
||||
//Unpack normal
|
||||
float4 bumpMap = SAMPLE_TEXTURE2D(_BumpMap, sampler_BaseMap, uv.xy);
|
||||
normalValue.rgb = UnpackNormal(bumpMap);
|
||||
|
||||
//
|
||||
metallicValue = 0;
|
||||
smoothnessValue = 0;
|
||||
occlusionValue = 1;
|
||||
|
||||
|
||||
//Commented for Unity 2021.3 (URP)
|
||||
//#elif defined(SHADERPASS_SHADOWCASTER) || defined(SHADERPASS_DEPTHONLY)
|
||||
|
||||
// albedoValue = 0;
|
||||
// alphaValue = 1;
|
||||
// normalValue = float3(0, 0, 1);
|
||||
// metallicValue = 0;
|
||||
// smoothnessValue = 0;
|
||||
// occlusionValue = 0;
|
||||
|
||||
#else
|
||||
|
||||
TerrainToMeshCalculateLayersBlend(uv.xy, albedoValue, alphaValue, normalValue, metallicValue, smoothnessValue, occlusionValue);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void SHG_TerrainToMeshCalculateLayersBlend_half(float4 uv, inout float3 albedoValue, inout float alphaValue, inout float3 normalValue, inout float metallicValue, inout float smoothnessValue, out float occlusionValue)
|
||||
{
|
||||
SHG_TerrainToMeshCalculateLayersBlend_float(uv, albedoValue, alphaValue, normalValue, metallicValue, smoothnessValue, occlusionValue);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d07730cc67dffd49af033f967d533a7
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
6605
Assets/Plugins/Terrain To Mesh/Shaders/Splatmap/Splatmap.shader
Normal file
6605
Assets/Plugins/Terrain To Mesh/Shaders/Splatmap/Splatmap.shader
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e96f2ed4879dc5d48b327216506f6078
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Plugins/Terrain To Mesh/Shaders/cginc.meta
Normal file
8
Assets/Plugins/Terrain To Mesh/Shaders/cginc.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a5de3e8aaff24fc98d576ecda6ce264
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
462
Assets/Plugins/Terrain To Mesh/Shaders/cginc/Core.cginc
Normal file
462
Assets/Plugins/Terrain To Mesh/Shaders/cginc/Core.cginc
Normal file
@@ -0,0 +1,462 @@
|
||||
#ifndef TERRAIN_TO_MESH_CORE_CGINC
|
||||
#define TERRAIN_TO_MESH_CORE_CGINC
|
||||
|
||||
|
||||
|
||||
#include "Variables.cginc"
|
||||
|
||||
|
||||
float4 TerrainToMeshRemap(float4 value, float4 outMin, float4 outMax)
|
||||
{
|
||||
return outMin + value * (outMax - outMin);
|
||||
}
|
||||
|
||||
//Unity_NormalStrength_float
|
||||
float3 TerrainToMeshNormalStrength(float3 In, float Strength)
|
||||
{
|
||||
return float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
||||
}
|
||||
|
||||
#if defined(_T2M_TEXTURE_SAMPLE_TYPE_ARRAY)
|
||||
|
||||
#define T2M_UNPACK_SPLATMAP(uv,index) SAMPLE_TEXTURE2D_ARRAY(_T2M_SplatMaps2DArray, sampler_T2M_SplatMaps2DArray, uv, index);
|
||||
#define T2M_UNPACK_PAINTMAP(uv,index,sum,splat) float4 paintColor##index = (_T2M_Layer_##index##_MapsUsage.x > 0.5 ? SAMPLE_TEXTURE2D_ARRAY(_T2M_DiffuseMaps2DArray, sampler_T2M_DiffuseMaps2DArray, uv * _T2M_Layer_##index##_uvScaleOffset.xy + _T2M_Layer_##index##_uvScaleOffset.zw, paintMapUsageIndex) : float4(1, 1, 1, 1)); paintMapUsageIndex += _T2M_Layer_##index##_MapsUsage.x > 0.5 ? 1 : 0; sum += paintColor##index * _T2M_Layer_##index##_ColorTint * splat;
|
||||
|
||||
#define T2M_UNPACK_NORMAL_MAP(index,uv,sum,splat) sum += TerrainToMeshNormalStrength(UnpackNormal(SAMPLE_TEXTURE2D_ARRAY(_T2M_NormalMaps2DArray, sampler_T2M_NormalMaps2DArray, uv * _T2M_Layer_##index##_uvScaleOffset.xy + _T2M_Layer_##index##_uvScaleOffset.zw, normalMapUsageIndex)), _T2M_Layer_##index##_NormalScale) * splat; normalMapUsageIndex += 1;
|
||||
#define T2M_UNPACK_MASK(index,uv,sum,splat) sum += TerrainToMeshRemap(SAMPLE_TEXTURE2D_ARRAY(_T2M_MaskMaps2DArray, sampler_T2M_MaskMaps2DArray, uv * _T2M_Layer_##index##_uvScaleOffset.xy + _T2M_Layer_##index##_uvScaleOffset.zw, maskMapUsageIndex), _T2M_Layer_##index##_MaskMapRemapMin, _T2M_Layer_##index##_MaskMapRemapMax) * splat; maskMapUsageIndex += 1;
|
||||
#else
|
||||
|
||||
#define T2M_UNPACK_SPLATMAP(uv,index) SAMPLE_TEXTURE2D(_T2M_SplatMap_##index, sampler_T2M_SplatMap_0, uv);
|
||||
#define T2M_UNPACK_PAINTMAP(uv,index,sum,splat) float4 paintColor##index = SAMPLE_TEXTURE2D(_T2M_Layer_##index##_Diffuse, sampler_T2M_Layer_0_Diffuse, uv * _T2M_Layer_##index##_uvScaleOffset.xy + _T2M_Layer_##index##_uvScaleOffset.zw); sum += paintColor##index * _T2M_Layer_##index##_ColorTint * splat;
|
||||
|
||||
#define T2M_UNPACK_NORMAL_MAP(index,uv,sum,splat) sum += TerrainToMeshNormalStrength(UnpackNormal(SAMPLE_TEXTURE2D(_T2M_Layer_##index##_NormalMap, sampler_T2M_Layer_0_Diffuse, uv * _T2M_Layer_##index##_uvScaleOffset.xy + _T2M_Layer_##index##_uvScaleOffset.zw)), _T2M_Layer_##index##_NormalScale) * splat;
|
||||
#define T2M_UNPACK_MASK(index,uv,sum,splat) sum += TerrainToMeshRemap(SAMPLE_TEXTURE2D(_T2M_Layer_##index##_Mask, sampler_T2M_Layer_0_Diffuse, uv * _T2M_Layer_##index##_uvScaleOffset.xy + _T2M_Layer_##index##_uvScaleOffset.zw), _T2M_Layer_##index##_MaskMapRemapMin, _T2M_Layer_##index##_MaskMapRemapMax) * splat;
|
||||
#endif
|
||||
|
||||
#define T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(index,sum,splat) sum += float4(_T2M_Layer_##index##_MetallicOcclusionSmoothness.rgb, lerp(_T2M_Layer_##index##_MetallicOcclusionSmoothness.a, paintColor##index.a, _T2M_Layer_##index##_SmoothnessFromDiffuseAlpha)) * splat;
|
||||
|
||||
|
||||
|
||||
|
||||
float TerrainToMeshCalculateClipValue(float2 uv)
|
||||
{
|
||||
#if defined(_ALPHATEST_ON)
|
||||
|
||||
float4 holesmap = SAMPLE_TEXTURE2D(_T2M_HolesMap, sampler_T2M_HolesMap, uv);
|
||||
return holesmap.r;
|
||||
|
||||
#else
|
||||
|
||||
return 1;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TerrainToMeshCalculateLayersBlend(float2 uv, out float3 albedoValue, out float alphaValue, out float3 normalValue, out float metallicValue, out float smoothnessValue, out float occlusionValue)
|
||||
{
|
||||
//Splatmaps//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
float4 splatmap0 = T2M_UNPACK_SPLATMAP(uv, 0);
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_1)
|
||||
float4 splatmap1 = T2M_UNPACK_SPLATMAP(uv, 1);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_2)
|
||||
float4 splatmap2 = T2M_UNPACK_SPLATMAP(uv, 2);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_3)
|
||||
float4 splatmap3 = T2M_UNPACK_SPLATMAP(uv, 3);
|
||||
#endif
|
||||
|
||||
|
||||
//Paint Textures////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
float4 paintColorSum = 0;
|
||||
|
||||
|
||||
#if defined(_T2M_TEXTURE_SAMPLE_TYPE_ARRAY)
|
||||
int paintMapUsageIndex = 0;
|
||||
#endif
|
||||
|
||||
|
||||
T2M_UNPACK_PAINTMAP(uv, 0, paintColorSum, splatmap0.r);
|
||||
T2M_UNPACK_PAINTMAP(uv, 1, paintColorSum, splatmap0.g);
|
||||
|
||||
#if defined(NEED_PAINT_MAP_2)
|
||||
T2M_UNPACK_PAINTMAP(uv, 2, paintColorSum, splatmap0.b);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_3)
|
||||
T2M_UNPACK_PAINTMAP(uv, 3, paintColorSum, splatmap0.a);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_1)
|
||||
#if defined(NEED_PAINT_MAP_4)
|
||||
T2M_UNPACK_PAINTMAP(uv, 4, paintColorSum, splatmap1.r);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_5)
|
||||
T2M_UNPACK_PAINTMAP(uv, 5, paintColorSum, splatmap1.g);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_6)
|
||||
T2M_UNPACK_PAINTMAP(uv, 6, paintColorSum, splatmap1.b);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_7)
|
||||
T2M_UNPACK_PAINTMAP(uv, 7, paintColorSum, splatmap1.a);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_2)
|
||||
#if defined(NEED_PAINT_MAP_8)
|
||||
T2M_UNPACK_PAINTMAP(uv, 8, paintColorSum, splatmap2.r);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_9)
|
||||
T2M_UNPACK_PAINTMAP(uv, 9, paintColorSum, splatmap2.g);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_10)
|
||||
T2M_UNPACK_PAINTMAP(uv, 10, paintColorSum, splatmap2.b);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_11)
|
||||
T2M_UNPACK_PAINTMAP(uv, 11, paintColorSum, splatmap2.a);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_3)
|
||||
#if defined(NEED_PAINT_MAP_12)
|
||||
T2M_UNPACK_PAINTMAP(uv, 12, paintColorSum, splatmap3.r);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_13)
|
||||
T2M_UNPACK_PAINTMAP(uv, 13, paintColorSum, splatmap3.g);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_14)
|
||||
T2M_UNPACK_PAINTMAP(uv, 14, paintColorSum, splatmap3.b);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_15)
|
||||
T2M_UNPACK_PAINTMAP(uv, 15, paintColorSum, splatmap3.a);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
albedoValue = paintColorSum.rgb;
|
||||
alphaValue = paintColorSum.a;
|
||||
|
||||
|
||||
|
||||
//Normal//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef TERRAIN_TO_MESH_NEED_NORMAL
|
||||
|
||||
float3 emptyNormal = float3(0, 0, 1);
|
||||
normalValue = 0;
|
||||
|
||||
#if defined(_T2M_TEXTURE_SAMPLE_TYPE_ARRAY)
|
||||
int normalMapUsageIndex = 0;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_T2M_LAYER_0_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(0, uv, normalValue, splatmap0.r);
|
||||
#else
|
||||
normalValue += splatmap0.r * emptyNormal;
|
||||
#endif
|
||||
|
||||
#if defined(_T2M_LAYER_1_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(1, uv, normalValue, splatmap0.g);
|
||||
#else
|
||||
normalValue += splatmap0.g * emptyNormal;
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_2
|
||||
#if defined(_T2M_LAYER_2_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(2, uv, normalValue, splatmap0.b);
|
||||
#else
|
||||
normalValue += splatmap0.b * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_3
|
||||
#if defined(_T2M_LAYER_3_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(3, uv, normalValue, splatmap0.a);
|
||||
#else
|
||||
normalValue += splatmap0.a * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_1)
|
||||
#ifdef NEED_PAINT_MAP_4
|
||||
#if defined(_T2M_LAYER_4_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(4, uv, normalValue, splatmap1.r);
|
||||
#else
|
||||
normalValue += splatmap1.r * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_5
|
||||
#if defined(_T2M_LAYER_5_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(5, uv, normalValue, splatmap1.g);
|
||||
#else
|
||||
normalValue += splatmap1.g * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_6
|
||||
#if defined(_T2M_LAYER_6_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(6, uv, normalValue, splatmap1.b);
|
||||
#else
|
||||
normalValue += splatmap1.b * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_7
|
||||
#if defined(_T2M_LAYER_7_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(7, uv, normalValue, splatmap1.a);
|
||||
#else
|
||||
normalValue += splatmap1.a * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_2)
|
||||
#ifdef NEED_PAINT_MAP_8
|
||||
#if defined(_T2M_LAYER_8_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(8, uv, normalValue, splatmap2.r);
|
||||
#else
|
||||
normalValue += splatmap2.r * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_9
|
||||
#if defined(_T2M_LAYER_9_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(9, uv, normalValue, splatmap2.g);
|
||||
#else
|
||||
normalValue += splatmap2.g * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_10
|
||||
#if defined(_T2M_LAYER_10_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(10, uv, normalValue, splatmap2.b);
|
||||
#else
|
||||
normalValue += splatmap2.b * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_11
|
||||
#if defined(_T2M_LAYER_11_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(11, uv, normalValue, splatmap2.a);
|
||||
#else
|
||||
normalValue += splatmap2.a * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_3)
|
||||
#ifdef NEED_PAINT_MAP_12
|
||||
#if defined(_T2M_LAYER_12_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(12, uv, normalValue, splatmap3.r);
|
||||
#else
|
||||
normalValue += splatmap3.r * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_13
|
||||
#if defined(_T2M_LAYER_13_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(13, uv, normalValue, splatmap3.g);
|
||||
#else
|
||||
normalValue += splatmap3.g * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_14
|
||||
#if defined(_T2M_LAYER_14_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(14, uv, normalValue, splatmap3.b);
|
||||
#else
|
||||
normalValue += splatmap3.b * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_15
|
||||
#if defined(_T2M_LAYER_15_NORMAL)
|
||||
T2M_UNPACK_NORMAL_MAP(15, uv, normalValue, splatmap3.a);
|
||||
#else
|
||||
normalValue += splatmap3.a * emptyNormal;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
normalValue = float3(0, 0, 1);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//Metallic, Occlusion, Smoothness////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef TERRAIN_TO_MESH_NEED_METALLIC_SMOOTHNESS_OCCLUSION
|
||||
|
||||
float4 metallicSmoothnessOcclusion = 0;
|
||||
|
||||
#if defined(_T2M_TEXTURE_SAMPLE_TYPE_ARRAY)
|
||||
int maskMapUsageIndex = 0;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_T2M_LAYER_0_MASK)
|
||||
T2M_UNPACK_MASK(0, uv, metallicSmoothnessOcclusion, splatmap0.r);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(0, metallicSmoothnessOcclusion, splatmap0.r);
|
||||
#endif
|
||||
|
||||
#if defined(_T2M_LAYER_1_MASK)
|
||||
T2M_UNPACK_MASK(1, uv, metallicSmoothnessOcclusion, splatmap0.g);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(1, metallicSmoothnessOcclusion, splatmap0.g);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_2)
|
||||
#if defined(_T2M_LAYER_2_MASK)
|
||||
T2M_UNPACK_MASK(2, uv, metallicSmoothnessOcclusion, splatmap0.b);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(2, metallicSmoothnessOcclusion, splatmap0.b);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_3)
|
||||
#if defined(_T2M_LAYER_3_MASK)
|
||||
T2M_UNPACK_MASK(3, uv, metallicSmoothnessOcclusion, splatmap0.a);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(3, metallicSmoothnessOcclusion, splatmap0.a);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_1)
|
||||
#if defined(NEED_PAINT_MAP_4)
|
||||
#if defined(_T2M_LAYER_4_MASK)
|
||||
T2M_UNPACK_MASK(4, uv, metallicSmoothnessOcclusion, splatmap1.r);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(4, metallicSmoothnessOcclusion, splatmap1.r);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_5)
|
||||
#if defined(_T2M_LAYER_5_MASK)
|
||||
T2M_UNPACK_MASK(5, uv, metallicSmoothnessOcclusion, splatmap1.g);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(5, metallicSmoothnessOcclusion, splatmap1.g);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_6)
|
||||
#if defined(_T2M_LAYER_6_MASK)
|
||||
T2M_UNPACK_MASK(6, uv, metallicSmoothnessOcclusion, splatmap1.b);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(6, metallicSmoothnessOcclusion, splatmap1.b);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_7)
|
||||
#if defined(_T2M_LAYER_7_MASK)
|
||||
T2M_UNPACK_MASK(7, uv, metallicSmoothnessOcclusion, splatmap1.a);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(7, metallicSmoothnessOcclusion, splatmap1.a);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_2)
|
||||
#if defined(NEED_PAINT_MAP_8)
|
||||
#if defined(_T2M_LAYER_8_MASK)
|
||||
T2M_UNPACK_MASK(8, uv, metallicSmoothnessOcclusion, splatmap2.r);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(8, metallicSmoothnessOcclusion, splatmap2.r);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_9)
|
||||
#if defined(_T2M_LAYER_9_MASK)
|
||||
T2M_UNPACK_MASK(9, uv, metallicSmoothnessOcclusion, splatmap2.g);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(9, metallicSmoothnessOcclusion, splatmap2.g);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_10)
|
||||
#if defined(_T2M_LAYER_10_MASK)
|
||||
T2M_UNPACK_MASK(10, uv, metallicSmoothnessOcclusion, splatmap2.b);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(10, metallicSmoothnessOcclusion, splatmap2.b);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_11)
|
||||
#if defined(_T2M_LAYER_11_MASK)
|
||||
T2M_UNPACK_MASK(11, uv, metallicSmoothnessOcclusion, splatmap2.a);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(11, metallicSmoothnessOcclusion, splatmap2.a);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_3)
|
||||
#if defined(NEED_PAINT_MAP_12)
|
||||
#if defined(_T2M_LAYER_12_MASK)
|
||||
T2M_UNPACK_MASK(12, uv, metallicSmoothnessOcclusion, splatmap3.r);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(12, metallicSmoothnessOcclusion, splatmap3.r);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_13)
|
||||
#if defined(_T2M_LAYER_13_MASK)
|
||||
T2M_UNPACK_MASK(13, uv, metallicSmoothnessOcclusion, splatmap3.g);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(13, metallicSmoothnessOcclusion, splatmap3.g);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_14)
|
||||
#if defined(_T2M_LAYER_14_MASK)
|
||||
T2M_UNPACK_MASK(14, uv, metallicSmoothnessOcclusion, splatmap3.b);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(14, metallicSmoothnessOcclusion, splatmap3.b);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_PAINT_MAP_15)
|
||||
#if defined(_T2M_LAYER_15_MASK)
|
||||
T2M_UNPACK_MASK(15, uv, metallicSmoothnessOcclusion, splatmap3.a);
|
||||
#else
|
||||
T2M_UNPACK_METALLIC_OCCLUSION_SMOOTHNESS(15, metallicSmoothnessOcclusion, splatmap3.a);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
metallicSmoothnessOcclusion = saturate(metallicSmoothnessOcclusion);
|
||||
|
||||
metallicValue = metallicSmoothnessOcclusion.r;
|
||||
smoothnessValue = metallicSmoothnessOcclusion.a;
|
||||
occlusionValue = metallicSmoothnessOcclusion.g;
|
||||
|
||||
#else
|
||||
|
||||
metallicValue = 0;
|
||||
smoothnessValue = 0;
|
||||
occlusionValue = 1;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9f4fea2e37009b46a947588e42010de
|
||||
timeCreated: 1446882387
|
||||
licenseType: Free
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
416
Assets/Plugins/Terrain To Mesh/Shaders/cginc/Variables.cginc
Normal file
416
Assets/Plugins/Terrain To Mesh/Shaders/cginc/Variables.cginc
Normal file
@@ -0,0 +1,416 @@
|
||||
#ifndef TERRAIN_TO_MESH_VARIABLES_CGINC
|
||||
#define TERRAIN_TO_MESH_VARIABLES_CGINC
|
||||
|
||||
|
||||
|
||||
#if defined(_T2M_LAYER_COUNT_3)
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_4)
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_5)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_6)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_7)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_8)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_9)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_10)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_11)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
#define NEED_PAINT_MAP_10
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_12)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
#define NEED_PAINT_MAP_10
|
||||
#define NEED_PAINT_MAP_11
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_13)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
#define NEED_SPLAT_MAP_3
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
#define NEED_PAINT_MAP_10
|
||||
#define NEED_PAINT_MAP_11
|
||||
#define NEED_PAINT_MAP_12
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_14)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
#define NEED_SPLAT_MAP_3
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
#define NEED_PAINT_MAP_10
|
||||
#define NEED_PAINT_MAP_11
|
||||
#define NEED_PAINT_MAP_12
|
||||
#define NEED_PAINT_MAP_13
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_15)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
#define NEED_SPLAT_MAP_3
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
#define NEED_PAINT_MAP_10
|
||||
#define NEED_PAINT_MAP_11
|
||||
#define NEED_PAINT_MAP_12
|
||||
#define NEED_PAINT_MAP_13
|
||||
#define NEED_PAINT_MAP_14
|
||||
|
||||
#elif defined(_T2M_LAYER_COUNT_16)
|
||||
|
||||
#define NEED_SPLAT_MAP_1
|
||||
#define NEED_SPLAT_MAP_2
|
||||
#define NEED_SPLAT_MAP_3
|
||||
|
||||
#define NEED_PAINT_MAP_2
|
||||
#define NEED_PAINT_MAP_3
|
||||
#define NEED_PAINT_MAP_4
|
||||
#define NEED_PAINT_MAP_5
|
||||
#define NEED_PAINT_MAP_6
|
||||
#define NEED_PAINT_MAP_7
|
||||
#define NEED_PAINT_MAP_8
|
||||
#define NEED_PAINT_MAP_9
|
||||
#define NEED_PAINT_MAP_10
|
||||
#define NEED_PAINT_MAP_11
|
||||
#define NEED_PAINT_MAP_12
|
||||
#define NEED_PAINT_MAP_13
|
||||
#define NEED_PAINT_MAP_14
|
||||
#define NEED_PAINT_MAP_15
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_T2M_TEXTURE_SAMPLE_TYPE_ARRAY)
|
||||
|
||||
#define T2M_DECLARE_LAYER(l) float4 _T2M_Layer_##l##_MapsUsage; float4 _T2M_Layer_##l##_uvScaleOffset; float4 _T2M_Layer_##l##_ColorTint; float4 _T2M_Layer_##l##_MetallicOcclusionSmoothness; int _T2M_Layer_##l##_SmoothnessFromDiffuseAlpha;
|
||||
#define T2M_DECALRE_NORMAL(l) float _T2M_Layer_##l##_NormalScale;
|
||||
#define T2M_DECALRE_MASK(l) float4 _T2M_Layer_##l##_MaskMapRemapMin; float4 _T2M_Layer_##l##_MaskMapRemapMax;
|
||||
|
||||
#else
|
||||
|
||||
#define T2M_DECLARE_LAYER(l) TEXTURE2D(_T2M_Layer_##l##_Diffuse); float4 _T2M_Layer_##l##_uvScaleOffset; float4 _T2M_Layer_##l##_ColorTint; float4 _T2M_Layer_##l##_MetallicOcclusionSmoothness; int _T2M_Layer_##l##_SmoothnessFromDiffuseAlpha;
|
||||
#define T2M_DECALRE_NORMAL(l) TEXTURE2D(_T2M_Layer_##l##_NormalMap); float _T2M_Layer_##l##_NormalScale;
|
||||
#define T2M_DECALRE_MASK(l) TEXTURE2D(_T2M_Layer_##l##_Mask); float4 _T2M_Layer_##l##_MaskMapRemapMin; float4 _T2M_Layer_##l##_MaskMapRemapMax;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//Layer Count/////////////////////////////////////////////////////////////////////////////
|
||||
int _T2M_Layer_Count;
|
||||
|
||||
//Holes///////////////////////////////////////////////////////////////////////////////////
|
||||
#if defined(_ALPHATEST_ON)
|
||||
TEXTURE2D(_T2M_HolesMap); SAMPLER(sampler_T2M_HolesMap);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_T2M_TEXTURE_SAMPLE_TYPE_ARRAY)
|
||||
|
||||
TEXTURE2D_ARRAY(_T2M_SplatMaps2DArray); SAMPLER(sampler_T2M_SplatMaps2DArray);
|
||||
TEXTURE2D_ARRAY(_T2M_DiffuseMaps2DArray); SAMPLER(sampler_T2M_DiffuseMaps2DArray);
|
||||
TEXTURE2D_ARRAY(_T2M_NormalMaps2DArray); SAMPLER(sampler_T2M_NormalMaps2DArray);
|
||||
TEXTURE2D_ARRAY(_T2M_MaskMaps2DArray); SAMPLER(sampler_T2M_MaskMaps2DArray);
|
||||
|
||||
float4 _T2M_Layer_0_MapsUsage;
|
||||
|
||||
#else
|
||||
|
||||
//Splatmaps///////////////////////////////////////////////////////////////////////////////
|
||||
TEXTURE2D(_T2M_SplatMap_0); SAMPLER(sampler_T2M_SplatMap_0);
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_1)
|
||||
TEXTURE2D(_T2M_SplatMap_1);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_2)
|
||||
TEXTURE2D(_T2M_SplatMap_2);
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_3)
|
||||
TEXTURE2D(_T2M_SplatMap_3);
|
||||
#endif
|
||||
|
||||
|
||||
//Layers//////////////////////////////////////////////////////////////////////////////////
|
||||
TEXTURE2D(_T2M_Layer_0_Diffuse); SAMPLER(sampler_T2M_Layer_0_Diffuse);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
float4 _T2M_Layer_0_uvScaleOffset;
|
||||
float4 _T2M_Layer_0_ColorTint;
|
||||
float4 _T2M_Layer_0_MetallicOcclusionSmoothness;
|
||||
int _T2M_Layer_0_SmoothnessFromDiffuseAlpha;
|
||||
|
||||
#if defined(_T2M_LAYER_0_NORMAL)
|
||||
T2M_DECALRE_NORMAL(0)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_0_MASK)
|
||||
T2M_DECALRE_MASK(0)
|
||||
#endif
|
||||
|
||||
T2M_DECLARE_LAYER(1)
|
||||
#if defined(_T2M_LAYER_1_NORMAL)
|
||||
T2M_DECALRE_NORMAL(1)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_1_MASK)
|
||||
T2M_DECALRE_MASK(1)
|
||||
#endif
|
||||
|
||||
T2M_DECLARE_LAYER(2)
|
||||
#if defined(_T2M_LAYER_2_NORMAL)
|
||||
T2M_DECALRE_NORMAL(2)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_2_MASK)
|
||||
T2M_DECALRE_MASK(2)
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_3
|
||||
T2M_DECLARE_LAYER(3)
|
||||
#if defined(_T2M_LAYER_3_NORMAL)
|
||||
T2M_DECALRE_NORMAL(3)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_3_MASK)
|
||||
T2M_DECALRE_MASK(3)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_1)
|
||||
#ifdef NEED_PAINT_MAP_4
|
||||
T2M_DECLARE_LAYER(4)
|
||||
#if defined(_T2M_LAYER_4_NORMAL)
|
||||
T2M_DECALRE_NORMAL(4)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_4_MASK)
|
||||
T2M_DECALRE_MASK(4)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_5
|
||||
T2M_DECLARE_LAYER(5)
|
||||
#if defined(_T2M_LAYER_5_NORMAL)
|
||||
T2M_DECALRE_NORMAL(5)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_5_MASK)
|
||||
T2M_DECALRE_MASK(5)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_6
|
||||
T2M_DECLARE_LAYER(6)
|
||||
#if defined(_T2M_LAYER_6_NORMAL)
|
||||
T2M_DECALRE_NORMAL(6)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_6_MASK)
|
||||
T2M_DECALRE_MASK(6)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_7
|
||||
T2M_DECLARE_LAYER(7)
|
||||
#if defined(_T2M_LAYER_7_NORMAL)
|
||||
T2M_DECALRE_NORMAL(7)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_7_MASK)
|
||||
T2M_DECALRE_MASK(7)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_2)
|
||||
#ifdef NEED_PAINT_MAP_8
|
||||
T2M_DECLARE_LAYER(8)
|
||||
#if defined(_T2M_LAYER_8_NORMAL)
|
||||
T2M_DECALRE_NORMAL(8)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_8_MASK)
|
||||
T2M_DECALRE_MASK(8)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_9
|
||||
T2M_DECLARE_LAYER(9)
|
||||
#if defined(_T2M_LAYER_9_NORMAL)
|
||||
T2M_DECALRE_NORMAL(9)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_9_MASK)
|
||||
T2M_DECALRE_MASK(9)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_10
|
||||
T2M_DECLARE_LAYER(10)
|
||||
#if defined(_T2M_LAYER_10_NORMAL)
|
||||
T2M_DECALRE_NORMAL(10)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_10_MASK)
|
||||
T2M_DECALRE_MASK(10)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_11
|
||||
T2M_DECLARE_LAYER(11)
|
||||
#if defined(_T2M_LAYER_11_NORMAL)
|
||||
T2M_DECALRE_NORMAL(11)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_11_MASK)
|
||||
T2M_DECALRE_MASK(11)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NEED_SPLAT_MAP_3)
|
||||
#ifdef NEED_PAINT_MAP_12
|
||||
T2M_DECLARE_LAYER(12)
|
||||
#if defined(_T2M_LAYER_12_NORMAL)
|
||||
T2M_DECALRE_NORMAL(12)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_12_MASK)
|
||||
T2M_DECALRE_MASK(12)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_13
|
||||
T2M_DECLARE_LAYER(13)
|
||||
#if defined(_T2M_LAYER_13_NORMAL)
|
||||
T2M_DECALRE_NORMAL(13)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_13_MASK)
|
||||
T2M_DECALRE_MASK(13)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_14
|
||||
T2M_DECLARE_LAYER(14)
|
||||
#if defined(_T2M_LAYER_14_NORMAL)
|
||||
T2M_DECALRE_NORMAL(14)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_14_MASK)
|
||||
T2M_DECALRE_MASK(14)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_PAINT_MAP_15
|
||||
T2M_DECLARE_LAYER(15)
|
||||
#if defined(_T2M_LAYER_15_NORMAL)
|
||||
T2M_DECALRE_NORMAL(15)
|
||||
#endif
|
||||
#if defined(_T2M_LAYER_15_MASK)
|
||||
T2M_DECALRE_MASK(15)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 780f5951c0209764187c8aa048841bae
|
||||
timeCreated: 1446882387
|
||||
licenseType: Free
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user