diff --git a/Sample.meta b/Sample.meta new file mode 100644 index 0000000..4bed4f0 --- /dev/null +++ b/Sample.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ec2c964394bc74841b877ca519a5c07e +folderAsset: yes +timeCreated: 1445725067 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials.meta b/Sample/Materials.meta new file mode 100644 index 0000000..91fb241 --- /dev/null +++ b/Sample/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: af73e33fee6334669b25a43ad156998a +folderAsset: yes +timeCreated: 1428459734 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials.meta b/Sample/Materials/Mesh Materials.meta new file mode 100644 index 0000000..96062b5 --- /dev/null +++ b/Sample/Materials/Mesh Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ca9246a343f474005891c798427ba3e7 +folderAsset: yes +timeCreated: 1428478527 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 1-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 1-Texture.mat new file mode 100644 index 0000000..eeb5065 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 1-Texture.mat @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Legacy Diffuse 1-Texture + m_Shader: {fileID: 4800000, guid: 5894f1bc35e754b3bbeddf49d56c07b9, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BUMPED _UVFREE_RIM + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: e85029a7f516c4a7d82ca355dcb1df12, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cc736e31eaf6744d0954edc0786cbdd5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.01 + - _RimPower: 5 + - _Shininess: 1 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 0 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 1-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 1-Texture.mat.meta new file mode 100644 index 0000000..b85a10c --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 1-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 99152f4607d0f40869e37eb0291be626 +timeCreated: 1428477095 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 3-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 3-Texture.mat new file mode 100644 index 0000000..0f2de84 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 3-Texture.mat @@ -0,0 +1,150 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Legacy Diffuse 3-Texture + m_Shader: {fileID: 4800000, guid: d1a3a95d0a73549319ac7e069d6a9920, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _EMISSION _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BOTTOM _UVFREE_BUMPED + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: e85029a7f516c4a7d82ca355dcb1df12, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cc736e31eaf6744d0954edc0786cbdd5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionMultiplier: 3 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMultiplier: 1 + - _BottomShininess: 0.422 + - _BottomUsingSpecGlossMap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0 + - _RimPower: 8.24 + - _Shininess: 0.01 + - _SrcBlend: 1 + - _TexPower: 10 + - _TopBumpScale: 2 + - _TopEmissionMultiplier: 0 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.5 + - _TopMultiplier: 1 + - _TopShininess: 0.413 + - _TopUsingSpecGlossMap: 0 + - _TriplanarSpace: 1 + - _UVFreeBottom: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 0 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _BottomSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.9264706, g: 0.9264706, b: 0.9264706, a: 1} + - _TopColor: {r: 1, g: 1, b: 1, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 3-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 3-Texture.mat.meta new file mode 100644 index 0000000..224dad1 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Diffuse 3-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 635b97b57bdf94947859ff64f37b0400 +timeCreated: 1428477095 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 1-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 1-Texture.mat new file mode 100644 index 0000000..7fb2416 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 1-Texture.mat @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Legacy Specular 1-Texture + m_Shader: {fileID: 4800000, guid: ab53f541c10484ef2b031dc958e26032, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BUMPED _UVFREE_RIM + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.14 + - _RimPower: 5 + - _Shininess: 1 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 0 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 1-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 1-Texture.mat.meta new file mode 100644 index 0000000..92f246f --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 1-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2895a3d9263044157ac3ddc1e3958247 +timeCreated: 1428475056 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 3-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 3-Texture.mat new file mode 100644 index 0000000..31efa51 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 3-Texture.mat @@ -0,0 +1,150 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Legacy Specular 3-Texture + m_Shader: {fileID: 4800000, guid: 68f7771eeeaa54d69b83a18f2b59ba8d, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _EMISSION _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BOTTOM _UVFREE_BUMPED _UVFREE_RIM + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 0c1e3cd4bd7394ecfbfd64785d3038fe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 57e6d352b5ef74b3db111b04fb00f110, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionMultiplier: 3 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMultiplier: 1 + - _BottomShininess: 0.517 + - _BottomUsingSpecGlossMap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.31 + - _RimPower: 7 + - _Shininess: 0.422 + - _SrcBlend: 1 + - _TexPower: 10 + - _TopBumpScale: 2 + - _TopEmissionMultiplier: 0 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.5 + - _TopMultiplier: 1 + - _TopShininess: 0.558 + - _TopUsingSpecGlossMap: 0 + - _TriplanarSpace: 1 + - _UVFreeBottom: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 0 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _BottomSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} + - _TopColor: {r: 1, g: 1, b: 1, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 3-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 3-Texture.mat.meta new file mode 100644 index 0000000..c4a2406 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Legacy Specular 3-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b29dfaecd8d8e41ac835ecec7461b809 +timeCreated: 1428475492 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 1-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 1-Texture.mat new file mode 100644 index 0000000..93ba6c4 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 1-Texture.mat @@ -0,0 +1,132 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Standard Metallic PBR 1-Texture + m_Shader: {fileID: 4800000, guid: b3ac26fce65714bddabaf5a2562d109a, type: 3} + m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _OCCLUSION _PARALLAXMAP + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 17037b609a70c4800b47f9e3426f7ad2, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionScaleUI: 0 + - _BottomGlossiness: 0.5 + - _BottomMetallic: 0 + - _BottomMultiplier: 0 + - _BottomUsingMetallicGlossMap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0 + - _Parallax: 0.005 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _TexPower: 10 + - _TopBumpScale: 1 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0 + - _TopMetallic: 0 + - _TopMultiplier: 1 + - _TopUsingMetallicGlossMap: 0 + - _TriplanarSpace: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 0.44852942, b: 0.44852942, a: 1} + - _TopColor: {r: 1, g: 1, b: 1, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 1-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 1-Texture.mat.meta new file mode 100644 index 0000000..d1c7aa2 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 1-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 803ee85a3bb8a4d0e9bcd173d370ec42 +timeCreated: 1428459773 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 3-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 3-Texture.mat new file mode 100644 index 0000000..9479ef9 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 3-Texture.mat @@ -0,0 +1,128 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Standard Metallic PBR 3-Texture + m_Shader: {fileID: 4800000, guid: cc1b0f60eb4c244ffb41d05775fdc42c, type: 3} + m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _OCCLUSION _PARALLAXMAP _UVFREE_BOTTOM + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 0a3060fe8797d4597a313c527a81d996, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 17037b609a70c4800b47f9e3426f7ad2, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: b52449f80ebb14672800cf31b1ea6798, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMetallic: 0 + - _BottomMultiplier: 1 + - _BottomUsingMetallicGlossMap: 1 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.593 + - _Metallic: 1 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _TexPower: 10 + - _TopBumpScale: 2 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.362 + - _TopMetallic: 0.541 + - _TopMultiplier: 1.5 + - _TopUsingMetallicGlossMap: 1 + - _TriplanarSpace: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopColor: {r: 0.9137268, g: 0.9137268, b: 0.9137268, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 3-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 3-Texture.mat.meta new file mode 100644 index 0000000..a46476c --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Metallic PBR 3-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc4818471bf3f435bb89f723768f020e +timeCreated: 1428461160 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 1-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 1-Texture.mat new file mode 100644 index 0000000..2092e7b --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 1-Texture.mat @@ -0,0 +1,85 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Standard Specular PBR 1-Texture + m_Shader: {fileID: 4800000, guid: b037cc9f7b4b34ed8be6c81e1b20c146, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 0c1e3cd4bd7394ecfbfd64785d3038fe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 466c7bd54bb094e2790ac16376dff543, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 1 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 1-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 1-Texture.mat.meta new file mode 100644 index 0000000..6888d6a --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 1-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7c926fd2b4dd46f4a0c78376f713fe2 +timeCreated: 1428465453 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 3-Texture.mat b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 3-Texture.mat new file mode 100644 index 0000000..1285733 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 3-Texture.mat @@ -0,0 +1,147 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Standard Specular PBR 3-Texture + m_Shader: {fileID: 4800000, guid: 4ab1ec931c54345fbba6c717fb297e9a, type: 3} + m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _OCCLUSION _PARALLAXMAP _SPECGLOSSMAP + _UVFREE_BOTTOM + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 0a3060fe8797d4597a313c527a81d996, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomSpecGlossMap: + m_Texture: {fileID: 2800000, guid: b7d990833c91c4078983cf6433dbad81, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 0c1e3cd4bd7394ecfbfd64785d3038fe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 57e6d352b5ef74b3db111b04fb00f110, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 17037b609a70c4800b47f9e3426f7ad2, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: b52449f80ebb14672800cf31b1ea6798, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMetallic: 0 + - _BottomMultiplier: 1 + - _BottomUsingMetallicGlossMap: 1 + - _BottomUsingSpecGlossMap: 0 + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 1 + - _Metallic: 1 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _TexPower: 5 + - _TopBumpScale: 1.5 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.362 + - _TopMetallic: 0.541 + - _TopMultiplier: 1.5 + - _TopUsingMetallicGlossMap: 1 + - _TopUsingSpecGlossMap: 0 + - _TriplanarSpace: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 0 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _BottomSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.7058823, g: 0.7058823, b: 0.7058823, a: 1} + - _TopColor: {r: 0.9137268, g: 0.9137268, b: 0.9137268, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 3-Texture.mat.meta b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 3-Texture.mat.meta new file mode 100644 index 0000000..c7327f2 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free Standard Specular PBR 3-Texture.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93847dad6453a470e90f4ced9d9b6017 +timeCreated: 1428465453 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free.meta b/Sample/Materials/Mesh Materials/UV-Free.meta new file mode 100644 index 0000000..c24fcff --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 538c3150698261c43bdb86776d9c17d6 +folderAsset: yes +timeCreated: 1481165631 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching.meta new file mode 100644 index 0000000..a2f6935 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 317b06bdd7650d846ab957be3801f2e5 +folderAsset: yes +timeCreated: 1481165796 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 1-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 1-Tex Self.mat new file mode 100644 index 0000000..03b0e34 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 1-Tex Self.mat @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Diffuse 1-Tex Self + m_Shader: {fileID: 4800000, guid: a4be1a756292d46af86d4106debdc11c, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BUMPED _UVFREE_LOCAL _UVFREE_RIM + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: e85029a7f516c4a7d82ca355dcb1df12, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cc736e31eaf6744d0954edc0786cbdd5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.1 + - _RimPower: 5 + - _Shininess: 1 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 1 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 1-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 1-Tex Self.mat.meta new file mode 100644 index 0000000..7957a67 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 1-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5877f5af11519fb489f2e6310233f41c +timeCreated: 1428477095 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 3-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 3-Tex Self.mat new file mode 100644 index 0000000..b72d05b --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 3-Tex Self.mat @@ -0,0 +1,150 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Diffuse 3-Tex Self + m_Shader: {fileID: 4800000, guid: 10525174022874bcb92d307f06405733, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _EMISSION _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BOTTOM _UVFREE_BUMPED _UVFREE_LOCAL _UVFREE_RIM + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: e85029a7f516c4a7d82ca355dcb1df12, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cc736e31eaf6744d0954edc0786cbdd5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionMultiplier: 3 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMultiplier: 1 + - _BottomShininess: 0.422 + - _BottomUsingSpecGlossMap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.1 + - _RimPower: 5 + - _Shininess: 1 + - _SrcBlend: 1 + - _TexPower: 10 + - _TopBumpScale: 2 + - _TopEmissionMultiplier: 0 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.5 + - _TopMultiplier: 1 + - _TopShininess: 0.413 + - _TopUsingSpecGlossMap: 0 + - _TriplanarSpace: 1 + - _UVFreeBottom: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 1 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _BottomSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} + - _TopColor: {r: 1, g: 1, b: 1, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 3-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 3-Tex Self.mat.meta new file mode 100644 index 0000000..d756e36 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Diffuse 3-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7230e9e9cc209e64393d5fdc13774e63 +timeCreated: 1428477095 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 1-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 1-Tex Self.mat new file mode 100644 index 0000000..1c4baf9 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 1-Tex Self.mat @@ -0,0 +1,79 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Metallic PBR 1-Tex Self + m_Shader: {fileID: 4800000, guid: 4b4a183588f7044b9bb2f086b44f7621, type: 3} + m_ShaderKeywords: _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION _PARALLAXMAP + _UVFREE_LOCAL + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 17037b609a70c4800b47f9e3426f7ad2, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 1 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 1-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 1-Tex Self.mat.meta new file mode 100644 index 0000000..8f155df --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 1-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8fc21b599794734a8eb34b9c3be7cc7 +timeCreated: 1428459773 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 3-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 3-Tex Self.mat new file mode 100644 index 0000000..e8be992 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 3-Tex Self.mat @@ -0,0 +1,129 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Metallic PBR 3-Tex Self + m_Shader: {fileID: 4800000, guid: d8cd05889c49f4d36a42c72f6529b1e0, type: 3} + m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _OCCLUSION _PARALLAXMAP _UVFREE_BOTTOM + _UVFREE_LOCAL + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 0a3060fe8797d4597a313c527a81d996, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 17037b609a70c4800b47f9e3426f7ad2, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: b52449f80ebb14672800cf31b1ea6798, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMetallic: 0 + - _BottomMultiplier: 1 + - _BottomUsingMetallicGlossMap: 1 + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.593 + - _Metallic: 1 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _TexPower: 5 + - _TopBumpScale: 1.5 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.362 + - _TopMetallic: 0.541 + - _TopMultiplier: 1.5 + - _TopUsingMetallicGlossMap: 1 + - _TriplanarSpace: 1 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopColor: {r: 0.9137268, g: 0.9137268, b: 0.9137268, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 3-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 3-Tex Self.mat.meta new file mode 100644 index 0000000..69ed0f5 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Metallic PBR 3-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fabf30b7d1db889458cdf47eb9a8f7b8 +timeCreated: 1428461160 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 1-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 1-Tex Self.mat new file mode 100644 index 0000000..054ef27 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 1-Tex Self.mat @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Specular 1-Tex Self + m_Shader: {fileID: 4800000, guid: 6be38e856357c4f12b953c2addabeddb, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BUMPED _UVFREE_LOCAL _UVFREE_RIM + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.04 + - _RimPower: 5 + - _Shininess: 1 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 1 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 1-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 1-Tex Self.mat.meta new file mode 100644 index 0000000..f695e4f --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 1-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3d16f9ca23706b43a3a5d71f8d63318 +timeCreated: 1428475056 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 3-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 3-Tex Self.mat new file mode 100644 index 0000000..2378a63 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 3-Tex Self.mat @@ -0,0 +1,150 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Specular 3-Tex Self + m_Shader: {fileID: 4800000, guid: 935d64de9b72849c9aa20b71c7163804, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _EMISSION _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_BOTTOM _UVFREE_BUMPED _UVFREE_LOCAL _UVFREE_RIM + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 0c1e3cd4bd7394ecfbfd64785d3038fe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 57e6d352b5ef74b3db111b04fb00f110, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionMultiplier: 3 + - _BottomEmissionScaleUI: 0 + - _BottomGlossiness: 0.47 + - _BottomMultiplier: 1 + - _BottomShininess: 0.422 + - _BottomUsingSpecGlossMap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _Emission: 0 + - _EmissionMultiplier: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.786 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _RimMultiplier: 0.14 + - _RimPower: 7 + - _Shininess: 0.474 + - _SrcBlend: 1 + - _TexPower: 10 + - _TopBumpScale: 2 + - _TopEmissionMultiplier: 0 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.255 + - _TopMultiplier: 1 + - _TopShininess: 0.437 + - _TopUsingSpecGlossMap: 0 + - _TriplanarSpace: 1 + - _UVFreeBottom: 1 + - _UVFreeBumped: 1 + - _UVFreeLocal: 1 + - _UVFreeRim: 0 + - _UVFreeVertexColor: 0 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _BottomSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} + - _TopColor: {r: 1, g: 1, b: 1, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopSpecColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 3-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 3-Tex Self.mat.meta new file mode 100644 index 0000000..8a300ee --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular 3-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e83f520f3840134e84f47684eacdb7c +timeCreated: 1428475492 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 1-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 1-Tex Self.mat new file mode 100644 index 0000000..a9cf359 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 1-Tex Self.mat @@ -0,0 +1,85 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Specular PBR 1-Tex Self + m_Shader: {fileID: 4800000, guid: b037cc9f7b4b34ed8be6c81e1b20c146, type: 3} + m_ShaderKeywords: _DETAIL _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _PARALLAXMAP _SPECGLOSSMAP _UVFREE_LOCAL + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 0c1e3cd4bd7394ecfbfd64785d3038fe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 2800000, guid: 8b03de0b171354c89a439f8289e5c3e5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 2800000, guid: 8e69b4fdf7ba848b5aba2ff795486ea4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 466c7bd54bb094e2790ac16376dff543, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 5f630e5bb732848f5a8938c66f602308, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: bef4ac7e31d6e4a689a5c84f40fd56c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 0.5 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 0.6 + - _Parallax: 0.0138 + - _SrcBlend: 1 + - _TexPower: 10 + - _TriplanarSpace: 1 + - _UVSec: 0 + - _UsingMetallicGlossMap: 1 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 1 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 1-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 1-Tex Self.mat.meta new file mode 100644 index 0000000..bbd5ea5 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 1-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61bfa1c65d2f03e459bb0988138b1a23 +timeCreated: 1428465453 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 3-Tex Self.mat b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 3-Tex Self.mat new file mode 100644 index 0000000..e6ed09f --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 3-Tex Self.mat @@ -0,0 +1,147 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Specular PBR 3-Tex Self + m_Shader: {fileID: 4800000, guid: a18eb636b612d497bb0afa0ce8c67b12, type: 3} + m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _OCCLUSION _PARALLAXMAP _SPECGLOSSMAP + _UVFREE_BOTTOM _UVFREE_LOCAL + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BottomBumpMap: + m_Texture: {fileID: 2800000, guid: e89fc6eac82134db49ef192518d79fbe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomEmissionMap: + m_Texture: {fileID: 2800000, guid: ebe2b695c3f6d43bd8df7e1052075eb9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMainTex: + m_Texture: {fileID: 2800000, guid: 771ba38d9f8f3458082e78c4a8e16f5c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 0a3060fe8797d4597a313c527a81d996, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BottomSpecGlossMap: + m_Texture: {fileID: 2800000, guid: b7d990833c91c4078983cf6433dbad81, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 0c1e3cd4bd7394ecfbfd64785d3038fe, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 57e6d352b5ef74b3db111b04fb00f110, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 17037b609a70c4800b47f9e3426f7ad2, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: bdd0d3bf2bd6846fbbae064bf416d295, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopBumpMap: + m_Texture: {fileID: 2800000, guid: aa7f6dc8f60e64937850f37ad06fec77, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopEmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMainTex: + m_Texture: {fileID: 2800000, guid: 7aadb23c6bc084d40925bf75661a1443, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopMetallicGlossMap: + m_Texture: {fileID: 2800000, guid: b52449f80ebb14672800cf31b1ea6798, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TopSpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BottomBumpScale: 1 + - _BottomEmissionScaleUI: 3 + - _BottomGlossiness: 0.5 + - _BottomMetallic: 0 + - _BottomMultiplier: 1 + - _BottomUsingMetallicGlossMap: 1 + - _BottomUsingSpecGlossMap: 0 + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 1 + - _Metallic: 1 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _TexPower: 5 + - _TopBumpScale: 1.5 + - _TopEmissionScaleUI: 0 + - _TopGlossiness: 0.362 + - _TopMetallic: 0.541 + - _TopMultiplier: 1.5 + - _TopUsingMetallicGlossMap: 1 + - _TopUsingSpecGlossMap: 0 + - _TriplanarSpace: 1 + - _UVSec: 0 + - _UsingMetallicGlossMap: 0 + - _UsingSpecGlossMap: 1 + - _VertexColorStrength: 0 + - _ZWrite: 1 + m_Colors: + - _BottomColor: {r: 1, g: 1, b: 1, a: 1} + - _BottomEmissionColor: {r: 3, g: 3, b: 3, a: 3} + - _BottomEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _BottomSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.7058823, g: 0.7058823, b: 0.7058823, a: 1} + - _TopColor: {r: 0.9137268, g: 0.9137268, b: 0.9137268, a: 1} + - _TopEmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _TopEmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _TopSpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 3-Tex Self.mat.meta b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 3-Tex Self.mat.meta new file mode 100644 index 0000000..d868e72 --- /dev/null +++ b/Sample/Materials/Mesh Materials/UV-Free/Self Space Nonbatching/Specular PBR 3-Tex Self.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b2ad4544569ef846ab70431eba2569b +timeCreated: 1428465453 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Terrain Materials.meta b/Sample/Materials/Terrain Materials.meta new file mode 100644 index 0000000..e5793ba --- /dev/null +++ b/Sample/Materials/Terrain Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8cb95cd7b12344e63937270597b4acba +folderAsset: yes +timeCreated: 1428478449 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Terrain Materials/UV-Free Legacy Diffuse Terrain.mat b/Sample/Materials/Terrain Materials/UV-Free Legacy Diffuse Terrain.mat new file mode 100644 index 0000000..09c75db --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Legacy Diffuse Terrain.mat @@ -0,0 +1,70 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Legacy Diffuse Terrain + m_Shader: {fileID: 4800000, guid: 56432fa74ed7043e485d31f8dbb163ea, type: 3} + m_ShaderKeywords: _UVFREE_BUMPED + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Control: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _RimMultiplier: 0.1 + - _RimPower: 5 + - _TexPower: 10 + - _UVFreeRim: 0 + - _UVScale: 100 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Terrain Materials/UV-Free Legacy Diffuse Terrain.mat.meta b/Sample/Materials/Terrain Materials/UV-Free Legacy Diffuse Terrain.mat.meta new file mode 100644 index 0000000..0663d1b --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Legacy Diffuse Terrain.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51c000f743ee743988b11f71d0a3f9d4 +timeCreated: 1428478449 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Terrain Materials/UV-Free Legacy Specular Terrain.mat b/Sample/Materials/Terrain Materials/UV-Free Legacy Specular Terrain.mat new file mode 100644 index 0000000..3071493 --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Legacy Specular Terrain.mat @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Legacy Specular Terrain + m_Shader: {fileID: 4800000, guid: f12406e1126a444b79fee18cce430514, type: 3} + m_ShaderKeywords: _UVFREE_BUMPED + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Control: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _RimMultiplier: 0 + - _RimPower: 5 + - _Shininess: 1 + - _TexPower: 10 + - _UVFreeRim: 0 + - _UVScale: 100 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.4705882, g: 0.4705882, b: 0.4705882, a: 1} diff --git a/Sample/Materials/Terrain Materials/UV-Free Legacy Specular Terrain.mat.meta b/Sample/Materials/Terrain Materials/UV-Free Legacy Specular Terrain.mat.meta new file mode 100644 index 0000000..bf312f8 --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Legacy Specular Terrain.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af00dfb3e6f1d4a83bc3ecfa857ddfef +timeCreated: 1428478449 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Terrain Materials/UV-Free Standard Metallic PBR Terrain.mat b/Sample/Materials/Terrain Materials/UV-Free Standard Metallic PBR Terrain.mat new file mode 100644 index 0000000..b50ba00 --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Standard Metallic PBR Terrain.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Standard Metallic PBR Terrain + m_Shader: {fileID: 4800000, guid: 9d90a5ae4faf244fd9a8b99d09f9fb66, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Control: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Metallic0: 0 + - _Metallic1: 0 + - _Metallic2: 0 + - _Metallic3: 0 + - _OverrideSmoothness: 0 + - _Smoothness: 0.5 + - _Smoothness0: 1 + - _Smoothness1: 1 + - _Smoothness2: 1 + - _Smoothness3: 1 + - _TexPower: 10 + - _UVScale: 100 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Sample/Materials/Terrain Materials/UV-Free Standard Metallic PBR Terrain.mat.meta b/Sample/Materials/Terrain Materials/UV-Free Standard Metallic PBR Terrain.mat.meta new file mode 100644 index 0000000..db3b9fb --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Standard Metallic PBR Terrain.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9b7c8dedb7d34b9495aad4df6a88d58 +timeCreated: 1428478449 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Terrain Materials/UV-Free Standard Specular PBR Terrain.mat b/Sample/Materials/Terrain Materials/UV-Free Standard Specular PBR Terrain.mat new file mode 100644 index 0000000..f3dcab2 --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Standard Specular PBR Terrain.mat @@ -0,0 +1,73 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UV-Free Standard Specular PBR Terrain + m_Shader: {fileID: 4800000, guid: cd37e0b49bce84f099a62f77d42e8a90, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Control: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Normal3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Splat3: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _OverrideSmoothness: 0 + - _Smoothness: 0.078125 + - _Smoothness0: 1 + - _Smoothness1: 1 + - _Smoothness2: 1 + - _Smoothness3: 1 + - _TexPower: 10 + - _UVScale: 100 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1} diff --git a/Sample/Materials/Terrain Materials/UV-Free Standard Specular PBR Terrain.mat.meta b/Sample/Materials/Terrain Materials/UV-Free Standard Specular PBR Terrain.mat.meta new file mode 100644 index 0000000..69fbb53 --- /dev/null +++ b/Sample/Materials/Terrain Materials/UV-Free Standard Specular PBR Terrain.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d1879ec98bd347818e7dac66f4414d6 +timeCreated: 1428478449 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures.meta b/Sample/Materials/Textures.meta new file mode 100644 index 0000000..ad7545b --- /dev/null +++ b/Sample/Materials/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a6afdbf8969cb4d08ac45e729ae3fa02 +folderAsset: yes +timeCreated: 1428459740 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/brick.meta b/Sample/Materials/Textures/brick.meta new file mode 100644 index 0000000..12fc7eb --- /dev/null +++ b/Sample/Materials/Textures/brick.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f621ed9b77ed54c299a173edebfb2aa5 +folderAsset: yes +timeCreated: 1428512489 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/brick/brick_albedo.png b/Sample/Materials/Textures/brick/brick_albedo.png new file mode 100644 index 0000000..3750514 Binary files /dev/null and b/Sample/Materials/Textures/brick/brick_albedo.png differ diff --git a/Sample/Materials/Textures/brick/brick_albedo.png.meta b/Sample/Materials/Textures/brick/brick_albedo.png.meta new file mode 100644 index 0000000..615bfe5 --- /dev/null +++ b/Sample/Materials/Textures/brick/brick_albedo.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 6bcac1f0225b440e68cfe408de6ce51a +timeCreated: 1428512490 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/brick/brick_normal.png b/Sample/Materials/Textures/brick/brick_normal.png new file mode 100644 index 0000000..b4b6f3c Binary files /dev/null and b/Sample/Materials/Textures/brick/brick_normal.png differ diff --git a/Sample/Materials/Textures/brick/brick_normal.png.meta b/Sample/Materials/Textures/brick/brick_normal.png.meta new file mode 100644 index 0000000..b436cc5 --- /dev/null +++ b/Sample/Materials/Textures/brick/brick_normal.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a2b4ee181bd0d4b9f8dfe97b80a4a76c +timeCreated: 1428512490 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/burning_coals.meta b/Sample/Materials/Textures/burning_coals.meta new file mode 100644 index 0000000..759bb22 --- /dev/null +++ b/Sample/Materials/Textures/burning_coals.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 71904dfde1096440fa24b3c944d303c0 +folderAsset: yes +timeCreated: 1428462193 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/burning_coals/burning_coals_emissive.png b/Sample/Materials/Textures/burning_coals/burning_coals_emissive.png new file mode 100644 index 0000000..0758ce8 Binary files /dev/null and b/Sample/Materials/Textures/burning_coals/burning_coals_emissive.png differ diff --git a/Sample/Materials/Textures/burning_coals/burning_coals_emissive.png.meta b/Sample/Materials/Textures/burning_coals/burning_coals_emissive.png.meta new file mode 100644 index 0000000..373c3e7 --- /dev/null +++ b/Sample/Materials/Textures/burning_coals/burning_coals_emissive.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: ebe2b695c3f6d43bd8df7e1052075eb9 +timeCreated: 1428462194 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/burning_coals/burning_coals_metallic_smoothness.png b/Sample/Materials/Textures/burning_coals/burning_coals_metallic_smoothness.png new file mode 100644 index 0000000..14267ef Binary files /dev/null and b/Sample/Materials/Textures/burning_coals/burning_coals_metallic_smoothness.png differ diff --git a/Sample/Materials/Textures/burning_coals/burning_coals_metallic_smoothness.png.meta b/Sample/Materials/Textures/burning_coals/burning_coals_metallic_smoothness.png.meta new file mode 100644 index 0000000..4126560 --- /dev/null +++ b/Sample/Materials/Textures/burning_coals/burning_coals_metallic_smoothness.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 0a3060fe8797d4597a313c527a81d996 +timeCreated: 1428462193 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/burning_coals/burning_coals_normal.png b/Sample/Materials/Textures/burning_coals/burning_coals_normal.png new file mode 100644 index 0000000..ef3b254 Binary files /dev/null and b/Sample/Materials/Textures/burning_coals/burning_coals_normal.png differ diff --git a/Sample/Materials/Textures/burning_coals/burning_coals_normal.png.meta b/Sample/Materials/Textures/burning_coals/burning_coals_normal.png.meta new file mode 100644 index 0000000..562600b --- /dev/null +++ b/Sample/Materials/Textures/burning_coals/burning_coals_normal.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: e89fc6eac82134db49ef192518d79fbe +timeCreated: 1428462194 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/burning_coals/ground_burning_coals_diffuse_glossiness.png b/Sample/Materials/Textures/burning_coals/ground_burning_coals_diffuse_glossiness.png new file mode 100644 index 0000000..1e5fb32 Binary files /dev/null and b/Sample/Materials/Textures/burning_coals/ground_burning_coals_diffuse_glossiness.png differ diff --git a/Sample/Materials/Textures/burning_coals/ground_burning_coals_diffuse_glossiness.png.meta b/Sample/Materials/Textures/burning_coals/ground_burning_coals_diffuse_glossiness.png.meta new file mode 100644 index 0000000..34443dc --- /dev/null +++ b/Sample/Materials/Textures/burning_coals/ground_burning_coals_diffuse_glossiness.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 771ba38d9f8f3458082e78c4a8e16f5c +timeCreated: 1428462194 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/canyonland.meta b/Sample/Materials/Textures/canyonland.meta new file mode 100644 index 0000000..983abc1 --- /dev/null +++ b/Sample/Materials/Textures/canyonland.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3c9693d2c208b4cc39c8304250c9e0f7 +folderAsset: yes +timeCreated: 1428516088 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/canyonland/canyonland_diffuse_gloss.tga b/Sample/Materials/Textures/canyonland/canyonland_diffuse_gloss.tga new file mode 100644 index 0000000..6104840 Binary files /dev/null and b/Sample/Materials/Textures/canyonland/canyonland_diffuse_gloss.tga differ diff --git a/Sample/Materials/Textures/canyonland/canyonland_diffuse_gloss.tga.meta b/Sample/Materials/Textures/canyonland/canyonland_diffuse_gloss.tga.meta new file mode 100644 index 0000000..b0af2e4 --- /dev/null +++ b/Sample/Materials/Textures/canyonland/canyonland_diffuse_gloss.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: caf3de73bba09477287ac056749cc5ac +timeCreated: 1428516089 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/canyonland/canyonland_normal.tga b/Sample/Materials/Textures/canyonland/canyonland_normal.tga new file mode 100644 index 0000000..d9d797c Binary files /dev/null and b/Sample/Materials/Textures/canyonland/canyonland_normal.tga differ diff --git a/Sample/Materials/Textures/canyonland/canyonland_normal.tga.meta b/Sample/Materials/Textures/canyonland/canyonland_normal.tga.meta new file mode 100644 index 0000000..2e9fa1c --- /dev/null +++ b/Sample/Materials/Textures/canyonland/canyonland_normal.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: c4585ba55efc1441ea29326840edb0fe +timeCreated: 1428516088 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/iceblock.meta b/Sample/Materials/Textures/iceblock.meta new file mode 100644 index 0000000..cc27a60 --- /dev/null +++ b/Sample/Materials/Textures/iceblock.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6542c8f80b0684540994de8d09a56242 +folderAsset: yes +timeCreated: 1428512498 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/iceblock/iceblock_albedo.png b/Sample/Materials/Textures/iceblock/iceblock_albedo.png new file mode 100644 index 0000000..0bcfda7 Binary files /dev/null and b/Sample/Materials/Textures/iceblock/iceblock_albedo.png differ diff --git a/Sample/Materials/Textures/iceblock/iceblock_albedo.png.meta b/Sample/Materials/Textures/iceblock/iceblock_albedo.png.meta new file mode 100644 index 0000000..41ce549 --- /dev/null +++ b/Sample/Materials/Textures/iceblock/iceblock_albedo.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 9a7afa654f2054a12a6f7e78e3321f50 +timeCreated: 1428512498 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/iceblock/iceblock_normal.tga b/Sample/Materials/Textures/iceblock/iceblock_normal.tga new file mode 100644 index 0000000..d0cedbe Binary files /dev/null and b/Sample/Materials/Textures/iceblock/iceblock_normal.tga differ diff --git a/Sample/Materials/Textures/iceblock/iceblock_normal.tga.meta b/Sample/Materials/Textures/iceblock/iceblock_normal.tga.meta new file mode 100644 index 0000000..23f945d --- /dev/null +++ b/Sample/Materials/Textures/iceblock/iceblock_normal.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: f7e4b3147eda345418a2f07ede6f7efa +timeCreated: 1428512499 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/mud_cracked.meta b/Sample/Materials/Textures/mud_cracked.meta new file mode 100644 index 0000000..bb191e4 --- /dev/null +++ b/Sample/Materials/Textures/mud_cracked.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 88b1c917d723b4b7089e787990a86ead +folderAsset: yes +timeCreated: 1428460437 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/mud_cracked/mud_cracked_diffuse_glossiness.png b/Sample/Materials/Textures/mud_cracked/mud_cracked_diffuse_glossiness.png new file mode 100644 index 0000000..4d84ab8 Binary files /dev/null and b/Sample/Materials/Textures/mud_cracked/mud_cracked_diffuse_glossiness.png differ diff --git a/Sample/Materials/Textures/mud_cracked/mud_cracked_diffuse_glossiness.png.meta b/Sample/Materials/Textures/mud_cracked/mud_cracked_diffuse_glossiness.png.meta new file mode 100644 index 0000000..f9d65da --- /dev/null +++ b/Sample/Materials/Textures/mud_cracked/mud_cracked_diffuse_glossiness.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: cc736e31eaf6744d0954edc0786cbdd5 +timeCreated: 1428460437 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/mud_cracked/mud_cracked_normal.png b/Sample/Materials/Textures/mud_cracked/mud_cracked_normal.png new file mode 100644 index 0000000..1fe7ce2 Binary files /dev/null and b/Sample/Materials/Textures/mud_cracked/mud_cracked_normal.png differ diff --git a/Sample/Materials/Textures/mud_cracked/mud_cracked_normal.png.meta b/Sample/Materials/Textures/mud_cracked/mud_cracked_normal.png.meta new file mode 100644 index 0000000..2c96b31 --- /dev/null +++ b/Sample/Materials/Textures/mud_cracked/mud_cracked_normal.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: e85029a7f516c4a7d82ca355dcb1df12 +timeCreated: 1428460437 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/sandstone.meta b/Sample/Materials/Textures/sandstone.meta new file mode 100644 index 0000000..4240c4a --- /dev/null +++ b/Sample/Materials/Textures/sandstone.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 52f8053e0650c4203952c53046845846 +folderAsset: yes +timeCreated: 1428512540 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/sandstone/sandstone_diffuse.tga b/Sample/Materials/Textures/sandstone/sandstone_diffuse.tga new file mode 100644 index 0000000..500087e Binary files /dev/null and b/Sample/Materials/Textures/sandstone/sandstone_diffuse.tga differ diff --git a/Sample/Materials/Textures/sandstone/sandstone_diffuse.tga.meta b/Sample/Materials/Textures/sandstone/sandstone_diffuse.tga.meta new file mode 100644 index 0000000..d91f2ec --- /dev/null +++ b/Sample/Materials/Textures/sandstone/sandstone_diffuse.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 6ef85db7f3161470e8326fb985027a64 +timeCreated: 1428515256 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/sandstone/sandstone_normal.tga b/Sample/Materials/Textures/sandstone/sandstone_normal.tga new file mode 100644 index 0000000..2dc875c Binary files /dev/null and b/Sample/Materials/Textures/sandstone/sandstone_normal.tga differ diff --git a/Sample/Materials/Textures/sandstone/sandstone_normal.tga.meta b/Sample/Materials/Textures/sandstone/sandstone_normal.tga.meta new file mode 100644 index 0000000..00a0c10 --- /dev/null +++ b/Sample/Materials/Textures/sandstone/sandstone_normal.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: e5e3791f5e55e47978d3f92e7d0251c9 +timeCreated: 1428512540 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/snow_dunes.meta b/Sample/Materials/Textures/snow_dunes.meta new file mode 100644 index 0000000..14c12d9 --- /dev/null +++ b/Sample/Materials/Textures/snow_dunes.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02f0e25996fb040dca95be8e4cd8cbe6 +folderAsset: yes +timeCreated: 1428463410 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/snow_dunes/snow_dunes_diffuse_glossiness.tga b/Sample/Materials/Textures/snow_dunes/snow_dunes_diffuse_glossiness.tga new file mode 100644 index 0000000..7d73555 Binary files /dev/null and b/Sample/Materials/Textures/snow_dunes/snow_dunes_diffuse_glossiness.tga differ diff --git a/Sample/Materials/Textures/snow_dunes/snow_dunes_diffuse_glossiness.tga.meta b/Sample/Materials/Textures/snow_dunes/snow_dunes_diffuse_glossiness.tga.meta new file mode 100644 index 0000000..c72aa6a --- /dev/null +++ b/Sample/Materials/Textures/snow_dunes/snow_dunes_diffuse_glossiness.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 7aadb23c6bc084d40925bf75661a1443 +timeCreated: 1428463411 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/snow_dunes/snow_dunes_normal.tga b/Sample/Materials/Textures/snow_dunes/snow_dunes_normal.tga new file mode 100644 index 0000000..478b935 Binary files /dev/null and b/Sample/Materials/Textures/snow_dunes/snow_dunes_normal.tga differ diff --git a/Sample/Materials/Textures/snow_dunes/snow_dunes_normal.tga.meta b/Sample/Materials/Textures/snow_dunes/snow_dunes_normal.tga.meta new file mode 100644 index 0000000..df486ae --- /dev/null +++ b/Sample/Materials/Textures/snow_dunes/snow_dunes_normal.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: aa7f6dc8f60e64937850f37ad06fec77 +timeCreated: 1428463411 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/snow_dunes/snow_dunes_specular_glossiness.tga b/Sample/Materials/Textures/snow_dunes/snow_dunes_specular_glossiness.tga new file mode 100644 index 0000000..6ec4b4f Binary files /dev/null and b/Sample/Materials/Textures/snow_dunes/snow_dunes_specular_glossiness.tga differ diff --git a/Sample/Materials/Textures/snow_dunes/snow_dunes_specular_glossiness.tga.meta b/Sample/Materials/Textures/snow_dunes/snow_dunes_specular_glossiness.tga.meta new file mode 100644 index 0000000..44e123f --- /dev/null +++ b/Sample/Materials/Textures/snow_dunes/snow_dunes_specular_glossiness.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: b52449f80ebb14672800cf31b1ea6798 +timeCreated: 1428463411 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates.meta b/Sample/Materials/Textures/steel_plates.meta new file mode 100644 index 0000000..fdc3aea --- /dev/null +++ b/Sample/Materials/Textures/steel_plates.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5eeb026dc7d764f8385a48c281be2c0d +folderAsset: yes +timeCreated: 1428459887 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_albedo.png b/Sample/Materials/Textures/steel_plates/steel_plates_albedo.png new file mode 100644 index 0000000..7ffe5db Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_albedo.png differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_albedo.png.meta b/Sample/Materials/Textures/steel_plates/steel_plates_albedo.png.meta new file mode 100644 index 0000000..ba21fd1 --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_albedo.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 8b03de0b171354c89a439f8289e5c3e5 +timeCreated: 1428459888 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_ambient_occlusion.tga b/Sample/Materials/Textures/steel_plates/steel_plates_ambient_occlusion.tga new file mode 100644 index 0000000..7377201 Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_ambient_occlusion.tga differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_ambient_occlusion.tga.meta b/Sample/Materials/Textures/steel_plates/steel_plates_ambient_occlusion.tga.meta new file mode 100644 index 0000000..10df17f --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_ambient_occlusion.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 998d2c1ccc67c4bc0bcb9a5cee6d9344 +timeCreated: 1428459888 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_diffuse_glossiness.tga b/Sample/Materials/Textures/steel_plates/steel_plates_diffuse_glossiness.tga new file mode 100644 index 0000000..69757db Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_diffuse_glossiness.tga differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_diffuse_glossiness.tga.meta b/Sample/Materials/Textures/steel_plates/steel_plates_diffuse_glossiness.tga.meta new file mode 100644 index 0000000..0814e9b --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_diffuse_glossiness.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 6c40f1947f8074afebb656faae74a74b +timeCreated: 1428459888 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_height.tga b/Sample/Materials/Textures/steel_plates/steel_plates_height.tga new file mode 100644 index 0000000..f80218a Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_height.tga differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_height.tga.meta b/Sample/Materials/Textures/steel_plates/steel_plates_height.tga.meta new file mode 100644 index 0000000..b3a531d --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_height.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 17037b609a70c4800b47f9e3426f7ad2 +timeCreated: 1428459887 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_mask.tga b/Sample/Materials/Textures/steel_plates/steel_plates_mask.tga new file mode 100644 index 0000000..0fa55f2 Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_mask.tga differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_mask.tga.meta b/Sample/Materials/Textures/steel_plates/steel_plates_mask.tga.meta new file mode 100644 index 0000000..5bd124e --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_mask.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 405be6a6c22724b2b9147e09497ae663 +timeCreated: 1428486734 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_metallic_smoothness.png b/Sample/Materials/Textures/steel_plates/steel_plates_metallic_smoothness.png new file mode 100644 index 0000000..d05c6bc Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_metallic_smoothness.png differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_metallic_smoothness.png.meta b/Sample/Materials/Textures/steel_plates/steel_plates_metallic_smoothness.png.meta new file mode 100644 index 0000000..6c97f6a --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_metallic_smoothness.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 3f0f2ce1baaee40a1aaaf3113f2da0c4 +timeCreated: 1428459887 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_normal.tga b/Sample/Materials/Textures/steel_plates/steel_plates_normal.tga new file mode 100644 index 0000000..e28f386 Binary files /dev/null and b/Sample/Materials/Textures/steel_plates/steel_plates_normal.tga differ diff --git a/Sample/Materials/Textures/steel_plates/steel_plates_normal.tga.meta b/Sample/Materials/Textures/steel_plates/steel_plates_normal.tga.meta new file mode 100644 index 0000000..32997ac --- /dev/null +++ b/Sample/Materials/Textures/steel_plates/steel_plates_normal.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 8e69b4fdf7ba848b5aba2ff795486ea4 +timeCreated: 1428459888 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/thick_grass.meta b/Sample/Materials/Textures/thick_grass.meta new file mode 100644 index 0000000..b781363 --- /dev/null +++ b/Sample/Materials/Textures/thick_grass.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 56db37b8d435342b0abcde9690b68f6b +folderAsset: yes +timeCreated: 1428512479 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/thick_grass/thick_grass_diffuse.tga b/Sample/Materials/Textures/thick_grass/thick_grass_diffuse.tga new file mode 100644 index 0000000..6670c60 Binary files /dev/null and b/Sample/Materials/Textures/thick_grass/thick_grass_diffuse.tga differ diff --git a/Sample/Materials/Textures/thick_grass/thick_grass_diffuse.tga.meta b/Sample/Materials/Textures/thick_grass/thick_grass_diffuse.tga.meta new file mode 100644 index 0000000..ef51f4a --- /dev/null +++ b/Sample/Materials/Textures/thick_grass/thick_grass_diffuse.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 6f852bd9a0fc54a2ead8ca9694e80077 +timeCreated: 1428512481 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/thick_grass/thick_grass_normal.tga b/Sample/Materials/Textures/thick_grass/thick_grass_normal.tga new file mode 100644 index 0000000..10da0d3 Binary files /dev/null and b/Sample/Materials/Textures/thick_grass/thick_grass_normal.tga differ diff --git a/Sample/Materials/Textures/thick_grass/thick_grass_normal.tga.meta b/Sample/Materials/Textures/thick_grass/thick_grass_normal.tga.meta new file mode 100644 index 0000000..cc0f1c7 --- /dev/null +++ b/Sample/Materials/Textures/thick_grass/thick_grass_normal.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 31d6d0bc3410b441bbc9fefb8ec608f4 +timeCreated: 1428512480 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood.meta b/Sample/Materials/Textures/wood.meta new file mode 100644 index 0000000..1435398 --- /dev/null +++ b/Sample/Materials/Textures/wood.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bea325abdf8384775a5ecaf567f4b125 +folderAsset: yes +timeCreated: 1428459837 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood/wood_albedo.png b/Sample/Materials/Textures/wood/wood_albedo.png new file mode 100644 index 0000000..7cadba8 Binary files /dev/null and b/Sample/Materials/Textures/wood/wood_albedo.png differ diff --git a/Sample/Materials/Textures/wood/wood_albedo.png.meta b/Sample/Materials/Textures/wood/wood_albedo.png.meta new file mode 100644 index 0000000..87930f0 --- /dev/null +++ b/Sample/Materials/Textures/wood/wood_albedo.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 466c7bd54bb094e2790ac16376dff543 +timeCreated: 1428459838 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood/wood_ambient_occlusion.png b/Sample/Materials/Textures/wood/wood_ambient_occlusion.png new file mode 100644 index 0000000..9202a8b Binary files /dev/null and b/Sample/Materials/Textures/wood/wood_ambient_occlusion.png differ diff --git a/Sample/Materials/Textures/wood/wood_ambient_occlusion.png.meta b/Sample/Materials/Textures/wood/wood_ambient_occlusion.png.meta new file mode 100644 index 0000000..861b1b5 --- /dev/null +++ b/Sample/Materials/Textures/wood/wood_ambient_occlusion.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 5f630e5bb732848f5a8938c66f602308 +timeCreated: 1428459838 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood/wood_diffuse_glossiness.png b/Sample/Materials/Textures/wood/wood_diffuse_glossiness.png new file mode 100644 index 0000000..84c4d5e Binary files /dev/null and b/Sample/Materials/Textures/wood/wood_diffuse_glossiness.png differ diff --git a/Sample/Materials/Textures/wood/wood_diffuse_glossiness.png.meta b/Sample/Materials/Textures/wood/wood_diffuse_glossiness.png.meta new file mode 100644 index 0000000..f0611c8 --- /dev/null +++ b/Sample/Materials/Textures/wood/wood_diffuse_glossiness.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 57e6d352b5ef74b3db111b04fb00f110 +timeCreated: 1428459838 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood/wood_height.png b/Sample/Materials/Textures/wood/wood_height.png new file mode 100644 index 0000000..c25ad39 Binary files /dev/null and b/Sample/Materials/Textures/wood/wood_height.png differ diff --git a/Sample/Materials/Textures/wood/wood_height.png.meta b/Sample/Materials/Textures/wood/wood_height.png.meta new file mode 100644 index 0000000..a549da4 --- /dev/null +++ b/Sample/Materials/Textures/wood/wood_height.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: bef4ac7e31d6e4a689a5c84f40fd56c9 +timeCreated: 1428459838 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood/wood_normal.png b/Sample/Materials/Textures/wood/wood_normal.png new file mode 100644 index 0000000..f9ad592 Binary files /dev/null and b/Sample/Materials/Textures/wood/wood_normal.png differ diff --git a/Sample/Materials/Textures/wood/wood_normal.png.meta b/Sample/Materials/Textures/wood/wood_normal.png.meta new file mode 100644 index 0000000..81f066e --- /dev/null +++ b/Sample/Materials/Textures/wood/wood_normal.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 0c1e3cd4bd7394ecfbfd64785d3038fe +timeCreated: 1428459837 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 1 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Materials/Textures/wood/wood_specular_smoothness.png b/Sample/Materials/Textures/wood/wood_specular_smoothness.png new file mode 100644 index 0000000..5c21888 Binary files /dev/null and b/Sample/Materials/Textures/wood/wood_specular_smoothness.png differ diff --git a/Sample/Materials/Textures/wood/wood_specular_smoothness.png.meta b/Sample/Materials/Textures/wood/wood_specular_smoothness.png.meta new file mode 100644 index 0000000..43a77e6 --- /dev/null +++ b/Sample/Materials/Textures/wood/wood_specular_smoothness.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: bdd0d3bf2bd6846fbbae064bf416d295 +timeCreated: 1428459838 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/SAMPLE_README.txt b/Sample/SAMPLE_README.txt new file mode 100644 index 0000000..e804da3 --- /dev/null +++ b/Sample/SAMPLE_README.txt @@ -0,0 +1,10 @@ +Feel free to delete this sample folder after you +are done playing around with the sample scene. + +The real versions of the watermarked materials +included for sample purposes only are available +at: +http://gametextures.com + +The marked textures are distributed in the sample +scene with permission from GameTextures.com. \ No newline at end of file diff --git a/Sample/SAMPLE_README.txt.meta b/Sample/SAMPLE_README.txt.meta new file mode 100644 index 0000000..7206ec1 --- /dev/null +++ b/Sample/SAMPLE_README.txt.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: e968ce097a639c64597d8cc4ead0e69e +TextScriptImporter: + userData: diff --git a/Sample/Sample Scene.meta b/Sample/Sample Scene.meta new file mode 100644 index 0000000..0b057db --- /dev/null +++ b/Sample/Sample Scene.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fa5f3661e515443279db5c447c9715fa +folderAsset: yes +timeCreated: 1428517636 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Sample Scene/Sample Scene Terrain.asset b/Sample/Sample Scene/Sample Scene Terrain.asset new file mode 100644 index 0000000..aa00fee Binary files /dev/null and b/Sample/Sample Scene/Sample Scene Terrain.asset differ diff --git a/Sample/Sample Scene/Sample Scene Terrain.asset.meta b/Sample/Sample Scene/Sample Scene Terrain.asset.meta new file mode 100644 index 0000000..724b5f3 --- /dev/null +++ b/Sample/Sample Scene/Sample Scene Terrain.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 092332878ccd942fdb0e6d580d4b8a0d +timeCreated: 1428512643 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/Sample Scene/Sample Scene.unity b/Sample/Sample Scene/Sample Scene.unity new file mode 100644 index 0000000..7035c6a --- /dev/null +++ b/Sample/Sample Scene/Sample Scene.unity @@ -0,0 +1,1927 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 8 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 959726166} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 9 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &59515312 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 59515313} + m_Layer: 0 + m_Name: FEEL FREE TO DELETE SAMPLE FOLDER AFTER PLAYING AROUND WITH IT + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &59515313 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 59515312} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.66166365, y: 2.595211, z: -24.765379} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &224628660 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 224628662} + - component: {fileID: 224628661} + m_Layer: 0 + m_Name: Simple Baked Reflection Probe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!215 &224628661 +ReflectionProbe: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 224628660} + m_Enabled: 1 + serializedVersion: 2 + m_Type: 0 + m_Mode: 0 + m_RefreshMode: 0 + m_TimeSlicingMode: 0 + m_Resolution: 128 + m_UpdateFrequency: 0 + m_BoxSize: {x: 100, y: 30, z: 100} + m_BoxOffset: {x: 0, y: 0, z: 0} + m_NearClip: 0.3 + m_FarClip: 1000 + m_ShadowDistance: 100 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_IntensityMultiplier: 1 + m_BlendDistance: 1 + m_HDR: 1 + m_BoxProjection: 0 + m_RenderDynamicObjects: 0 + m_UseOcclusionCulling: 1 + m_Importance: 1 + m_CustomBakedTexture: {fileID: 0} +--- !u!4 &224628662 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 224628660} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &242807686 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 242807690} + - component: {fileID: 242807689} + - component: {fileID: 242807688} + - component: {fileID: 242807687} + m_Layer: 0 + m_Name: UV-Free Legacy Specular 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &242807687 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 242807686} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 2895a3d9263044157ac3ddc1e3958247, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &242807688 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 242807686} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &242807689 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 242807686} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &242807690 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 242807686} + m_LocalRotation: {x: -0, y: 0.7384551, z: -0, w: 0.67430264} + m_LocalPosition: {x: 1.900001, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &273178622 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 273178626} + - component: {fileID: 273178625} + - component: {fileID: 273178624} + - component: {fileID: 273178623} + m_Layer: 0 + m_Name: UV-Free Legacy Diffuse 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &273178623 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 273178622} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 635b97b57bdf94947859ff64f37b0400, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &273178624 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 273178622} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &273178625 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 273178622} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &273178626 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 273178622} + m_LocalRotation: {x: -0, y: 0.8143259, z: -0, w: 0.580408} + m_LocalPosition: {x: -0.099999666, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &486912837 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 486912838} + m_Layer: 0 + m_Name: Self-Space Triplanar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &486912838 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 486912837} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 4.55} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 714549695} + - {fileID: 1944533935} + - {fileID: 1365157712} + - {fileID: 1043411588} + - {fileID: 1648852442} + - {fileID: 724641112} + - {fileID: 1226097289} + - {fileID: 1428234604} + m_Father: {fileID: 875541003} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &714549694 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 714549695} + - component: {fileID: 714549698} + - component: {fileID: 714549697} + - component: {fileID: 714549696} + m_Layer: 0 + m_Name: UV-Free Standard Metallic PBR 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &714549695 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 714549694} + m_LocalRotation: {x: -0, y: 0.7571548, z: -0, w: 0.65323555} + m_LocalPosition: {x: -2.1, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &714549696 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 714549694} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c8fc21b599794734a8eb34b9c3be7cc7, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &714549697 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 714549694} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &714549698 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 714549694} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &724641111 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 724641112} + - component: {fileID: 724641115} + - component: {fileID: 724641114} + - component: {fileID: 724641113} + m_Layer: 0 + m_Name: UV-Free Legacy Specular 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &724641112 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 724641111} + m_LocalRotation: {x: -0, y: 0.7384551, z: -0, w: 0.67430264} + m_LocalPosition: {x: 1.900001, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &724641113 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 724641111} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c3d16f9ca23706b43a3a5d71f8d63318, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &724641114 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 724641111} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &724641115 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 724641111} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &741291847 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 741291852} + - component: {fileID: 741291851} + - component: {fileID: 741291850} + - component: {fileID: 741291849} + - component: {fileID: 741291848} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &741291848 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 741291847} + m_Enabled: 1 +--- !u!124 &741291849 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 741291847} + m_Enabled: 1 +--- !u!92 &741291850 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 741291847} + m_Enabled: 1 +--- !u!20 &741291851 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 741291847} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: 1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &741291852 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 741291847} + m_LocalRotation: {x: 0.40087125, y: 0.011536733, z: -0.0050480743, w: 0.9160479} + m_LocalPosition: {x: -2.5087123, y: 41.435593, z: -49.240368} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &875541002 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 875541003} + m_Layer: 0 + m_Name: Mesh Examples + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &875541003 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875541002} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 960830326} + - {fileID: 486912838} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &959726165 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 959726167} + - component: {fileID: 959726166} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &959726166 +Light: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 959726165} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &959726167 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 959726165} + m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &960830325 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 960830326} + m_Layer: 0 + m_Name: World-Space Triplanar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &960830326 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 960830325} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1449724149} + - {fileID: 1403998038} + - {fileID: 1955856117} + - {fileID: 1694631307} + - {fileID: 2127179987} + - {fileID: 242807690} + - {fileID: 273178626} + - {fileID: 1710743762} + m_Father: {fileID: 875541003} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1043411587 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1043411588} + - component: {fileID: 1043411591} + - component: {fileID: 1043411590} + - component: {fileID: 1043411589} + m_Layer: 0 + m_Name: UV-Free Standard Specular PBR 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1043411588 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1043411587} + m_LocalRotation: {x: -0, y: 0.81419784, z: -0, w: 0.5805877} + m_LocalPosition: {x: 3.9000015, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1043411589 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1043411587} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 6b2ad4544569ef846ab70431eba2569b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1043411590 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1043411587} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1043411591 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1043411587} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1226097288 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1226097289} + - component: {fileID: 1226097292} + - component: {fileID: 1226097291} + - component: {fileID: 1226097290} + m_Layer: 0 + m_Name: UV-Free Legacy Diffuse 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1226097289 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1226097288} + m_LocalRotation: {x: -0, y: 0.8143259, z: -0, w: 0.580408} + m_LocalPosition: {x: -0.099999666, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1226097290 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1226097288} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 7230e9e9cc209e64393d5fdc13774e63, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1226097291 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1226097288} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1226097292 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1226097288} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1365157711 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1365157712} + - component: {fileID: 1365157715} + - component: {fileID: 1365157714} + - component: {fileID: 1365157713} + m_Layer: 0 + m_Name: UV-Free Standard Specular PBR 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1365157712 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1365157711} + m_LocalRotation: {x: -0, y: 0.8113873, z: -0, w: 0.58450896} + m_LocalPosition: {x: 1.900001, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1365157713 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1365157711} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 61bfa1c65d2f03e459bb0988138b1a23, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1365157714 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1365157711} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1365157715 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1365157711} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1403998034 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1403998038} + - component: {fileID: 1403998037} + - component: {fileID: 1403998036} + - component: {fileID: 1403998035} + m_Layer: 0 + m_Name: UV-Free Standard Metallic PBR 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1403998035 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1403998034} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: fc4818471bf3f435bb89f723768f020e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1403998036 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1403998034} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1403998037 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1403998034} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1403998038 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1403998034} + m_LocalRotation: {x: -0, y: 0.8178155, z: -0, w: 0.5754806} + m_LocalPosition: {x: -0.09999943, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1428234603 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1428234604} + - component: {fileID: 1428234607} + - component: {fileID: 1428234606} + - component: {fileID: 1428234605} + m_Layer: 0 + m_Name: UV-Free Legacy Diffuse 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1428234604 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1428234603} + m_LocalRotation: {x: -0, y: 0.7357856, z: -0, w: 0.67721456} + m_LocalPosition: {x: -2.1, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1428234605 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1428234603} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 5877f5af11519fb489f2e6310233f41c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1428234606 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1428234603} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1428234607 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1428234603} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1449724145 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1449724149} + - component: {fileID: 1449724148} + - component: {fileID: 1449724147} + - component: {fileID: 1449724146} + m_Layer: 0 + m_Name: UV-Free Standard Metallic PBR 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1449724146 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449724145} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 803ee85a3bb8a4d0e9bcd173d370ec42, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1449724147 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449724145} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1449724148 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449724145} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1449724149 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1449724145} + m_LocalRotation: {x: -0, y: 0.7571548, z: -0, w: 0.65323555} + m_LocalPosition: {x: -2.1, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1648852441 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1648852442} + - component: {fileID: 1648852445} + - component: {fileID: 1648852444} + - component: {fileID: 1648852443} + m_Layer: 0 + m_Name: UV-Free Legacy Specular 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1648852442 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1648852441} + m_LocalRotation: {x: -0, y: 0.81224436, z: -0, w: 0.5833174} + m_LocalPosition: {x: 3.900002, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1648852443 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1648852441} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 6b2ad4544569ef846ab70431eba2569b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1648852444 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1648852441} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1648852445 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1648852441} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1694631303 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1694631307} + - component: {fileID: 1694631306} + - component: {fileID: 1694631305} + - component: {fileID: 1694631304} + m_Layer: 0 + m_Name: UV-Free Standard Specular PBR 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1694631304 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1694631303} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 93847dad6453a470e90f4ced9d9b6017, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1694631305 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1694631303} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1694631306 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1694631303} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1694631307 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1694631303} + m_LocalRotation: {x: -0, y: 0.81419784, z: -0, w: 0.5805877} + m_LocalPosition: {x: 3.9000015, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1710743758 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1710743762} + - component: {fileID: 1710743761} + - component: {fileID: 1710743760} + - component: {fileID: 1710743759} + m_Layer: 0 + m_Name: UV-Free Legacy Diffuse 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1710743759 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1710743758} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 99152f4607d0f40869e37eb0291be626, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1710743760 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1710743758} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1710743761 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1710743758} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1710743762 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1710743758} + m_LocalRotation: {x: -0, y: 0.7357856, z: -0, w: 0.67721456} + m_LocalPosition: {x: -2.1, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1813408630 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1813408633} + - component: {fileID: 1813408632} + - component: {fileID: 1813408631} + m_Layer: 0 + m_Name: Unity Built-In Standard Metallic Terrain + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 0 +--- !u!154 &1813408631 +TerrainCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1813408630} + m_Material: {fileID: 0} + m_Enabled: 1 + m_TerrainData: {fileID: 15600000, guid: 092332878ccd942fdb0e6d580d4b8a0d, type: 2} + m_EnableTreeColliders: 1 +--- !u!218 &1813408632 +Terrain: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1813408630} + m_Enabled: 1 + serializedVersion: 3 + m_TerrainData: {fileID: 15600000, guid: 092332878ccd942fdb0e6d580d4b8a0d, type: 2} + m_TreeDistance: 2000 + m_TreeBillboardDistance: 50 + m_TreeCrossFadeLength: 5 + m_TreeMaximumFullLODCount: 50 + m_DetailObjectDistance: 80 + m_DetailObjectDensity: 1 + m_HeightmapPixelError: 5 + m_SplatMapDistance: 1000 + m_HeightmapMaximumLOD: 0 + m_CastShadows: 1 + m_DrawHeightmap: 1 + m_DrawTreesAndFoliage: 1 + m_ReflectionProbeUsage: 1 + m_MaterialType: 0 + m_LegacySpecular: + serializedVersion: 2 + rgba: 4286545791 + m_LegacyShininess: 0.078125 + m_MaterialTemplate: {fileID: 0} + m_BakeLightProbesForTrees: 1 + m_ScaleInLightmap: 0.0512 + m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0} +--- !u!4 &1813408633 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1813408630} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -50, y: 0, z: -50} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1944533934 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1944533935} + - component: {fileID: 1944533938} + - component: {fileID: 1944533937} + - component: {fileID: 1944533936} + m_Layer: 0 + m_Name: UV-Free Standard Metallic PBR 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1944533935 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1944533934} + m_LocalRotation: {x: -0, y: 0.8178155, z: -0, w: 0.5754806} + m_LocalPosition: {x: -0.09999943, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 486912838} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1944533936 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1944533934} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: fabf30b7d1db889458cdf47eb9a8f7b8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1944533937 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1944533934} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1944533938 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1944533934} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1955856113 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1955856117} + - component: {fileID: 1955856116} + - component: {fileID: 1955856115} + - component: {fileID: 1955856114} + m_Layer: 0 + m_Name: UV-Free Standard Specular PBR 1-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1955856114 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1955856113} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: b7c926fd2b4dd46f4a0c78376f713fe2, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &1955856115 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1955856113} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1955856116 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1955856113} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1955856117 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1955856113} + m_LocalRotation: {x: -0, y: 0.8113873, z: -0, w: 0.58450896} + m_LocalPosition: {x: 1.900001, y: 14.51, z: -12.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2012656494 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2012656497} + - component: {fileID: 2012656496} + - component: {fileID: 2012656495} + m_Layer: 0 + m_Name: UV-Free Standard Metallic PBR Terrain + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!154 &2012656495 +TerrainCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2012656494} + m_Material: {fileID: 0} + m_Enabled: 1 + m_TerrainData: {fileID: 15600000, guid: 092332878ccd942fdb0e6d580d4b8a0d, type: 2} + m_EnableTreeColliders: 1 +--- !u!218 &2012656496 +Terrain: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2012656494} + m_Enabled: 1 + serializedVersion: 3 + m_TerrainData: {fileID: 15600000, guid: 092332878ccd942fdb0e6d580d4b8a0d, type: 2} + m_TreeDistance: 2000 + m_TreeBillboardDistance: 50 + m_TreeCrossFadeLength: 5 + m_TreeMaximumFullLODCount: 50 + m_DetailObjectDistance: 80 + m_DetailObjectDensity: 1 + m_HeightmapPixelError: 5 + m_SplatMapDistance: 1000 + m_HeightmapMaximumLOD: 0 + m_CastShadows: 1 + m_DrawHeightmap: 1 + m_DrawTreesAndFoliage: 1 + m_ReflectionProbeUsage: 1 + m_MaterialType: 3 + m_LegacySpecular: + serializedVersion: 2 + rgba: 4286545791 + m_LegacyShininess: 0.078125 + m_MaterialTemplate: {fileID: 2100000, guid: f9b7c8dedb7d34b9495aad4df6a88d58, type: 2} + m_BakeLightProbesForTrees: 1 + m_ScaleInLightmap: 0.0512 + m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0} +--- !u!4 &2012656497 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2012656494} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -50, y: 0, z: -50} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2127179983 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2127179987} + - component: {fileID: 2127179986} + - component: {fileID: 2127179985} + - component: {fileID: 2127179984} + m_Layer: 0 + m_Name: UV-Free Legacy Specular 3-Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &2127179984 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2127179983} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: b29dfaecd8d8e41ac835ecec7461b809, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &2127179985 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2127179983} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &2127179986 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2127179983} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &2127179987 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2127179983} + m_LocalRotation: {x: -0, y: 0.81224436, z: -0, w: 0.5833174} + m_LocalPosition: {x: 3.900002, y: 14.51, z: -10.709999} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 960830326} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Sample/Sample Scene/Sample Scene.unity.meta b/Sample/Sample Scene/Sample Scene.unity.meta new file mode 100644 index 0000000..5790c7a --- /dev/null +++ b/Sample/Sample Scene/Sample Scene.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 12d70985697d747e8bd92d58db0eddca +timeCreated: 1428479712 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders.meta b/Shaders.meta new file mode 100644 index 0000000..9633504 --- /dev/null +++ b/Shaders.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 892d8eaf2ef8e407b903f5981a6ad9ed +folderAsset: yes +DefaultImporter: + userData: diff --git a/Shaders/UVFree.meta b/Shaders/UVFree.meta new file mode 100644 index 0000000..85e37a6 --- /dev/null +++ b/Shaders/UVFree.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 830f0fef9c0bc4828951030430caa8da +folderAsset: yes +DefaultImporter: + userData: diff --git a/Shaders/UVFree/Legacy.meta b/Shaders/UVFree/Legacy.meta new file mode 100644 index 0000000..cdcb2c3 --- /dev/null +++ b/Shaders/UVFree/Legacy.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e4426c6072e474be9a1e34a7f354e266 +folderAsset: yes +timeCreated: 1427423794 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse Terrain.meta b/Shaders/UVFree/Legacy/Diffuse Terrain.meta new file mode 100644 index 0000000..d3b8d69 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse Terrain.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2a7e0de0f51e142fbbededd385182c49 +folderAsset: yes +timeCreated: 1427690126 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseAddPass.shader b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseAddPass.shader new file mode 100644 index 0000000..271aaa6 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseAddPass.shader @@ -0,0 +1,282 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/UVFree/Terrain/LegacyDiffuse-AddPass" { + Properties { + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + + _BumpScale ("Normal multiplier", Range(-2.0,2.0)) = 1.0 + + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.2 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + // used in fallback on old cards & base map + [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} + [HideInInspector] _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-99" + "IgnoreProjector"="True" + "RenderType" = "Opaque" + } + + CGPROGRAM + + #pragma surface surf Lambert decal:add vertex:SplatmapVert finalcolor:SplatmapFinalColor exclude_path:prepass exclude_path:deferred fullforwardshadows + #define TERRAIN_SURFACE_OUTPUT SurfaceOutput + + #pragma multi_compile_fog + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + #pragma multi_compile __ _UVFREE_RIM + + #define TERRAIN_SPLAT_ADDPASS + + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + + half _TexPower; + half _BumpScale; + float _UVScale; + half _Shininess; + + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + + struct Input + { + fixed3 powerNormal; + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + float3 worldPos; + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf(Input IN, inout SurfaceOutput o) + { + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0; + mixedDiffuse += splat_control.g * tex1; + mixedDiffuse += splat_control.b * tex2; + mixedDiffuse += splat_control.a * tex3; + + o.Albedo = max(fixed3(0.0, 0.0, 0.0),mixedDiffuse.rgb); + o.Alpha = weight; + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), normalize(o.Normal))); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + o.Specular = 0.0; + o.Gloss = 0.0; + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + Fallback "Nature/Terrain/Diffuse" +} diff --git a/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseAddPass.shader.meta b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseAddPass.shader.meta new file mode 100644 index 0000000..35797e7 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseAddPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bf6ac9ce50348432fb3afc0491a6cfb1 +timeCreated: 1427690208 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseFirstPass.shader b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseFirstPass.shader new file mode 100644 index 0000000..6e5f0a1 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseFirstPass.shader @@ -0,0 +1,279 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "UVFree/Terrain/LegacyDiffuse" { + Properties { + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + + _BumpScale ("Normal multiplier", Range(-2.0,2.0)) = 1.0 + + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.2 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + // used in fallback on old cards & base map + [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} + [HideInInspector] _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-99" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf Lambert vertex:SplatmapVert finalcolor:SplatmapFinalColor exclude_path:prepass exclude_path:deferred fullforwardshadows + #define TERRAIN_SURFACE_OUTPUT SurfaceOutput + + #pragma multi_compile_fog + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + #pragma multi_compile __ _UVFREE_RIM + + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + + half _TexPower; + half _BumpScale; + float _UVScale; + + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + + struct Input + { + fixed3 powerNormal; + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + float3 worldPos; + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf(Input IN, inout SurfaceOutput o) + { + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0; + mixedDiffuse += splat_control.g * tex1; + mixedDiffuse += splat_control.b * tex2; + mixedDiffuse += splat_control.a * tex3; + + o.Albedo = max(fixed3(0.0, 0.0, 0.0),mixedDiffuse.rgb); + o.Alpha = weight; + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), normalize(o.Normal))); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + o.Specular = 0.0; + o.Gloss = 0.0; + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + Dependency "AddPassShader" = "Hidden/UVFree/Terrain/LegacyDiffuse-AddPass" + + Fallback "Nature/Terrain/Diffuse" +} diff --git a/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseFirstPass.shader.meta b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseFirstPass.shader.meta new file mode 100644 index 0000000..5905d5e --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse Terrain/UVFreeLegacyTerrainDiffuseFirstPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 56432fa74ed7043e485d31f8dbb163ea +timeCreated: 1427690206 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse.meta b/Shaders/UVFree/Legacy/Diffuse.meta new file mode 100644 index 0000000..0358816 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fcd7eb091e66348e2a47c8ffa74aa202 +folderAsset: yes +timeCreated: 1427487642 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuse.shader b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuse.shader new file mode 100644 index 0000000..4c911e2 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuse.shader @@ -0,0 +1,251 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/Legacy/Diffuse" { + Properties { + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_BUMPED)] _UVFreeBumped ("Use Normal Mapping", Float) = 1.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_BUMPED + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf Lambert vertex:vert fullforwardshadows + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + + // Non-instanced properties + sampler2D _MainTex; + float4 _MainTex_ST; + half _BumpScale; + sampler2D _BumpMap; + sampler2D _EmissionMap; + half _TexPower; + fixed _VertexColorStrength; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + half _EmissionMultiplier; + half4 _EmissionColor; + + struct Input { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + void vert (inout appdata_full v, out Input o) { + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + + // biplanar, zero out y + worldNormal.y = 0.0001; + worldNormal = normalize(worldNormal); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + fixed3 nPowerNormal = normalize(o.powerNormal); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (nPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (nPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (nPowerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (nPowerNormal.x)) + + (-(worldNormal.y) * (nPowerNormal.y)) + + (-(worldNormal.z) * (nPowerNormal.z)) + ; + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + o.Albedo = max(fixed3(0.001, 0.001, 0.001), tex.rgb * tint.rgb); + o.Alpha = 1.0; + + // NORMAL + // + + #ifdef _UVFREE_BUMPED + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + o.Normal = normalize(bump); + #else + o.Normal = fixed3(0.0,0.0,1.0); + #endif + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + #ifdef _EMISSION + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + + o.Emission += + (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb + * _EmissionMultiplier; + + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" +} diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuse.shader.meta b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuse.shader.meta new file mode 100644 index 0000000..222a81e --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuse.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5894f1bc35e754b3bbeddf49d56c07b9 +timeCreated: 1427437622 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseNB.shader b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseNB.shader new file mode 100644 index 0000000..843d2a1 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseNB.shader @@ -0,0 +1,246 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/Legacy/Diffuse Non-Batching" { + Properties { + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_BUMPED)] _UVFreeBumped ("Use Normal Mapping", Float) = 1.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_BUMPED + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf Lambert vertex:vert fullforwardshadows + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + + // Non-instanced properties + sampler2D _MainTex; + float4 _MainTex_ST; + half _BumpScale; + sampler2D _BumpMap; + sampler2D _EmissionMap; + half _TexPower; + fixed _VertexColorStrength; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + half _EmissionMultiplier; + half4 _EmissionColor; + + struct Input { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + void vert (inout appdata_full v, out Input o) { + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + + // biplanar, zero out y + worldNormal.y = 0.0001; + worldNormal = normalize(worldNormal); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + fixed3 nPowerNormal = normalize(o.powerNormal); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (nPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (nPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (nPowerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (nPowerNormal.x)) + + (-(worldNormal.y) * (nPowerNormal.y)) + + (-(worldNormal.z) * (nPowerNormal.z)) + ; + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + o.Albedo = max(fixed3(0.001, 0.001, 0.001), tex.rgb * tint.rgb); + o.Alpha = 1.0; + + // NORMAL + // + + #ifdef _UVFREE_BUMPED + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + o.Normal = normalize(bump); + #else + o.Normal = fixed3(0.0,0.0,1.0); + #endif + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + #ifdef _EMISSION + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + + o.Emission += + (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb + * _EmissionMultiplier; + + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" +} diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseNB.shader.meta b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseNB.shader.meta new file mode 100644 index 0000000..6cffc47 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a4be1a756292d46af86d4106debdc11c +timeCreated: 1427437622 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottom.shader b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottom.shader new file mode 100644 index 0000000..31af8e8 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottom.shader @@ -0,0 +1,365 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/Legacy/DiffuseTopBottom" { + Properties { + // Triplanar space, for UI + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_UVFREE_BOTTOM)] _UVFreeBottom ("Use Bottom", Float) = 1.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + _TopMultiplier ("Top Multiplier (+Y)", Range(0.0,8.0)) = 1.0 + _BottomMultiplier ("Bottom Multiplier (-Y)", Range(0.0,8.0)) = 0.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + _TopColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _TopMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _TopBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopEmissionMultiplier("Emission Multiplier", Float) = 0.0 + _TopEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _TopEmissionMap("Emission", 2D) = "white" {} + + _BottomColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _BottomMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _BottomBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionMultiplier("Emission Multiplier", Float) = 0.0 + _BottomEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _BottomEmissionMap("Emission", 2D) = "white" {} + } + + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_BOTTOM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf Lambert vertex:vert fullforwardshadows + + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + // + + // MAIN + half _TexPower; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + sampler2D _EmissionMap; + fixed _VertexColorStrength; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + half _EmissionMultiplier; + half4 _EmissionColor; + + // TOP + sampler2D _TopMainTex; + sampler2D _TopBumpMap; + half _TopBumpScale; + sampler2D _TopEmissionMap; + fixed4 _TopColor; + half _TopMultiplier; + float4 _TopMainTex_ST; + half _TopEmissionMultiplier; + half4 _TopEmissionColor; + + // BOTTOM + #ifdef _UVFREE_BOTTOM + sampler2D _BottomMainTex; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + sampler2D _BottomEmissionMap; + half _BottomMultiplier; + float4 _BottomMainTex_ST; + fixed4 _BottomColor; + half _BottomEmissionMultiplier; + half4 _BottomEmissionColor; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + o.normal = v.normal; + fixed3 powerNormal = v.normal; + fixed3 weightedPowerNormal = v.normal; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #ifdef _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #ifdef _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.001,0.001,0.001), tex.rgb); + o.Alpha = 1.0; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #ifdef _UVFREE_BOTTOM + + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + fixed3 bump = + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ; + + o.Normal = normalize(bump); + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + + #ifdef _EMISSION + + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb * _TopEmissionMultiplier; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb * _BottomEmissionMultiplier; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" + +} diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottom.shader.meta b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottom.shader.meta new file mode 100644 index 0000000..91a9209 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottom.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d1a3a95d0a73549319ac7e069d6a9920 +timeCreated: 1427440876 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottomNB.shader b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottomNB.shader new file mode 100644 index 0000000..df99672 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottomNB.shader @@ -0,0 +1,360 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/Legacy/DiffuseTopBottom Non-Batching" { + Properties { + // Triplanar space, for UI + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_UVFREE_BOTTOM)] _UVFreeBottom ("Use Bottom", Float) = 1.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + _TopMultiplier ("Top Multiplier (+Y)", Range(0.0,8.0)) = 1.0 + _BottomMultiplier ("Bottom Multiplier (-Y)", Range(0.0,8.0)) = 0.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + _TopColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _TopMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _TopBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopEmissionMultiplier("Emission Multiplier", Float) = 0.0 + _TopEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _TopEmissionMap("Emission", 2D) = "white" {} + + _BottomColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _BottomMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _BottomBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionMultiplier("Emission Multiplier", Float) = 0.0 + _BottomEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _BottomEmissionMap("Emission", 2D) = "white" {} + } + + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_BOTTOM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf Lambert vertex:vert fullforwardshadows + + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + // + + // MAIN + half _TexPower; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + sampler2D _EmissionMap; + fixed _VertexColorStrength; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + half _EmissionMultiplier; + half4 _EmissionColor; + + // TOP + sampler2D _TopMainTex; + sampler2D _TopBumpMap; + half _TopBumpScale; + sampler2D _TopEmissionMap; + fixed4 _TopColor; + half _TopMultiplier; + float4 _TopMainTex_ST; + half _TopEmissionMultiplier; + half4 _TopEmissionColor; + + // BOTTOM + #ifdef _UVFREE_BOTTOM + sampler2D _BottomMainTex; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + sampler2D _BottomEmissionMap; + half _BottomMultiplier; + float4 _BottomMainTex_ST; + fixed4 _BottomColor; + half _BottomEmissionMultiplier; + half4 _BottomEmissionColor; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + o.normal = v.normal; + fixed3 powerNormal = v.normal; + fixed3 weightedPowerNormal = v.normal; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #ifdef _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #ifdef _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.001,0.001,0.001), tex.rgb); + o.Alpha = 1.0; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #ifdef _UVFREE_BOTTOM + + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + fixed3 bump = + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ; + + o.Normal = normalize(bump); + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + + #ifdef _EMISSION + + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb * _TopEmissionMultiplier; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb * _BottomEmissionMultiplier; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" + +} diff --git a/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottomNB.shader.meta b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottomNB.shader.meta new file mode 100644 index 0000000..a95d532 --- /dev/null +++ b/Shaders/UVFree/Legacy/Diffuse/UVFreeLegacyDiffuseTopBottomNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 10525174022874bcb92d307f06405733 +timeCreated: 1427440876 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Editor.meta b/Shaders/UVFree/Legacy/Editor.meta new file mode 100644 index 0000000..fdbf84a --- /dev/null +++ b/Shaders/UVFree/Legacy/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8a1fe37556a2d43f7ad021aafd019334 +folderAsset: yes +timeCreated: 1427487622 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Editor/UVFreeLegacyTopBottomGUI.cs b/Shaders/UVFree/Legacy/Editor/UVFreeLegacyTopBottomGUI.cs new file mode 100644 index 0000000..f6420c2 --- /dev/null +++ b/Shaders/UVFree/Legacy/Editor/UVFreeLegacyTopBottomGUI.cs @@ -0,0 +1,535 @@ +using System; +using UnityEngine; + +namespace UnityEditor +{ + internal class UVFreeLegacyTopBottomGUI : ShaderGUI + { + private enum WorkflowMode + { + Lambert, + BlinnPhong + } + + private static class Styles + { + public static GUIStyle optionsButton = "PaneOptions"; + + public static string emptyTootip = ""; + + public static GUIContent triplanarSpace = new GUIContent("Triplanar Space", "Whether the triplanar projection should be in local or global space"); + public static GUIContent texturePowerText = new GUIContent("Texture Power", "How strong textures on different axes are differentiated. 1 for smooth blending, 10+ for sharper contrasts"); + public static GUIContent topMultiplierText = new GUIContent("Top Strength", "How much of the mesh should be considered the top. Set to 0 to disable."); + public static GUIContent bottomMultiplierText = new GUIContent("Bottom Strength", "How much of the mesh should be considered the bottom. Set to 0 to disable."); + + public static GUIContent vertexColorStrengthText = new GUIContent("Vertex Color Strength", "0 for no vertex color (off), 1 for full vertex color tinting"); + + public static GUIContent baseColorLabel = new GUIContent("Diffuse", "Base Color (RGB) Gloss(A)"); + public static GUIContent baseColorText = new GUIContent("Diffuse (RGB) Gloss (A)", "Base Color (RGB) Gloss (A)"); + public static GUIContent baseColorTextMain = new GUIContent("Main", "Base Color (RGB) Gloss (A)"); + public static GUIContent baseColorTextTop = new GUIContent("Top (+Y)", "Base Color (RGB) Gloss (A)"); + public static GUIContent baseColorTextBottom = new GUIContent("Bottom (-Y)", "Base Color (RGB) Gloss (A)"); + + public static GUIContent normalLabel = new GUIContent("Normal", "Normal Map"); + public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map"); + public static GUIContent normalMapMain = new GUIContent("Main", "Normal Map"); + public static GUIContent normalMapTextTop = new GUIContent("Top (+Y)", "Normal Map"); + public static GUIContent normalMapTextBottom = new GUIContent("Bottom (-Y)", "Normal Map"); + + public static GUIContent specLabel = new GUIContent("Specular", "Specular"); + public static GUIContent specColorText = new GUIContent("Specular Color", "Specular Color"); + public static GUIContent shininessText = new GUIContent("Shininess", "Shininess"); + + public static GUIContent shininessTextMain = new GUIContent("Main", "Shininess"); + public static GUIContent shininessTextTop = new GUIContent("Top (+Y)", "Shininess"); + public static GUIContent shininessTextBottom = new GUIContent("Bottom (-Y)", "Shininess"); + + public static GUIContent rimLabel = new GUIContent("Rim Lighting", "Rim Lighting"); + + public static GUIContent rimText = new GUIContent("Rim", ""); + public static GUIContent rimColor = new GUIContent("Color", ""); + public static GUIContent rimPower = new GUIContent("Power", ""); + public static GUIContent rimMultiplier = new GUIContent("Strength", ""); + + public static GUIContent emissionLabel = new GUIContent("Emission", "Emission (RGB)"); + + public static GUIContent emissionText = new GUIContent("Main", "Emission (RGB)"); + public static GUIContent emissionTextTop = new GUIContent("Top (+Y)", "Emission (RGB)"); + public static GUIContent emissionTextBottom = new GUIContent("Bottom (-Y)", "Emission (RGB)"); + + + public static string textureScaleOffset = "Main Texture Scale/Offset"; + public static string textureScaleOffsetTop = "Top (+Y) Texture Scale/Offset"; + public static string textureScaleOffsetBottom = "Bottom (-Y) Texture Scale/Offset"; + + public static string whiteSpaceString = " "; + + public static readonly string[] spaceNames = Enum.GetNames (typeof(Space)); + + public static string advancedText = "Advanced Options"; + } + + private const float MIN_VALUE = 0.0f; + + MaterialProperty uvFreeLocal = null; + + // FRONT + + MaterialProperty texPower = null; + MaterialProperty topMultiplier = null; + + MaterialProperty bottomMultiplier = null; + MaterialProperty vertexColorStrength = null; + + // MAIN + + MaterialProperty color = null; + MaterialProperty mainTex = null; + + MaterialProperty bumpMap = null; + MaterialProperty bumpScale = null; + + MaterialProperty specColor = null; + MaterialProperty shininess = null; + + MaterialProperty rimColor = null; + MaterialProperty rimPower = null; + MaterialProperty rimMultiplier = null; + + // TOP + MaterialProperty topColor = null; + MaterialProperty topMainTex = null; + + MaterialProperty topBumpMap = null; + MaterialProperty topBumpScale = null; + + MaterialProperty topShininess = null; + + // BOTTOM + MaterialProperty bottomColor = null; + MaterialProperty bottomMainTex = null; + + MaterialProperty bottomBumpMap = null; + MaterialProperty bottomBumpScale = null; + + MaterialProperty bottomShininess = null; + + MaterialProperty emissionMap = null; + MaterialProperty emissionColor = null; + MaterialProperty emissionMultiplier = null; + + MaterialProperty topEmissionMap = null; + MaterialProperty topEmissionColor = null; + MaterialProperty topEmissionMultiplier = null; + + MaterialProperty bottomEmissionMap = null; + MaterialProperty bottomEmissionColor = null; + MaterialProperty bottomEmissionMultiplier = null; + + MaterialEditor m_MaterialEditor; + + WorkflowMode m_WorkflowMode = WorkflowMode.BlinnPhong; + + bool m_FirstTimeApply = true; + + public void FindProperties (MaterialProperty[] props) + { + texPower = FindProperty("_TexPower", props, false); + topMultiplier = FindProperty("_TopMultiplier", props, false); + bottomMultiplier = FindProperty("_BottomMultiplier", props, false); + + uvFreeLocal = FindProperty("_UVFreeLocal", props, false); + + vertexColorStrength = FindProperty("_VertexColorStrength", props, false); + + // MAIN + + color = FindProperty("_Color", props, false); + mainTex = FindProperty("_MainTex", props, false); + + bumpMap = FindProperty("_BumpMap", props, false); + bumpScale = FindProperty("_BumpScale", props, false); + + specColor = FindProperty("_SpecColor", props, false); + shininess = FindProperty("_Shininess", props, false); + + m_WorkflowMode = shininess == null ? WorkflowMode.Lambert : WorkflowMode.BlinnPhong; + + rimColor = FindProperty("_RimColor", props, false); + rimPower = FindProperty("_RimPower", props, false); + rimMultiplier = FindProperty("_RimMultiplier", props, false); + + emissionColor = FindProperty("_EmissionColor", props, false); + emissionMap = FindProperty("_EmissionMap", props, false); + emissionMultiplier = FindProperty("_EmissionMultiplier", props, false); + + // TOP + + topColor = FindProperty("_TopColor", props, false); + topMainTex = FindProperty("_TopMainTex", props, false); + + topBumpMap = FindProperty("_TopBumpMap", props, false); + topBumpScale = FindProperty("_TopBumpScale", props, false); + + topShininess = FindProperty("_TopShininess", props, false); + + topEmissionColor = FindProperty("_TopEmissionColor", props, false); + topEmissionMap = FindProperty("_TopEmissionMap", props, false); + topEmissionMultiplier = FindProperty("_TopEmissionMultiplier", props, false); + + // BOTTOM + + bottomColor = FindProperty("_BottomColor", props, false); + bottomMainTex = FindProperty("_BottomMainTex", props, false); + + bottomBumpMap = FindProperty("_BottomBumpMap", props, false); + bottomBumpScale = FindProperty("_BottomBumpScale", props, false); + + bottomShininess = FindProperty("_BottomShininess", props, false); + + bottomEmissionColor = FindProperty("_BottomEmissionColor", props, false); + bottomEmissionMap = FindProperty("_BottomEmissionMap", props, false); + bottomEmissionMultiplier = FindProperty("_BottomEmissionMultiplier", props, false); + + } + + public override void OnGUI (MaterialEditor materialEditor, MaterialProperty[] props) + { + FindProperties (props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly + m_MaterialEditor = materialEditor; + Material material = materialEditor.target as Material; + + ShaderPropertiesGUI (material); + + // Make sure that needed keywords are set up if we're switching some existing + // material to a standard shader. + if (m_FirstTimeApply) + { + SetMaterialKeywords (material, m_WorkflowMode); + m_FirstTimeApply = false; + } + } + + public void ShaderPropertiesGUI (Material material) + { + // Use default labelWidth + EditorGUIUtility.labelWidth = 0f; + + // Detect any changes to the material + EditorGUI.BeginChangeCheck(); + { + TriplanarSpacePopup(); + m_MaterialEditor.RangeProperty (texPower, Styles.texturePowerText.text); + + if (bottomMultiplier != null) + { + m_MaterialEditor.RangeProperty (topMultiplier, Styles.topMultiplierText.text); + m_MaterialEditor.RangeProperty (bottomMultiplier, Styles.bottomMultiplierText.text); + } + + if (vertexColorStrength != null) + { + m_MaterialEditor.RangeProperty (vertexColorStrength, Styles.vertexColorStrengthText.text); + } + + DoAlbedoArea(material); + EditorGUILayout.Space(); + + DoSpecularArea(material); + EditorGUILayout.Space(); + + DoBumpArea(material); + EditorGUILayout.Space(); + + DoEmissionArea(material); + EditorGUILayout.Space (); + + DoTextureScaleArea (material); + EditorGUILayout.Space(); + + DoRimArea(material); + + } + if (EditorGUI.EndChangeCheck()) + { + MaterialChanged(material, m_WorkflowMode); + } + + EditorGUILayout.Space(); + + GUILayout.Label(Styles.advancedText, EditorStyles.boldLabel); + m_MaterialEditor.RenderQueueField(); + m_MaterialEditor.EnableInstancingField(); + m_MaterialEditor.DoubleSidedGIField(); + + } + + void DoEmissionArea(Material material) + { + + GUILayout.Label(Styles.emissionLabel, EditorStyles.boldLabel); + + bool showEmissionColorAndGIControls = emissionMultiplier.floatValue > 0f; + bool showEmissionColorAndGIControlsTop = topEmissionMultiplier != null && topEmissionMultiplier.floatValue > 0f; + bool showEmissionColorAndGIControlsBottom = bottomEmissionMultiplier != null && bottomEmissionMultiplier.floatValue > 0f; + + // Do controls + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionText, emissionMap, showEmissionColorAndGIControls ? emissionColor : null, emissionMultiplier); + + if (topMultiplier != null && topMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionTextTop, topEmissionMap, showEmissionColorAndGIControlsTop ? topEmissionColor : null, topEmissionMultiplier); + } + + if (bottomMultiplier != null && bottomMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionTextBottom, bottomEmissionMap, showEmissionColorAndGIControlsBottom ? bottomEmissionColor : null, bottomEmissionMultiplier); + } + + // Dynamic Lightmapping mode + if (showEmissionColorAndGIControls) + { + bool shouldEmissionBeEnabled = showEmissionColorAndGIControls + || showEmissionColorAndGIControlsTop + || showEmissionColorAndGIControlsBottom; + + EditorGUI.BeginDisabledGroup(!shouldEmissionBeEnabled); + + m_MaterialEditor.LightmapEmissionProperty (MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1); + + EditorGUI.EndDisabledGroup(); + } + + } + + void DoRimArea(Material material) + { + GUILayout.Label (Styles.rimLabel, EditorStyles.boldLabel); + + m_MaterialEditor.RangeProperty (rimMultiplier, Styles.rimMultiplier.text); + if (rimMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.ColorProperty (rimColor, Styles.rimColor.text); + m_MaterialEditor.RangeProperty (rimPower, Styles.rimPower.text); + } + } + + void DoTextureScaleArea(Material material) + { + GUILayout.Label (Styles.textureScaleOffset, EditorStyles.boldLabel); + m_MaterialEditor.TextureScaleOffsetProperty (mainTex); + if (bottomMultiplier != null) { + // TOP + if (topMultiplier.floatValue > MIN_VALUE) { + EditorGUILayout.Space (); + GUILayout.Label (Styles.textureScaleOffsetTop, EditorStyles.boldLabel); + m_MaterialEditor.TextureScaleOffsetProperty (topMainTex); + } + // BOTTOM + if (bottomMultiplier.floatValue > MIN_VALUE) { + EditorGUILayout.Space (); + GUILayout.Label (Styles.textureScaleOffsetBottom, EditorStyles.boldLabel); + m_MaterialEditor.TextureScaleOffsetProperty (bottomMainTex); + } + } + } + + void DoBumpArea(Material material) + { + // bump + GUILayout.Label (Styles.normalLabel, EditorStyles.boldLabel); + if ((bottomMultiplier != null)) { + m_MaterialEditor.TexturePropertySingleLine (Styles.normalMapMain, bumpMap, bumpMap.textureValue != null ? bumpScale : null); + + if (topMultiplier.floatValue > MIN_VALUE) { + m_MaterialEditor.TexturePropertySingleLine (Styles.normalMapTextTop, topBumpMap, topBumpMap.textureValue != null ? topBumpScale : null); + } + if (bottomMultiplier.floatValue > MIN_VALUE) { + m_MaterialEditor.TexturePropertySingleLine (Styles.normalMapTextBottom, bottomBumpMap, bottomBumpMap.textureValue != null ? bottomBumpScale : null); + } + } + else + { + m_MaterialEditor.TexturePropertySingleLine (Styles.normalMapText, bumpMap, bumpMap.textureValue != null ? bumpScale : null); + } + } + + public override void AssignNewShaderToMaterial (Material material, Shader oldShader, Shader newShader) + { + base.AssignNewShaderToMaterial(material, oldShader, newShader); + } + + + void TriplanarSpacePopup() + { + EditorGUI.showMixedValue = uvFreeLocal.hasMixedValue; + + int space = (uvFreeLocal.floatValue == 0.0f) ? ((int) Space.World) : ((int) Space.Self); + + EditorGUI.BeginChangeCheck(); + space = EditorGUILayout.Popup(Styles.triplanarSpace.text, space, Styles.spaceNames); + + if (EditorGUI.EndChangeCheck()) + { + m_MaterialEditor.RegisterPropertyChangeUndo("Triplanar Space"); + uvFreeLocal.floatValue = (space == ((int) Space.World)) ? 0.0f : 1.0f; + } + + EditorGUI.showMixedValue = false; + + } + + void DoAlbedoArea(Material material) + { + GUILayout.Label(Styles.baseColorLabel, EditorStyles.boldLabel); + m_MaterialEditor.TexturePropertySingleLine(Styles.baseColorTextMain, mainTex, color); + + // top bottom + if (bottomMultiplier != null) + { + + if (topMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.baseColorTextTop, topMainTex, topColor); + } + if (bottomMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.baseColorTextBottom, bottomMainTex, bottomColor); + } + } + + + } + + void DoSpecularArea(Material material) + { + if (m_WorkflowMode == WorkflowMode.BlinnPhong) + { + GUILayout.Label(Styles.specLabel, EditorStyles.boldLabel); + + m_MaterialEditor.ColorProperty (specColor, Styles.specColorText.text); + + // top and bottom + if (bottomMultiplier != null) + { + EditorGUILayout.LabelField (Styles.shininessText.text); + EditorGUI.indentLevel++; + m_MaterialEditor.RangeProperty (shininess, Styles.shininessTextMain.text); + + if (topMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.RangeProperty (topShininess, Styles.shininessTextTop.text); + } + + if (bottomMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.RangeProperty (bottomShininess, Styles.shininessTextBottom.text); + } + EditorGUI.indentLevel--; + } + else // single tex + { + m_MaterialEditor.RangeProperty (shininess, Styles.shininessText.text); + } + + } + } + + static void SetMaterialKeywords(Material material, WorkflowMode workflowMode) + { + // Triplanar texture space + SetKeyword(material, "_UVFREE_LOCAL", material.GetFloat ("_UVFreeLocal") == (float) Space.Self); + + if (material.HasProperty("_BottomMultiplier")) + { + // whether the bottom is enabled + bool bottomEnabled = material.GetFloat ("_BottomMultiplier") > MIN_VALUE; + SetKeyword(material, "_UVFREE_BOTTOM", bottomEnabled); + + } + + // vertex color + SetKeyword(material, "_UVFREE_VERTEX_COLOR", material.GetFloat ("_VertexColorStrength") > MIN_VALUE); + + // Rim + SetKeyword(material, "_UVFREE_RIM", material.GetFloat ("_RimMultiplier") > MIN_VALUE); + + // Bump + + bool includeBump = Mathf.Abs (material.GetFloat ("_BumpScale")) > MIN_VALUE; + + if (material.HasProperty ("_BottomMultiplier")) + { + if (material.GetFloat ("_TopMultiplier") > MIN_VALUE) + { + includeBump = includeBump || (material.HasProperty ("_TopBumpScale") && Mathf.Abs (material.GetFloat ("_TopBumpScale")) > MIN_VALUE); + } + if (material.GetFloat ("_BottomMultiplier") > MIN_VALUE) + { + includeBump = includeBump || (material.HasProperty ("_BottomBumpScale") && Mathf.Abs (material.GetFloat ("_BottomBumpScale")) > MIN_VALUE); + } + + } + SetKeyword(material, "_UVFREE_BUMPED", includeBump); + + // emission + if (material.HasProperty ("_EmissionMultiplier")) + { + bool includeEmission = material.HasProperty ("_EmissionMultiplier") && material.GetFloat("_EmissionMultiplier") > MIN_VALUE; + + if (material.HasProperty("_TopMultiplier") + && material.GetFloat("_TopMultiplier") > MIN_VALUE) + { + includeEmission = includeEmission || (material.HasProperty ("_TopEmissionMultiplier") && material.GetFloat("_TopEmissionMultiplier") > MIN_VALUE); + } + if (material.HasProperty("_BottomMultiplier") + && material.GetFloat("_BottomMultiplier") > MIN_VALUE) + { + includeEmission = includeEmission || (material.HasProperty ("_BottomEmissionMultiplier") && material.GetFloat("_BottomEmissionMultiplier") > MIN_VALUE); + } + SetKeyword(material, "_EMISSION", includeEmission); + + } + } + + static void MaterialChanged(Material material, WorkflowMode workflowMode) + { + // clamp texture power + float tTexPower = material.GetFloat("_TexPower"); + if (tTexPower < 0.0f || tTexPower > 20.0f) + { + material.SetFloat ("_TexPower", Mathf.Clamp (tTexPower, 0.0f, 20.0f)); + } + + if (material.HasProperty ("_BottomMultiplier")) + { + // clamp top multiplier + float tTopMultiplier = material.GetFloat ("_TopMultiplier"); + if (tTopMultiplier < 0.0f || tTopMultiplier > 8.0f) + { + material.SetFloat ("_TopMultiplier", Mathf.Clamp (tTopMultiplier, 0.0f, 8.0f)); + } + + // clamp bottom multiplier + float tBottomMultiplier = material.GetFloat ("_BottomMultiplier"); + if (tBottomMultiplier < 0.0f || tBottomMultiplier > 8.0f) + { + material.SetFloat ("_BottomMultiplier", Mathf.Clamp (tBottomMultiplier, 0.0f, 8.0f)); + } + } + + SetMaterialKeywords(material, workflowMode); + } + + static void SetKeyword(Material m, string keyword, bool state) + { + if (state) + m.EnableKeyword (keyword); + else + m.DisableKeyword (keyword); + + //Debug.Log ("Keyword: " + keyword + ": " + state); + } + } + +} // namespace UnityEditor diff --git a/Shaders/UVFree/Legacy/Editor/UVFreeLegacyTopBottomGUI.cs.meta b/Shaders/UVFree/Legacy/Editor/UVFreeLegacyTopBottomGUI.cs.meta new file mode 100644 index 0000000..eb0a468 --- /dev/null +++ b/Shaders/UVFree/Legacy/Editor/UVFreeLegacyTopBottomGUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23b0be141d85c41d1984a4ecc7c4bc73 +timeCreated: 1427487587 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular Terrain.meta b/Shaders/UVFree/Legacy/Specular Terrain.meta new file mode 100644 index 0000000..34a8c47 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bc94b295348984a8fad0624cb7f3ca5f +folderAsset: yes +timeCreated: 1427690133 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-AddPass.shader b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-AddPass.shader new file mode 100644 index 0000000..f1398e7 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-AddPass.shader @@ -0,0 +1,284 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/UVFree/Terrain/LegacySpecular-AddPass" { + Properties { + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1.0) + _Shininess ("Shininess", Range (0.03, 1.0)) = 0.078125 + + _BumpScale ("Normal multiplier", Range(-2.0,2.0)) = 1.0 + + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.2 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + // used in fallback on old cards & base map + [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} + [HideInInspector] _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-99" + "IgnoreProjector"="True" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf BlinnPhong decal:add vertex:SplatmapVert finalcolor:SplatmapFinalColor exclude_path:prepass exclude_path:deferred fullforwardshadows + #define TERRAIN_SURFACE_OUTPUT SurfaceOutput + + #pragma multi_compile_fog + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + #pragma multi_compile __ _UVFREE_RIM + + #define TERRAIN_SPLAT_ADDPASS + + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + + half _TexPower; + half _BumpScale; + float _UVScale; + half _Shininess; + + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + + struct Input + { + fixed3 powerNormal; + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + float3 worldPos; + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf(Input IN, inout SurfaceOutput o) + { + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0; + mixedDiffuse += splat_control.g * tex1; + mixedDiffuse += splat_control.b * tex2; + mixedDiffuse += splat_control.a * tex3; + + o.Albedo = max(fixed3(0.0, 0.0, 0.0),mixedDiffuse.rgb); + o.Alpha = weight; + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + o.Gloss = mixedDiffuse.a; + o.Specular = _Shininess; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), normalize(o.Normal))); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + Fallback "Nature/Terrain/Diffuse" +} diff --git a/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-AddPass.shader.meta b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-AddPass.shader.meta new file mode 100644 index 0000000..5d3f906 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-AddPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2c97bcac03ae048a295cae3d2b30e7ee +timeCreated: 1427690219 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-Base.shader b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-Base.shader new file mode 100644 index 0000000..4219916 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-Base.shader @@ -0,0 +1,58 @@ +Shader "Hidden/UVFree/Terrain/LegacySpecular-Base" { + Properties { + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1.0) + _Shininess ("Shininess", Range (0.03, 1.0)) = 0.078125 + _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} + + // used in fallback on old cards + _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.2 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + } + + SubShader { + Tags { + "RenderType" = "Opaque" + "Queue" = "Geometry-100" + } + LOD 200 + + CGPROGRAM + #pragma surface surf BlinnPhong fullforwardshadows + #pragma multi_compile __ _UVFREE_RIM + + sampler2D _MainTex; + half _Shininess; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + + struct Input { + float2 uv_MainTex; + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + }; + + void surf (Input IN, inout SurfaceOutput o) { + fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); + o.Albedo = tex.rgb; + o.Gloss = tex.a; + o.Alpha = 1.0f; + o.Specular = _Shininess; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), normalize(o.Normal))); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + } + ENDCG + } + + FallBack "Legacy Shaders/Specular" +} diff --git a/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-Base.shader.meta b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-Base.shader.meta new file mode 100644 index 0000000..b43b3e2 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-Base.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a17ee4ff68d40434ca058ea4837e9f7f +timeCreated: 1427690220 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-FirstPass.shader b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-FirstPass.shader new file mode 100644 index 0000000..dddef3a --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-FirstPass.shader @@ -0,0 +1,285 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "UVFree/Terrain/LegacySpecular" { + Properties { + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1.0) + _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 + + _BumpScale ("Normal multiplier", Range(-2,2)) = 1 + + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0 + + _RimMultiplier ("Rim Multiplier", Range(0,8)) = 0.2 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1,1,1,1) + _RimPower ("Rim Power", Range(0,16)) = 5.0 + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + // used in fallback on old cards & base map + [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} + [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1) + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-100" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf BlinnPhong vertex:SplatmapVert finalcolor:SplatmapFinalColor exclude_path:prepass exclude_path:deferred fullforwardshadows + #define TERRAIN_SURFACE_OUTPUT SurfaceOutput + + #pragma multi_compile_fog + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + #pragma multi_compile __ _UVFREE_RIM + + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + + half _TexPower; + half _BumpScale; + float _UVScale; + half _Shininess; + + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + + struct Input + { + fixed3 powerNormal; + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + float3 worldPos; + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf(Input IN, inout SurfaceOutput o) + { + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0; + mixedDiffuse += splat_control.g * tex1; + mixedDiffuse += splat_control.b * tex2; + mixedDiffuse += splat_control.a * tex3; + + o.Albedo = max(fixed3(0.0, 0.0, 0.0),mixedDiffuse.rgb); + o.Alpha = weight; + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + o.Gloss = mixedDiffuse.a; + o.Specular = _Shininess; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), normalize(o.Normal))); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + Dependency "AddPassShader" = "Hidden/UVFree/Terrain/LegacySpecular-AddPass" + Dependency "BaseMapShader" = "Hidden/UVFree/Terrain/LegacySpecular-BasePass" + + Fallback "Nature/Terrain/Diffuse" +} diff --git a/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-FirstPass.shader.meta b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-FirstPass.shader.meta new file mode 100644 index 0000000..a84e23e --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular Terrain/UVFreeLegacyTerrainSpecular-FirstPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f12406e1126a444b79fee18cce430514 +timeCreated: 1427690221 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular.meta b/Shaders/UVFree/Legacy/Specular.meta new file mode 100644 index 0000000..0db856d --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fd8b0a5b73cb64781a2f795acf0704c4 +folderAsset: yes +timeCreated: 1427487636 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecular.shader b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecular.shader new file mode 100644 index 0000000..9f790a4 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecular.shader @@ -0,0 +1,251 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + + // Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/Legacy/Specular" { + Properties { + // Triplanar space, for UI + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_BUMPED)] _UVFreeBumped ("Use Normal Mapping", Float) = 1.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Shininess("Shininess", Range(0.01, 1.0)) = 0.078125 + _SpecColor("Specular", Color) = (0.5,0.5,0.5,1.0) + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_BUMPED + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf BlinnPhong vertex:vert fullforwardshadows + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + half _TexPower; + fixed _VertexColorStrength; + + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + sampler2D _EmissionMap; + half _EmissionMultiplier; + half4 _EmissionColor; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + float _Shininess; + + struct Input { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (o.powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (o.powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (o.powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (o.powerNormal.x)) + + (-(worldNormal.y) * (o.powerNormal.y)) + + (-(worldNormal.z) * (o.powerNormal.z)) + ; + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + o.Albedo = max(fixed3(0.001,0.001,0.001), tex.rgb * tint.rgb); + o.Alpha = 1.0; + + // NORMAL + // + + #ifdef _UVFREE_BUMPED + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + o.Normal = normalize(bump); + #else + o.Normal = fixed3(0.0,0.0,1.0); + #endif + + // SPECULAR/GLOSS + // + o.Gloss = tex.a * _SpecColor.a; + o.Specular = _Shininess; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + #ifdef _EMISSION + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + o.Emission += + (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb + * _EmissionMultiplier; + + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" +} diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecular.shader.meta b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecular.shader.meta new file mode 100644 index 0000000..6d6ee08 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecular.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ab53f541c10484ef2b031dc958e26032 +timeCreated: 1427423850 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularNB.shader b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularNB.shader new file mode 100644 index 0000000..241e64b --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularNB.shader @@ -0,0 +1,252 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/Legacy/Specular Non-Batching" { + Properties { + // Triplanar space, for UI + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_BUMPED)] _UVFreeBumped ("Use Normal Mapping", Float) = 1.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Shininess("Shininess", Range(0.01, 1.0)) = 0.078125 + _SpecColor("Specular", Color) = (0.5,0.5,0.5,1.0) + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0,16.0)) = 5.0 + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_BUMPED + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf BlinnPhong vertex:vert fullforwardshadows + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + half _TexPower; + fixed _VertexColorStrength; + + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + sampler2D _EmissionMap; + half _EmissionMultiplier; + half4 _EmissionColor; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + float _Shininess; + + struct Input { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (o.powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (o.powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (o.powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (o.powerNormal.x)) + + (-(worldNormal.y) * (o.powerNormal.y)) + + (-(worldNormal.z) * (o.powerNormal.z)) + ; + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + o.Albedo = max(fixed3(0.001,0.001,0.001), tex.rgb * tint.rgb); + o.Alpha = 1.0; + + // NORMAL + // + + #ifdef _UVFREE_BUMPED + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + o.Normal = normalize(bump); + #else + o.Normal = fixed3(0.0,0.0,1.0); + #endif + + // SPECULAR/GLOSS + // + o.Gloss = tex.a * _SpecColor.a; + o.Specular = _Shininess; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + #ifdef _EMISSION + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + o.Emission += + (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb + * _EmissionMultiplier; + + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" +} diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularNB.shader.meta b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularNB.shader.meta new file mode 100644 index 0000000..e21e5a1 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6be38e856357c4f12b953c2addabeddb +timeCreated: 1427423850 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottom.shader b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottom.shader new file mode 100644 index 0000000..5afea5c --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottom.shader @@ -0,0 +1,402 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/Legacy/SpecularTopBottom" { + Properties { + // Triplanar space, for UI + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_UVFREE_BOTTOM)] _UVFreeBottom ("Use Bottom", Float) = 1.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + _TopMultiplier ("Top Multiplier (+Y)", Range(0.0,8.0)) = 1.0 + _BottomMultiplier ("Bottom Multiplier (-Y)", Range(0.0,8.0)) = 0.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Shininess("Shininess", Range(0.01, 1.0)) = 0.078125 + _SpecColor("Specular", Color) = (0.5,0.5,0.5,1.0) + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0, 16.0)) = 5.0 + + _TopColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _TopMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _TopBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopShininess("Shininess", Range(0.01, 1.0)) = 0.078125 + + _TopEmissionMultiplier("Emission Multiplier", Float) = 0.0 + _TopEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _TopEmissionMap("Emission", 2D) = "white" {} + + _BottomColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _BottomMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _BottomBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionMultiplier("Emission Multiplier", Float) = 0 + _BottomEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _BottomEmissionMap("Emission", 2D) = "white" {} + + _BottomShininess("Shininess", Range(0.01, 1.0)) = 0.078125 + + } + + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_BOTTOM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf BlinnPhong vertex:vert fullforwardshadows + + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + // + half _TexPower; + + // MAIN + fixed _VertexColorStrength; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + sampler2D _EmissionMap; + half _EmissionMultiplier; + half4 _EmissionColor; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + float _Shininess; + + // TOP + half _TopMultiplier; + fixed4 _TopColor; + sampler2D _TopMainTex; + float4 _TopMainTex_ST; + sampler2D _TopBumpMap; + half _TopBumpScale; + sampler2D _TopEmissionMap; + half _TopEmissionMultiplier; + half4 _TopEmissionColor; + float _TopShininess; + + // BOTTOM + #ifdef _UVFREE_BOTTOM + half _BottomMultiplier; + fixed4 _BottomColor; + sampler2D _BottomMainTex; + float4 _BottomMainTex_ST; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + sampler2D _BottomEmissionMap; + half _BottomEmissionMultiplier; + half4 _BottomEmissionColor; + float _BottomShininess; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + o.normal = v.normal; + fixed3 powerNormal = v.normal; + fixed3 weightedPowerNormal = v.normal; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #ifdef _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #ifdef _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.001,0.001,0.001), tex.rgb); + o.Alpha = 1.0; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #ifdef _UVFREE_BOTTOM + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + fixed3 bump = + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ; + + o.Normal = normalize(bump); + + // SHININESS/GLOSS + // + o.Gloss = tex.a; + + float sgY = _Shininess; + float sgTop = _TopShininess; + + #ifdef _UVFREE_BOTTOM + float sgBottom = _BottomShininess; + #endif + + sgTop = lerp(sgY, sgTop, topLerp); + + #ifdef _UVFREE_BOTTOM + sgBottom = lerp(sgY, sgBottom, bottomLerp); + sgTop = lerp(sgBottom, sgTop, topBottomLerp); + #else + sgTop = lerp(sgY, sgTop, topBottomLerp); + #endif + + float sg = + lerp(sgY * IN.powerNormal.x, sgTop * weightedPowerNormal.x, yLerp) + + lerp(sgY * IN.powerNormal.y, sgTop * weightedPowerNormal.y, yLerp) + + lerp(sgY * IN.powerNormal.z, sgTop * weightedPowerNormal.z, yLerp) + ; + + o.Gloss = tex.a * _SpecColor.a; + o.Specular = sg; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + + #ifdef _EMISSION + + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb * _TopEmissionMultiplier; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb * _BottomEmissionMultiplier; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" + +} diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottom.shader.meta b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottom.shader.meta new file mode 100644 index 0000000..eab0885 --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottom.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 68f7771eeeaa54d69b83a18f2b59ba8d +timeCreated: 1427440874 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottomNB.shader b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottomNB.shader new file mode 100644 index 0000000..121875c --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottomNB.shader @@ -0,0 +1,397 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/Legacy/SpecularTopBottom Non-Batching" { + Properties { + // Triplanar space, for UI + [Toggle(_UVFREE_LOCAL)] _UVFreeLocal ("Use Local Space (instead of Global)", Float) = 0.0 + [Toggle(_UVFREE_VERTEX_COLOR)] _UVFreeVertexColor ("Use Vertex Color", Float) = 0.0 + [Toggle(_UVFREE_RIM)] _UVFreeRim ("Use Rim Lighting", Float) = 0.0 + [Toggle(_UVFREE_BOTTOM)] _UVFreeBottom ("Use Bottom", Float) = 1.0 + [Toggle(_EMISSION)] _Emission ("Use Emission", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0,20.0)) = 10.0 + _TopMultiplier ("Top Multiplier (+Y)", Range(0.0,8.0)) = 1.0 + _BottomMultiplier ("Bottom Multiplier (-Y)", Range(0.0,8.0)) = 0.0 + + _Color ("Tint", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 0.0 + + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Shininess("Shininess", Range(0.01, 1.0)) = 0.078125 + _SpecColor("Specular", Color) = (0.5,0.5,0.5,1.0) + + _EmissionMultiplier("Emission Multiplier", Float) = 0.0 + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _RimMultiplier ("Rim Multiplier", Range(0.0,8.0)) = 0.0 + _RimColor ("Rim Color (RGB) Strength (A)", Color) = (1.0,1.0,1.0,1.0) + _RimPower ("Rim Power", Range(0.0, 16.0)) = 5.0 + + _TopColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _TopMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _TopBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopShininess("Shininess", Range(0.01, 1.0)) = 0.078125 + + _TopEmissionMultiplier("Emission Multiplier", Float) = 0.0 + _TopEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _TopEmissionMap("Emission", 2D) = "white" {} + + _BottomColor ("Tint", Color) = (1.0,1.0,1.0,1.0) + _BottomMainTex ("Base Color (RGB) Gloss (A)", 2D) = "white" {} + + _BottomBumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionMultiplier("Emission Multiplier", Float) = 0 + _BottomEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _BottomEmissionMap("Emission", 2D) = "white" {} + + _BottomShininess("Shininess", Range(0.01, 1.0)) = 0.078125 + + } + + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + + LOD 300 + + CGPROGRAM + + #pragma target 3.0 + + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _UVFREE_RIM + #pragma shader_feature _UVFREE_BOTTOM + #pragma shader_feature _UVFREE_VERTEX_COLOR + #pragma shader_feature _EMISSION + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + #pragma surface surf BlinnPhong vertex:vert fullforwardshadows + + #include "UnityCG.cginc" + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + // + half _TexPower; + + // MAIN + fixed _VertexColorStrength; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + sampler2D _EmissionMap; + half _EmissionMultiplier; + half4 _EmissionColor; + fixed4 _RimColor; + half _RimPower; + half _RimMultiplier; + float _Shininess; + + // TOP + half _TopMultiplier; + fixed4 _TopColor; + sampler2D _TopMainTex; + float4 _TopMainTex_ST; + sampler2D _TopBumpMap; + half _TopBumpScale; + sampler2D _TopEmissionMap; + half _TopEmissionMultiplier; + half4 _TopEmissionColor; + float _TopShininess; + + // BOTTOM + #ifdef _UVFREE_BOTTOM + half _BottomMultiplier; + fixed4 _BottomColor; + sampler2D _BottomMainTex; + float4 _BottomMainTex_ST; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + sampler2D _BottomEmissionMap; + half _BottomEmissionMultiplier; + half4 _BottomEmissionColor; + float _BottomShininess; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + + float3 worldPos; + + #ifdef _UVFREE_RIM + fixed3 viewDir; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + o.normal = v.normal; + fixed3 powerNormal = v.normal; + fixed3 weightedPowerNormal = v.normal; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutput o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #ifdef _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #ifdef _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #ifdef _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.001,0.001,0.001), tex.rgb); + o.Alpha = 1.0; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #ifdef _UVFREE_BOTTOM + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + fixed3 bump = + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ; + + o.Normal = normalize(bump); + + // SHININESS/GLOSS + // + o.Gloss = tex.a; + + float sgY = _Shininess; + float sgTop = _TopShininess; + + #ifdef _UVFREE_BOTTOM + float sgBottom = _BottomShininess; + #endif + + sgTop = lerp(sgY, sgTop, topLerp); + + #ifdef _UVFREE_BOTTOM + sgBottom = lerp(sgY, sgBottom, bottomLerp); + sgTop = lerp(sgBottom, sgTop, topBottomLerp); + #else + sgTop = lerp(sgY, sgTop, topBottomLerp); + #endif + + float sg = + lerp(sgY * IN.powerNormal.x, sgTop * weightedPowerNormal.x, yLerp) + + lerp(sgY * IN.powerNormal.y, sgTop * weightedPowerNormal.y, yLerp) + + lerp(sgY * IN.powerNormal.z, sgTop * weightedPowerNormal.z, yLerp) + ; + + o.Gloss = tex.a * _SpecColor.a; + o.Specular = sg; + + // RIM + // + #ifdef _UVFREE_RIM + half rimStrength = 1.0 - max(0.0, dot(normalize(IN.viewDir), o.Normal)); + o.Emission = _RimMultiplier * _RimColor.rgb * pow(rimStrength, _RimPower) * _RimColor.a; + #endif + + // EMISSION + // + + #ifdef _EMISSION + + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb * _EmissionMultiplier; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb * _TopEmissionMultiplier; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb * _BottomEmissionMultiplier; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreeLegacyTopBottomGUI" + +} diff --git a/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottomNB.shader.meta b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottomNB.shader.meta new file mode 100644 index 0000000..9733b6d --- /dev/null +++ b/Shaders/UVFree/Legacy/Specular/UVFreeLegacySpecularTopBottomNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 935d64de9b72849c9aa20b71c7163804 +timeCreated: 1427440874 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR.meta b/Shaders/UVFree/Standard PBR.meta new file mode 100644 index 0000000..bf3cee3 --- /dev/null +++ b/Shaders/UVFree/Standard PBR.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8861925d8cda348cba47e6a219c7c13e +folderAsset: yes +timeCreated: 1426651302 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Editor.meta b/Shaders/UVFree/Standard PBR/Editor.meta new file mode 100644 index 0000000..cdf1da6 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3f4ff884353af49f3ac1596796b3a9d7 +folderAsset: yes +timeCreated: 1426710566 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderGUI.cs b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderGUI.cs new file mode 100644 index 0000000..e93818b --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderGUI.cs @@ -0,0 +1,355 @@ +using System; +using UnityEngine; + +namespace UnityEditor +{ + internal class UVFreePBRShaderGUI : ShaderGUI + { + private enum WorkflowMode + { + Specular, + Metallic, + Dielectric + } + + private static class Styles + { + public static GUIStyle optionsButton = "PaneOptions"; + + public static string emptyTootip = ""; + public static GUIContent triplanarSpace = new GUIContent("Triplanar Space", "Whether the triplanar projection should be in local or global space"); + public static GUIContent texturePowerText = new GUIContent("Texture Power", "How strong textures on different axes are differentiated. 1 for smooth blending, 10+ for sharper contrasts"); + public static GUIContent vertexColorStrengthText = new GUIContent("Vertex Color Strength", "0 for no vertex color (off), 1 for full vertex color tinting"); + + public static GUIContent albedoText = new GUIContent("Albedo", "Albedo (RGB) and Transparency (A)"); + public static GUIContent alphaCutoffText = new GUIContent("Alpha Cutoff", "Threshold for alpha cutoff"); + public static GUIContent specularMapText = new GUIContent("Specular", "Specular (RGB) and Smoothness (A)"); + public static GUIContent metallicMapText = new GUIContent("Metallic", "Metallic (R) and Smoothness (A)"); + public static GUIContent smoothnessText = new GUIContent("Smoothness", ""); + public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map"); + public static GUIContent heightMapText = new GUIContent("Height Map", "Height Map (G)"); + public static GUIContent occlusionText = new GUIContent("Occlusion", "Occlusion (G)"); + public static GUIContent emissionText = new GUIContent("Emission", "Emission (RGB)"); + public static GUIContent detailMaskText = new GUIContent("Detail Mask", "Mask for Secondary Maps (A)"); + public static GUIContent detailAlbedoText = new GUIContent("Detail Albedo x2", "Albedo (RGB) multiplied by 2"); + public static GUIContent detailNormalMapText = new GUIContent("Normal Map", "Normal Map"); + + public static string whiteSpaceString = " "; + public static string primaryMapsText = "Main Maps"; + public static string secondaryMapsText = "Secondary Maps"; + public static GUIContent emissiveWarning = new GUIContent ("Emissive value is animated but the material has not been configured to support emissive. Please make sure the material itself has some amount of emissive."); + public static GUIContent emissiveColorWarning = new GUIContent ("Ensure emissive color is non-black for emission to have effect."); + public static readonly string[] spaceNames = Enum.GetNames (typeof(Space)); + public static string advancedText = "Advanced Options"; + + } + MaterialProperty vertexColorStrength = null; + MaterialProperty albedoMap = null; + MaterialProperty albedoColor = null; + MaterialProperty specularMap = null; + MaterialProperty specularColor = null; + MaterialProperty metallicMap = null; + MaterialProperty metallic = null; + MaterialProperty smoothness = null; + MaterialProperty bumpScale = null; + MaterialProperty bumpMap = null; + MaterialProperty occlusionStrength = null; + MaterialProperty occlusionMap = null; + MaterialProperty heigtMapScale = null; + MaterialProperty heightMap = null; + MaterialProperty emissionScaleUI = null; + MaterialProperty emissionColorUI = null; + MaterialProperty emissionColorForRendering = null; + MaterialProperty emissionMap = null; + MaterialProperty detailMask = null; + MaterialProperty detailAlbedoMap = null; + MaterialProperty detailNormalMapScale = null; + MaterialProperty detailNormalMap = null; + MaterialProperty texturePower = null; + MaterialProperty triplanarSpace = null; + MaterialEditor m_MaterialEditor; + WorkflowMode m_WorkflowMode = WorkflowMode.Specular; + + bool m_FirstTimeApply = true; + + public void FindProperties (MaterialProperty[] props) + { + triplanarSpace = FindProperty("_TriplanarSpace", props, false); + texturePower = FindProperty("_TexPower", props, false); + + vertexColorStrength = FindProperty("_VertexColorStrength", props, false); + + albedoMap = FindProperty ("_MainTex", props); + albedoColor = FindProperty ("_Color", props); + specularMap = FindProperty ("_SpecGlossMap", props, false); + specularColor = FindProperty ("_SpecColor", props, false); + metallicMap = FindProperty ("_MetallicGlossMap", props, false); + metallic = FindProperty ("_Metallic", props, false); + + if (specularMap != null && specularColor != null) + m_WorkflowMode = WorkflowMode.Specular; + else if (metallicMap != null && metallic != null) + m_WorkflowMode = WorkflowMode.Metallic; + else + m_WorkflowMode = WorkflowMode.Dielectric; + + smoothness = FindProperty ("_Glossiness", props); + bumpScale = FindProperty ("_BumpScale", props); + bumpMap = FindProperty ("_BumpMap", props); + heigtMapScale = FindProperty ("_Parallax", props); + heightMap = FindProperty("_ParallaxMap", props); + occlusionStrength = FindProperty ("_OcclusionStrength", props); + occlusionMap = FindProperty ("_OcclusionMap", props); + emissionScaleUI = FindProperty ("_EmissionScaleUI", props); + emissionColorUI = FindProperty ("_EmissionColorUI", props); + emissionColorForRendering = FindProperty ("_EmissionColor", props); + emissionMap = FindProperty ("_EmissionMap", props); + detailMask = FindProperty ("_DetailMask", props); + detailAlbedoMap = FindProperty ("_DetailAlbedoMap", props); + detailNormalMapScale = FindProperty ("_DetailNormalMapScale", props); + detailNormalMap = FindProperty ("_DetailNormalMap", props); + } + + public override void OnGUI (MaterialEditor materialEditor, MaterialProperty[] props) + { + FindProperties (props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly + m_MaterialEditor = materialEditor; + Material material = materialEditor.target as Material; + + ShaderPropertiesGUI (material); + + // Make sure that needed keywords are set up if we're switching some existing + // material to a standard shader. + if (m_FirstTimeApply) + { + SetMaterialKeywords (material, m_WorkflowMode); + m_FirstTimeApply = false; + } + } + + public void ShaderPropertiesGUI (Material material) + { + // Use default labelWidth + EditorGUIUtility.labelWidth = 0f; + + // Detect any changes to the material + EditorGUI.BeginChangeCheck(); + { + TriplanarSpacePopup(); + m_MaterialEditor.RangeProperty (texturePower, "Texture Power"); + + if (vertexColorStrength != null) + { + m_MaterialEditor.RangeProperty (vertexColorStrength, Styles.vertexColorStrengthText.text); + } + + // Primary properties + GUILayout.Label (Styles.primaryMapsText, EditorStyles.boldLabel); + DoAlbedoArea(material); + DoSpecularMetallicArea(); + m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMap, bumpMap.textureValue != null ? bumpScale : null); + m_MaterialEditor.TexturePropertySingleLine(Styles.heightMapText, heightMap, heightMap.textureValue != null ? heigtMapScale : null); + m_MaterialEditor.TexturePropertySingleLine(Styles.occlusionText, occlusionMap, occlusionMap.textureValue != null ? occlusionStrength : null); + DoEmissionArea(material); + m_MaterialEditor.TexturePropertySingleLine(Styles.detailMaskText, detailMask); + EditorGUI.BeginChangeCheck(); + m_MaterialEditor.TextureScaleOffsetProperty(albedoMap); + if (EditorGUI.EndChangeCheck()) + emissionMap.textureScaleAndOffset = albedoMap.textureScaleAndOffset; // Apply the main texture scale and offset to the emission texture as well, for Enlighten's sake + + EditorGUILayout.Space(); + + // Secondary properties + GUILayout.Label(Styles.secondaryMapsText, EditorStyles.boldLabel); + m_MaterialEditor.TexturePropertySingleLine(Styles.detailAlbedoText, detailAlbedoMap); + m_MaterialEditor.TexturePropertySingleLine(Styles.detailNormalMapText, detailNormalMap, detailNormalMapScale); + m_MaterialEditor.TextureScaleOffsetProperty(detailAlbedoMap); + } + if (EditorGUI.EndChangeCheck()) + { + MaterialChanged(material, m_WorkflowMode); + } + EditorGUILayout.Space(); + + GUILayout.Label(Styles.advancedText, EditorStyles.boldLabel); + m_MaterialEditor.RenderQueueField(); + m_MaterialEditor.EnableInstancingField(); + m_MaterialEditor.DoubleSidedGIField(); + } + + //internal + void DetermineWorkflow(MaterialProperty[] props) + { + if (FindProperty("_SpecGlossMap", props, false) != null && FindProperty("_SpecColor", props, false) != null) + m_WorkflowMode = WorkflowMode.Specular; + else if (FindProperty("_MetallicGlossMap", props, false) != null && FindProperty("_Metallic", props, false) != null) + m_WorkflowMode = WorkflowMode.Metallic; + else + m_WorkflowMode = WorkflowMode.Dielectric; + } + + public override void AssignNewShaderToMaterial (Material material, Shader oldShader, Shader newShader) + { + base.AssignNewShaderToMaterial(material, oldShader, newShader); + + return; + } + + void TriplanarSpacePopup() + { + EditorGUI.showMixedValue = triplanarSpace.hasMixedValue; + var space = (Space)triplanarSpace.floatValue; + + EditorGUI.BeginChangeCheck(); + space = (Space)EditorGUILayout.Popup(Styles.triplanarSpace.text, (int)space, Styles.spaceNames); + + if (EditorGUI.EndChangeCheck()) + { + m_MaterialEditor.RegisterPropertyChangeUndo("Triplanar Space"); + triplanarSpace.floatValue = (float)space; + } + + EditorGUI.showMixedValue = false; + } + + void DoAlbedoArea(Material material) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.albedoText, albedoMap, albedoColor); + } + + void DoEmissionArea(Material material) + { + bool showEmissionColorAndGIControls = emissionScaleUI.floatValue > 0f; + bool hadEmissionTexture = emissionMap.textureValue != null; + + // Do controls + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionText, emissionMap, showEmissionColorAndGIControls ? emissionColorUI : null, emissionScaleUI); + + // Set default emissionScaleUI if texture was assigned + if (emissionMap.textureValue != null && !hadEmissionTexture && emissionScaleUI.floatValue <= 0f) + emissionScaleUI.floatValue = 1.0f; + + // Dynamic Lightmapping mode + if (showEmissionColorAndGIControls) + { + bool shouldEmissionBeEnabled = ShouldEmissionBeEnabled(EvalFinalEmissionColor(material)); + EditorGUI.BeginDisabledGroup(!shouldEmissionBeEnabled); + + m_MaterialEditor.LightmapEmissionProperty (MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1); + + EditorGUI.EndDisabledGroup(); + } + + if (!HasValidEmissiveKeyword(material)) + { + EditorGUILayout.HelpBox(Styles.emissiveWarning.text, MessageType.Warning); + } + + } + + void DoSpecularMetallicArea() + { + if (m_WorkflowMode == WorkflowMode.Specular) + { + if (specularMap.textureValue == null) + m_MaterialEditor.TexturePropertyTwoLines(Styles.specularMapText, specularMap, specularColor, Styles.smoothnessText, smoothness); + else + m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapText, specularMap); + + } + else if (m_WorkflowMode == WorkflowMode.Metallic) + { + if (metallicMap.textureValue == null) + m_MaterialEditor.TexturePropertyTwoLines(Styles.metallicMapText, metallicMap, metallic, Styles.smoothnessText, smoothness); + else + m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapText, metallicMap); + } + } + + // Calculate final HDR _EmissionColor (gamma space) from _EmissionColorUI (LDR, gamma) & _EmissionScaleUI (gamma) + static Color EvalFinalEmissionColor(Material material) + { + return material.GetColor("_EmissionColorUI") * material.GetFloat("_EmissionScaleUI"); + } + + static bool ShouldEmissionBeEnabled (Color color) + { + return color.grayscale > (0.1f / 255.0f); + } + + static void SetMaterialKeywords(Material material, WorkflowMode workflowMode) + { + // Note: keywords must be based on Material value not on MaterialProperty due to multi-edit & material animation + // (MaterialProperty value might come from renderer material property block) + if (workflowMode == WorkflowMode.Specular) + SetKeyword (material, "_SPECGLOSSMAP", material.GetTexture ("_SpecGlossMap")); + else if (workflowMode == WorkflowMode.Metallic) + SetKeyword (material, "_METALLICGLOSSMAP", material.GetTexture ("_MetallicGlossMap")); + + SetKeyword (material, "_PARALLAXMAP", material.GetTexture ("_ParallaxMap")); + SetKeyword (material, "_DETAIL", material.GetTexture ("_DetailAlbedoMap") || material.GetTexture ("_DetailNormalMap")); + SetKeyword (material, "_OCCLUSION", material.GetTexture ("_OcclusionMap")); + bool shouldEmissionBeEnabled = ShouldEmissionBeEnabled (material.GetColor("_EmissionColor")); + SetKeyword (material, "_EMISSION", shouldEmissionBeEnabled); + + // Triplanar texture space" + SetKeyword(material, "_UVFREE_LOCAL", material.GetFloat ("_TriplanarSpace") == (float) Space.Self); + + // Setup lightmap emissive flags + MaterialGlobalIlluminationFlags flags = material.globalIlluminationFlags; + if ((flags & (MaterialGlobalIlluminationFlags.BakedEmissive | MaterialGlobalIlluminationFlags.RealtimeEmissive)) != 0) + { + flags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack; + if (!shouldEmissionBeEnabled) + flags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack; + + material.globalIlluminationFlags = flags; + } + } + + bool HasValidEmissiveKeyword (Material material) + { + // Material animation might be out of sync with the material keyword. + // So if the emission support is disabled on the material, but the property blocks have a value that requires it, then we need to show a warning. + // (note: (Renderer MaterialPropertyBlock applies its values to emissionColorForRendering)) + bool hasEmissionKeyword = material.IsKeywordEnabled ("_EMISSION"); + if (!hasEmissionKeyword && ShouldEmissionBeEnabled (emissionColorForRendering.colorValue)) + return false; + else + return true; + } + + static void MaterialChanged(Material material, WorkflowMode workflowMode) + { + // Clamp EmissionScale to always positive + if (material.GetFloat("_EmissionScaleUI") < 0.0f) + material.SetFloat("_EmissionScaleUI", 0.0f); + + // Apply combined emission value + Color emissionColorOut = EvalFinalEmissionColor (material); + material.SetColor("_EmissionColor", emissionColorOut); + + if (workflowMode == WorkflowMode.Metallic) + { + material.SetFloat ("_UsingMetallicGlossMap", (material.GetTexture ("_MetallicGlossMap") == null) ? 0.0f : 1.0f); + } + else if (workflowMode == WorkflowMode.Specular) + { + material.SetFloat ("_UsingSpecGlossMap", (material.GetTexture ("_SpecGlossMap") == null) ? 0.0f : 1.0f); + } + + SetMaterialKeywords(material, workflowMode); + } + + static void SetKeyword(Material m, string keyword, bool state) + { + //Debug.Log(keyword + ": " + state); + + if (state) + m.EnableKeyword (keyword); + else + m.DisableKeyword (keyword); + } + } + +} // namespace UnityEditor diff --git a/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderGUI.cs.meta b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderGUI.cs.meta new file mode 100644 index 0000000..aa17d9a --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderGUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 485031e932da44c3dbcf72498f29c253 +timeCreated: 1426710593 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderTopBottomGUI.cs b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderTopBottomGUI.cs new file mode 100644 index 0000000..77f21b5 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderTopBottomGUI.cs @@ -0,0 +1,620 @@ +using System; +using UnityEngine; + +namespace UnityEditor +{ + internal class UVFreePBRShaderTopBottomGUI : ShaderGUI + { + private enum WorkflowMode + { + Specular, + Metallic, + Dielectric + } + + private static class Styles + { + public static GUIStyle optionsButton = "PaneOptions"; + + public static string emptyTootip = ""; + + public static GUIContent triplanarSpace = new GUIContent("Triplanar Space", "Whether the triplanar projection should be in local or global space"); + public static GUIContent texturePowerText = new GUIContent("Texture Power", "How strong textures on different axes are differentiated. 1 for smooth blending, 10+ for sharper contrasts"); + public static GUIContent topMultiplierText = new GUIContent("Top Strength", "How much of the mesh should be considered the top. Set to 0 to disable."); + + public static GUIContent bottomMultiplierText = new GUIContent("Bottom Strength", "How much of the mesh should be considered the bottom. Set to 0 to disable."); + public static GUIContent vertexColorStrengthText = new GUIContent("Vertex Color Strength", "0 for no vertex color (off), 1 for full vertex color tinting"); + + public static GUIContent albedoLabel = new GUIContent("Albedo", "Albedo (RGB) and Transparency (A)"); + + public static GUIContent albedoText = new GUIContent("Main", "Albedo (RGB) and Transparency (A)"); + public static GUIContent albedoTextTop = new GUIContent("Top (+Y)", "Albedo (RGB) and Transparency (A)"); + public static GUIContent albedoTextBottom = new GUIContent("Bottom (-Y)", "Albedo (RGB) and Transparency (A)"); + + public static GUIContent specularLabel = new GUIContent("Specular", "Specular (RGB) and Smoothness (A)"); + + public static GUIContent specularMapText = new GUIContent("Main", "Specular (RGB) and Smoothness (A)"); + public static GUIContent specularMapTextTop = new GUIContent("Top (+Y)", "Specular (RGB) and Smoothness (A)"); + public static GUIContent specularMapTextBottom = new GUIContent("Bottom (-Y)", "Specular (RGB) and Smoothness (A)"); + + public static GUIContent metallicLabel = new GUIContent("Metallic", "Metallic (R) and Smoothness (A)"); + + public static GUIContent metallicMapText = new GUIContent("Main", "Metallic (R) and Smoothness (A)"); + public static GUIContent metallicMapTextTop = new GUIContent("Top (+Y)", "Metallic (R) and Smoothness (A)"); + public static GUIContent metallicMapTextBottom = new GUIContent("Bottom (-Y)", "Metallic (R) and Smoothness (A)"); + + public static GUIContent smoothnessText = new GUIContent("Smoothness", ""); + public static GUIContent smoothnessTextTop = new GUIContent("Smoothness", ""); + public static GUIContent smoothnessTextBottom = new GUIContent("Smoothness", ""); + + public static GUIContent normalLabel = new GUIContent("Normal", "Normal Map"); + public static GUIContent normalMapText = new GUIContent("Main", "Normal Map"); + public static GUIContent normalMapTextTop = new GUIContent("Top (+Y)", "Normal Map"); + public static GUIContent normalMapTextBottom = new GUIContent("Bottom (-Y)", "Normal Map"); + + public static GUIContent emissionLabel = new GUIContent("Emission", "Emission (RGB)"); + + public static GUIContent emissionText = new GUIContent("Main", "Emission (RGB)"); + public static GUIContent emissionTextTop = new GUIContent("Top (+Y)", "Emission (RGB)"); + public static GUIContent emissionTextBottom = new GUIContent("Bottom (-Y)", "Emission (RGB)"); + + public static string textureScaleOffset = "Main Texture Scale/Offset"; + public static string textureScaleOffsetTop = "Top (+Y) Texture Scale/Offset"; + public static string textureScaleOffsetBottom = "Bottom (-Y) Texture Scale/Offset"; + + public static string whiteSpaceString = " "; + + public static GUIContent emissiveWarning = new GUIContent ("Emissive value is animated but the material has not been configured to support emissive. Please make sure the material itself has some amount of emissive."); + public static GUIContent emissiveColorWarning = new GUIContent ("Ensure emissive color is non-black for emission to have effect."); + public static readonly string[] spaceNames = Enum.GetNames (typeof(Space)); + public static string advancedText = "Advanced Options"; + } + + private const float MIN_VALUE = 0.0f; + + // FRONT + MaterialProperty vertexColorStrength = null; + + MaterialProperty albedoMap = null; + MaterialProperty albedoColor = null; + MaterialProperty specularMap = null; + MaterialProperty specularColor = null; + MaterialProperty metallicMap = null; + MaterialProperty metallic = null; + MaterialProperty smoothness = null; + MaterialProperty bumpScale = null; + MaterialProperty bumpMap = null; + MaterialProperty emissionScaleUI = null; + MaterialProperty emissionColorUI = null; + MaterialProperty emissionColorForRendering = null; + MaterialProperty emissionMap = null; + + // TOP + + MaterialProperty albedoMapTop = null; + MaterialProperty albedoColorTop = null; + MaterialProperty specularMapTop = null; + MaterialProperty specularColorTop = null; + MaterialProperty metallicMapTop = null; + MaterialProperty metallicTop = null; + MaterialProperty smoothnessTop = null; + MaterialProperty bumpScaleTop = null; + MaterialProperty bumpMapTop = null; + MaterialProperty emissionScaleUITop = null; + MaterialProperty emissionColorUITop = null; + MaterialProperty emissionMapTop = null; + + // BOTTOM + + MaterialProperty albedoMapBottom = null; + MaterialProperty albedoColorBottom = null; + MaterialProperty specularMapBottom = null; + MaterialProperty specularColorBottom = null; + MaterialProperty metallicMapBottom = null; + MaterialProperty metallicBottom = null; + MaterialProperty smoothnessBottom = null; + MaterialProperty bumpScaleBottom = null; + MaterialProperty bumpMapBottom = null; + MaterialProperty emissionScaleUIBottom = null; + MaterialProperty emissionColorUIBottom = null; + MaterialProperty emissionMapBottom = null; + + MaterialProperty texturePower = null; + + MaterialProperty triplanarSpace = null; + MaterialProperty topMultiplier = null; + MaterialProperty bottomMultiplier = null; + + MaterialEditor m_MaterialEditor; + WorkflowMode m_WorkflowMode = WorkflowMode.Specular; + bool m_FirstTimeApply = true; + + public void FindProperties (MaterialProperty[] props) + { + triplanarSpace = FindProperty("_TriplanarSpace", props, false); + texturePower = FindProperty("_TexPower", props, false); + topMultiplier = FindProperty("_TopMultiplier", props, false); + + bottomMultiplier = FindProperty("_BottomMultiplier", props, false); + + vertexColorStrength = FindProperty("_VertexColorStrength", props, false); + + albedoMap = FindProperty ("_MainTex", props); + albedoColor = FindProperty ("_Color", props); + specularMap = FindProperty ("_SpecGlossMap", props, false); + specularColor = FindProperty ("_SpecColor", props, false); + metallicMap = FindProperty ("_MetallicGlossMap", props, false); + metallic = FindProperty ("_Metallic", props, false); + + if (specularMap != null && specularColor != null) + { + m_WorkflowMode = WorkflowMode.Specular; + } + else if (metallicMap != null && metallic != null) + { + m_WorkflowMode = WorkflowMode.Metallic; + } + else + { + m_WorkflowMode = WorkflowMode.Dielectric; + } + + smoothness = FindProperty ("_Glossiness", props); + bumpScale = FindProperty ("_BumpScale", props); + bumpMap = FindProperty ("_BumpMap", props); + + emissionMap = FindProperty("_EmissionMap", props); + emissionScaleUI = FindProperty ("_EmissionScaleUI", props); + emissionColorUI = FindProperty ("_EmissionColorUI", props); + emissionColorForRendering = FindProperty ("_EmissionColor", props); + + // TOP + + albedoMapTop = FindProperty ("_TopMainTex", props, false); + albedoColorTop = FindProperty ("_TopColor", props, false); + specularMapTop = FindProperty ("_TopSpecGlossMap", props, false); + specularColorTop = FindProperty ("_TopSpecColor", props, false); + metallicMapTop = FindProperty ("_TopMetallicGlossMap", props, false); + metallicTop = FindProperty ("_TopMetallic", props, false); + smoothnessTop = FindProperty ("_TopGlossiness", props, false); + bumpScaleTop = FindProperty ("_TopBumpScale", props, false); + bumpMapTop = FindProperty ("_TopBumpMap", props, false); + emissionMapTop = FindProperty("_TopEmissionMap", props); + emissionScaleUITop = FindProperty ("_TopEmissionScaleUI", props); + emissionColorUITop = FindProperty ("_TopEmissionColorUI", props); + + // BOTTOM + + albedoMapBottom = FindProperty ("_BottomMainTex", props, false); + albedoColorBottom = FindProperty ("_BottomColor", props, false); + + specularMapBottom = FindProperty ("_BottomSpecGlossMap", props, false); + specularColorBottom = FindProperty ("_BottomSpecColor", props, false); + metallicMapBottom = FindProperty ("_BottomMetallicGlossMap", props, false); + metallicBottom = FindProperty ("_BottomMetallic", props, false); + smoothnessBottom = FindProperty ("_BottomGlossiness", props, false); + bumpScaleBottom = FindProperty ("_BottomBumpScale", props, false); + bumpMapBottom = FindProperty ("_BottomBumpMap", props, false); + emissionMapBottom = FindProperty("_BottomEmissionMap", props, false); + emissionScaleUIBottom = FindProperty ("_BottomEmissionScaleUI", props, false); + emissionColorUIBottom = FindProperty ("_BottomEmissionColorUI", props, false); + } + + public override void OnGUI (MaterialEditor materialEditor, MaterialProperty[] props) + { + FindProperties (props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly + m_MaterialEditor = materialEditor; + Material material = materialEditor.target as Material; + + ShaderPropertiesGUI (material); + + // Make sure that needed keywords are set up if we're switching some existing + // material to a standard shader. + if (m_FirstTimeApply) + { + SetMaterialKeywords (material, m_WorkflowMode); + m_FirstTimeApply = false; + } + } + + public void ShaderPropertiesGUI (Material material) + { + // Use default labelWidth + EditorGUIUtility.labelWidth = 0f; + + // Detect any changes to the material + EditorGUI.BeginChangeCheck(); + { + TriplanarSpacePopup(); + m_MaterialEditor.RangeProperty (texturePower, "Texture Power"); + + m_MaterialEditor.RangeProperty (topMultiplier, "Top Multiplier"); + m_MaterialEditor.RangeProperty (bottomMultiplier, "Bottom Multiplier"); + + if (vertexColorStrength != null) + { + m_MaterialEditor.RangeProperty (vertexColorStrength, Styles.vertexColorStrengthText.text); + } + + DoAlbedoArea(material); + DoSpecularMetallicArea(material); + + // bump + GUILayout.Label(Styles.normalLabel, EditorStyles.boldLabel); + + m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMap, bumpMap.textureValue != null ? bumpScale : null); + if (topMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapTextTop, bumpMapTop, bumpMapTop.textureValue != null ? bumpScaleTop : null); + } + if (bottomMultiplier.floatValue > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapTextBottom, bumpMapBottom, bumpMapBottom.textureValue != null ? bumpScaleBottom : null); + } + + DoEmissionArea(material); + + // MAIN + EditorGUILayout.Space(); + GUILayout.Label(Styles.textureScaleOffset, EditorStyles.boldLabel); + m_MaterialEditor.TextureScaleOffsetProperty(albedoMap); + + // TOP + if (topMultiplier.floatValue > MIN_VALUE) + { + EditorGUILayout.Space(); + GUILayout.Label(Styles.textureScaleOffsetTop, EditorStyles.boldLabel); + m_MaterialEditor.TextureScaleOffsetProperty(albedoMapTop); + } + + // BOTTOM + if (bottomMultiplier.floatValue > MIN_VALUE) + { + EditorGUILayout.Space(); + GUILayout.Label(Styles.textureScaleOffsetBottom, EditorStyles.boldLabel); + m_MaterialEditor.TextureScaleOffsetProperty(albedoMapBottom); + } + } + if (EditorGUI.EndChangeCheck()) + { + MaterialChanged(material, m_WorkflowMode); + } + EditorGUILayout.Space(); + + GUILayout.Label(Styles.advancedText, EditorStyles.boldLabel); + m_MaterialEditor.RenderQueueField(); + m_MaterialEditor.EnableInstancingField(); + m_MaterialEditor.DoubleSidedGIField(); + } + + //internal + void DetermineWorkflow(MaterialProperty[] props) + { + if (FindProperty("_SpecGlossMap", props, false) != null && FindProperty("_SpecColor", props, false) != null) + m_WorkflowMode = WorkflowMode.Specular; + else if (FindProperty("_MetallicGlossMap", props, false) != null && FindProperty("_Metallic", props, false) != null) + m_WorkflowMode = WorkflowMode.Metallic; + else + m_WorkflowMode = WorkflowMode.Dielectric; + + } + + public override void AssignNewShaderToMaterial (Material material, Shader oldShader, Shader newShader) + { + base.AssignNewShaderToMaterial(material, oldShader, newShader); + } + + + void TriplanarSpacePopup() + { + EditorGUI.showMixedValue = triplanarSpace.hasMixedValue; + var space = (Space)triplanarSpace.floatValue; + + EditorGUI.BeginChangeCheck(); + space = (Space)EditorGUILayout.Popup(Styles.triplanarSpace.text, (int)space, Styles.spaceNames); + + if (EditorGUI.EndChangeCheck()) + { + m_MaterialEditor.RegisterPropertyChangeUndo("Triplanar Space"); + triplanarSpace.floatValue = (float)space; + } + + EditorGUI.showMixedValue = false; + } + + void DoAlbedoArea(Material material) + { + GUILayout.Label(Styles.albedoLabel, EditorStyles.boldLabel); + + m_MaterialEditor.TexturePropertySingleLine(Styles.albedoText, albedoMap, albedoColor); + + if (material.GetFloat ("_TopMultiplier") > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.albedoTextTop, albedoMapTop, albedoColorTop); + } + + if (material.GetFloat ("_BottomMultiplier") > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.albedoTextBottom, albedoMapBottom, albedoColorBottom); + } + + } + + void DoEmissionArea(Material material) + { + GUILayout.Label(Styles.emissionLabel, EditorStyles.boldLabel); + + bool showEmissionColorAndGIControls = emissionScaleUI.floatValue > 0f; + bool showEmissionColorAndGIControlsTop = emissionScaleUITop.floatValue > 0f; + bool showEmissionColorAndGIControlsBottom = emissionScaleUIBottom.floatValue > 0f; + + // Do controls + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionText, emissionMap, showEmissionColorAndGIControls ? emissionColorUI : null, emissionScaleUI); + + if (material.GetFloat ("_TopMultiplier") > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionTextTop, emissionMapTop, showEmissionColorAndGIControlsTop ? emissionColorUITop : null, emissionScaleUITop); + } + + if (material.GetFloat("_BottomMultiplier") > MIN_VALUE) + { + m_MaterialEditor.TexturePropertySingleLine(Styles.emissionTextBottom, emissionMapBottom, showEmissionColorAndGIControlsBottom ? emissionColorUIBottom : null, emissionScaleUIBottom); + } + + // Dynamic Lightmapping mode + if (showEmissionColorAndGIControls) + { + bool shouldEmissionBeEnabled = ShouldEmissionBeEnabled(EvalFinalEmissionColor(material)); + EditorGUI.BeginDisabledGroup(!shouldEmissionBeEnabled); + + m_MaterialEditor.LightmapEmissionProperty (MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1); + + EditorGUI.EndDisabledGroup(); + } + + } + + void DoSpecularMetallicArea(Material material) + { + if (m_WorkflowMode == WorkflowMode.Specular) + { + GUILayout.Label(Styles.specularLabel, EditorStyles.boldLabel); + + // MAIN + if (specularMap.textureValue == null) + { + m_MaterialEditor.TexturePropertyTwoLines(Styles.specularMapText, specularMap, specularColor, Styles.smoothnessText, smoothness); + } + else + { + m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapText, specularMap); + } + + // TOP + if (topMultiplier.floatValue > MIN_VALUE) + { + + if (specularMapTop.textureValue == null) + { + m_MaterialEditor.TexturePropertyTwoLines(Styles.specularMapTextTop, specularMapTop, specularColorTop, Styles.smoothnessTextTop, smoothnessTop); + } + else + { + m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapTextTop, specularMapTop); + } + } + + // BOTTOM + if (bottomMultiplier.floatValue > MIN_VALUE) + { + + if (specularMapBottom.textureValue == null) + { + m_MaterialEditor.TexturePropertyTwoLines(Styles.specularMapTextBottom, specularMapBottom, specularColorBottom, Styles.smoothnessTextBottom, smoothnessBottom); + } + else + { + m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapTextBottom, specularMapBottom); + } + } + + } + else if (m_WorkflowMode == WorkflowMode.Metallic) + { + GUILayout.Label(Styles.metallicLabel, EditorStyles.boldLabel); + + // MAIN + if (metallicMap.textureValue == null) + { + m_MaterialEditor.TexturePropertyTwoLines(Styles.metallicMapText, metallicMap, metallic, Styles.smoothnessText, smoothness); + + } + else + { + m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapText, metallicMap); + } + + // TOP + if (topMultiplier.floatValue > MIN_VALUE) + { + + if (metallicMapTop.textureValue == null) + { + m_MaterialEditor.TexturePropertyTwoLines(Styles.metallicMapTextTop, metallicMapTop, metallicTop, Styles.smoothnessTextTop, smoothnessTop); + } + else + { + m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapTextTop, metallicMapTop); + } + } + + // BOTTOM + if (bottomMultiplier.floatValue > MIN_VALUE) + { + if (metallicMapBottom.textureValue == null) + { + m_MaterialEditor.TexturePropertyTwoLines(Styles.metallicMapTextBottom, metallicMapBottom, metallicBottom, Styles.smoothnessTextBottom, smoothnessBottom); + } + else + { + m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapTextBottom, metallicMapBottom); + } + } + + } + } + + // Calculate final HDR _EmissionColor (gamma space) from _EmissionColorUI (LDR, gamma) & _EmissionScaleUI (gamma) + static Color EvalFinalEmissionColor(Material material) + { + return material.GetColor("_EmissionColorUI") * material.GetFloat("_EmissionScaleUI"); + } + + + static Color EvalFinalEmissionColorTop(Material material) + { + return material.GetColor("_TopEmissionColorUI") * material.GetFloat("_TopEmissionScaleUI"); + } + static Color EvalFinalEmissionColorBottom(Material material) + { + return material.GetColor("_BottomEmissionColorUI") * material.GetFloat("_BottomEmissionScaleUI"); + } + + static bool ShouldEmissionBeEnabled (Color color) + { + return color.grayscale > (0.1f / 255.0f); + } + + static void SetMaterialKeywords(Material material, WorkflowMode workflowMode) + { + // Note: keywords must be based on Material value not on MaterialProperty due to multi-edit & material animation + // (MaterialProperty value might come from renderer material property block) + if (workflowMode == WorkflowMode.Specular) + { + SetKeyword (material, "_SPECGLOSSMAP", + material.GetTexture ("_SpecGlossMap") || + material.GetTexture ("_TopSpecGlossMap") || + material.GetTexture ("_BottomSpecGlossMap") + ); + } + else if (workflowMode == WorkflowMode.Metallic) + { + SetKeyword (material, "_METALLICGLOSSMAP", + material.GetTexture ("_MetallicGlossMap") || + material.GetTexture ("_TopMetallicGlossMap") || + material.GetTexture ("_BottomMetallicGlossMap") + ); + } + + bool shouldEmissionBeEnabled = + ShouldEmissionBeEnabled (material.GetColor("_EmissionColor")) + || (material.HasProperty ("_TopMultiplier") && material.GetFloat ("_TopMultiplier") > MIN_VALUE && ShouldEmissionBeEnabled (material.GetColor("_TopEmissionColor"))) + || (material.HasProperty ("_BottomMultiplier") && material.GetFloat ("_BottomMultiplier") > MIN_VALUE && ShouldEmissionBeEnabled (material.GetColor("_BottomEmissionColor"))); + + SetKeyword (material, "_EMISSION", shouldEmissionBeEnabled); + + // Triplanar texture space + SetKeyword(material, "_UVFREE_LOCAL", material.GetFloat ("_TriplanarSpace") == (float) Space.Self); + + // whether the bottom is enabled + SetKeyword(material, "_UVFREE_BOTTOM", material.GetFloat ("_BottomMultiplier") > (0.1f / 255.0f)); + + // Setup lightmap emissive flags + MaterialGlobalIlluminationFlags flags = material.globalIlluminationFlags; + if ((flags & (MaterialGlobalIlluminationFlags.BakedEmissive | MaterialGlobalIlluminationFlags.RealtimeEmissive)) != 0) + { + flags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack; + if (!shouldEmissionBeEnabled) + flags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack; + + material.globalIlluminationFlags = flags; + } + } + + bool HasValidEmissiveKeyword (Material material) + { + // Material animation might be out of sync with the material keyword. + // So if the emission support is disabled on the material, but the property blocks have a value that requires it, then we need to show a warning. + // (note: (Renderer MaterialPropertyBlock applies its values to emissionColorForRendering)) + bool hasEmissionKeyword = material.IsKeywordEnabled ("_EMISSION"); + if (!hasEmissionKeyword && ShouldEmissionBeEnabled (emissionColorForRendering.colorValue)) + return false; + else + return true; + } + + static void MaterialChanged(Material material, WorkflowMode workflowMode) + { + // clamp texture power + float tTexPower = material.GetFloat("_TexPower"); + if (tTexPower < 0.0f || tTexPower > 20.0f) + { + material.SetFloat ("_TexPower", Mathf.Clamp (tTexPower, 0.0f, 20.0f)); + } + + // clamp top multiplier + float tTopMultiplier = material.GetFloat ("_TopMultiplier"); + if (tTopMultiplier < 0.0f || tTopMultiplier > 8.0f) + { + material.SetFloat ("_TopMultiplier", Mathf.Clamp (tTopMultiplier, 0.0f, 8.0f)); + } + + // clamp bottom multiplier + float tBottomMultiplier = material.GetFloat ("_BottomMultiplier"); + if (tBottomMultiplier < 0.0f || tBottomMultiplier > 8.0f) + { + material.SetFloat ("_BottomMultiplier", Mathf.Clamp (tBottomMultiplier, 0.0f, 8.0f)); + } + + // Clamp EmissionScale to always positive + if (material.GetFloat("_EmissionScaleUI") < 0.0f) + material.SetFloat("_EmissionScaleUI", 0.0f); + + // Apply combined emission value + Color emissionColorOut = EvalFinalEmissionColor (material); + material.SetColor("_EmissionColor", emissionColorOut); + + + // TOP + + if (material.GetFloat("_TopEmissionScaleUI") < 0.0f) + material.SetFloat("_TopEmissionScaleUI", 0.0f); + + Color emissionColorOutTop = EvalFinalEmissionColorTop (material); + material.SetColor("_TopEmissionColor", emissionColorOutTop); + + // BOTTOM + + if (material.GetFloat("_BottomEmissionScaleUI") < 0.0f) + material.SetFloat("_BottomEmissionScaleUI", 0.0f); + + Color emissionColorOutBottom = EvalFinalEmissionColorBottom (material); + material.SetColor("_BottomEmissionColor", emissionColorOutBottom); + + + if (workflowMode == WorkflowMode.Metallic) + { + material.SetFloat ("_UsingMetallicGlossMap", (material.GetTexture ("_MetallicGlossMap") == null) ? 0.0f : 1.0f); + material.SetFloat ("_TopUsingMetallicGlossMap", (material.GetTexture ("_TopMetallicGlossMap") == null) ? 0.0f : 1.0f); + material.SetFloat ("_BottomUsingMetallicGlossMap", (material.GetTexture ("_BottomMetallicGlossMap") == null) ? 0.0f : 1.0f); + } + else if (workflowMode == WorkflowMode.Specular) + { + material.SetFloat ("_UsingSpecGlossMap", (material.GetTexture ("_SpecGlossMap") == null) ? 0.0f : 1.0f); + material.SetFloat ("_TopUsingSpecGlossMap", (material.GetTexture ("_TopSpecGlossMap") == null) ? 0.0f : 1.0f); + material.SetFloat ("_BottomUsingSpecGlossMap", (material.GetTexture ("_BottomSpecGlossMap") == null) ? 0.0f : 1.0f); + } + SetMaterialKeywords(material, workflowMode); + } + + static void SetKeyword(Material m, string keyword, bool state) + { + //Debug.Log(keyword + ": " + state); + if (state) + m.EnableKeyword (keyword); + else + m.DisableKeyword (keyword); + } + } + +} // namespace UnityEditor diff --git a/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderTopBottomGUI.cs.meta b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderTopBottomGUI.cs.meta new file mode 100644 index 0000000..753cfc9 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Editor/UVFreePBRShaderTopBottomGUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e75eae9587d2c4f48a9afb816677fcaf +timeCreated: 1426888738 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain.meta b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain.meta new file mode 100644 index 0000000..7b12d31 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8c6bfcef2393f4ec6a3488b8d23570a4 +folderAsset: yes +timeCreated: 1427422582 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-AddPass.shader b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-AddPass.shader new file mode 100644 index 0000000..3053fc8 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-AddPass.shader @@ -0,0 +1,270 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/UVFree/Terrain/StandardMetallic-AddPass" { + Properties { + _TexPower("Texture Power", Range (0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + [HideInInspector] [Gamma] _Metallic0 ("Metallic 0", Range(0.0, 1.0)) = 0.0 + [HideInInspector] [Gamma] _Metallic1 ("Metallic 1", Range(0.0, 1.0)) = 0.0 + [HideInInspector] [Gamma] _Metallic2 ("Metallic 2", Range(0.0, 1.0)) = 0.0 + [HideInInspector] [Gamma] _Metallic3 ("Metallic 3", Range(0.0, 1.0)) = 0.0 + [HideInInspector] _Smoothness0 ("Smoothness 0", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness1 ("Smoothness 1", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness2 ("Smoothness 2", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness3 ("Smoothness 3", Range(0.0, 1.0)) = 1.0 + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-99" + "IgnoreProjector"="True" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf Standard decal:add vertex:SplatmapVert finalcolor:SplatmapFinalColor fullforwardshadows + + #define TERRAIN_SURFACE_OUTPUT SurfaceOutputStandard + + #pragma multi_compile_fog + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + #include "UnityPBSLighting.cginc" + + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + #define TERRAIN_SPLAT_ADDPASS + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + + fixed _Metallic0, _Metallic1, _Metallic2, _Metallic3; + fixed _Smoothness0, _Smoothness1, _Smoothness2, _Smoothness3; + + half _TexPower; + half _BumpScale; + + float _UVScale; + + struct Input + { + fixed3 powerNormal; + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + float3 worldPos; + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), clamp(_TexPower,0.0, 20.0)); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf (Input IN, inout SurfaceOutputStandard o) { + + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0 * fixed4(1.0, 1.0, 1.0, _Smoothness0); + mixedDiffuse += splat_control.g * tex1 * fixed4(1.0, 1.0, 1.0, _Smoothness1); + mixedDiffuse += splat_control.b * tex2 * fixed4(1.0, 1.0, 1.0, _Smoothness2); + mixedDiffuse += splat_control.a * tex3 * fixed4(1.0, 1.0, 1.0, _Smoothness3); + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + o.Albedo = max(fixed3(0.0, 0.0, 0.0), mixedDiffuse.rgb); + o.Alpha = weight; + + o.Smoothness = mixedDiffuse.a; + o.Metallic = dot(splat_control, fixed4(_Metallic0, _Metallic1, _Metallic2, _Metallic3)); + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + + Fallback "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-AddPass.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-AddPass.shader.meta new file mode 100644 index 0000000..437784c --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-AddPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6dc7a16b4568245d7a2e347fc55d6bda +timeCreated: 1427271118 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-Base.shader b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-Base.shader new file mode 100644 index 0000000..8accbf2 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-Base.shader @@ -0,0 +1,44 @@ +Shader "Hidden/UVFree/Terrain/StandardMetallic-Base" { + Properties { + _MainTex ("Base (RGB) Smoothness (A)", 2D) = "white" {} + _SpecularMetallicTex ("Specular (RGB) Metallic (A)", 2D) = "white" {} + + // used in fallback on old cards + _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + } + + SubShader { + Tags { + "RenderType" = "Opaque" + "Queue" = "Geometry-100" + } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + #include "UnityPBSLighting.cginc" + + sampler2D _MainTex; + sampler2D _SpecularMetallicTex; + + struct Input { + float2 uv_MainTex; + }; + + void surf (Input IN, inout SurfaceOutputStandard o) { + half4 c = tex2D (_MainTex, IN.uv_MainTex); + o.Albedo = max(fixed3(0.001, 0.001, 0.001), c.rgb); + o.Alpha = 1.0; + + o.Smoothness = c.a; + o.Metallic = tex2D (_SpecularMetallicTex, IN.uv_MainTex).a; + } + + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-Base.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-Base.shader.meta new file mode 100644 index 0000000..7c0d25d --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-Base.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b724fb8949ace4d76ad2f6462bcac5f6 +timeCreated: 1427271122 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-FirstPass.shader b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-FirstPass.shader new file mode 100644 index 0000000..782cb63 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-FirstPass.shader @@ -0,0 +1,274 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "UVFree/Terrain/StandardMetallic" { + Properties { + _TexPower("Texture Power", Range (0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + [HideInInspector] [Gamma] _Metallic0 ("Metallic 0", Range(0.0, 1.0)) = 0.0 + [HideInInspector] [Gamma] _Metallic1 ("Metallic 1", Range(0.0, 1.0)) = 0.0 + [HideInInspector] [Gamma] _Metallic2 ("Metallic 2", Range(0.0, 1.0)) = 0.0 + [HideInInspector] [Gamma] _Metallic3 ("Metallic 3", Range(0.0, 1.0)) = 0.0 + [HideInInspector] _Smoothness0 ("Smoothness 0", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness1 ("Smoothness 1", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness2 ("Smoothness 2", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness3 ("Smoothness 3", Range(0.0, 1.0)) = 1.0 + + // used in fallback on old cards & base map + [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} + [HideInInspector] _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-100" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf Standard vertex:SplatmapVert finalcolor:SplatmapFinalColor fullforwardshadows + + #define TERRAIN_SURFACE_OUTPUT SurfaceOutputStandard + + #pragma multi_compile_fog + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + #include "UnityPBSLighting.cginc" + + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + + + fixed _Metallic0, _Metallic1, _Metallic2, _Metallic3; + fixed _Smoothness0, _Smoothness1, _Smoothness2, _Smoothness3; + + half _TexPower; + half _BumpScale; + + float _UVScale; + + struct Input + { + fixed3 powerNormal; + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + float3 worldPos; + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), clamp(_TexPower,0.0, 20.0)); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf (Input IN, inout SurfaceOutputStandard o) { + + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0 * fixed4(1.0, 1.0, 1.0, _Smoothness0); + mixedDiffuse += splat_control.g * tex1 * fixed4(1.0, 1.0, 1.0, _Smoothness1); + mixedDiffuse += splat_control.b * tex2 * fixed4(1.0, 1.0, 1.0, _Smoothness2); + mixedDiffuse += splat_control.a * tex3 * fixed4(1.0, 1.0, 1.0, _Smoothness3); + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + o.Albedo = max(fixed3(0.0, 0.0, 0.0), mixedDiffuse.rgb); + o.Alpha = weight; + o.Smoothness = mixedDiffuse.a; + + o.Metallic = dot(splat_control, fixed4(_Metallic0, _Metallic1, _Metallic2, _Metallic3)); + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + Dependency "AddPassShader" = "Hidden/UVFree/Terrain/StandardMetallic-AddPass" + Dependency "BaseMapShader" = "Hidden/UVFree/Terrain/StandardMetallic-Base" + + Fallback "Nature/Terrain/Diffuse" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-FirstPass.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-FirstPass.shader.meta new file mode 100644 index 0000000..1e5ae82 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic Terrain/UVFreeTerrainStandardMetallic-FirstPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9d90a5ae4faf244fd9a8b99d09f9fb66 +timeCreated: 1427271121 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic.meta b/Shaders/UVFree/Standard PBR/Standard Metallic.meta new file mode 100644 index 0000000..be184c7 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 201510bf05cc74dfe81ed20049849908 +folderAsset: yes +timeCreated: 1426831325 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallic.shader b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallic.shader new file mode 100644 index 0000000..db4fbf9 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallic.shader @@ -0,0 +1,414 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/StandardMetallic/Single-Texture" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + + _Color ("Color", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 1.0 + + _Glossiness ("Smoothness", Range(0.0,1.0)) = 0.5 + + [Gamma] _Metallic ("Metallic", Range(0.0,1.0)) = 0.0 + _MetallicGlossMap("Metallic", 2D) = "black" {} + _UsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 + [ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 + _ParallaxMap ("Height Map", 2D) = "black" {} + + _OcclusionStrength("Occlusion Strength", Range(0.0, 1.0)) = 1.0 + _OcclusionMap("Occlusion", 2D) = "white" {} + + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _DetailMask("Detail Mask", 2D) = "white" {} + + _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} + _DetailNormalMapScale("Scale", Float) = 1.0 + _DetailNormalMap("Normal Map", 2D) = "bump" {} + + // UI-only data + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1.0,1.0,1.0) + + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + LOD 300 + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard vertex:vert fullforwardshadows nodynlightmap + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _DETAIL + #pragma shader_feature _OCCLUSION + #pragma shader_feature _PARALLAXMAP + #pragma shader_feature _SPECULARHIGHLIGHTS_OFF + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + half _TexPower; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Metallic; + fixed _Glossiness; + + #ifdef _DETAIL + sampler2D _DetailAlbedoMap; + float4 _DetailAlbedoMap_ST; + sampler2D _DetailMask; + sampler2D _DetailNormalMap; + half _DetailNormalMapScale; + #endif + + #ifdef _METALLICGLOSSMAP + sampler2D _MetallicGlossMap; + fixed _UsingMetallicGlossMap; + #endif + + #ifdef _OCCLUSION + sampler2D _OcclusionMap; + fixed _OcclusionStrength; + + #endif + + #ifdef _PARALLAXMAP + sampler2D _ParallaxMap; + half _Parallax; + #endif + + #ifdef _EMISSION + sampler2D _EmissionMap; + half4 _EmissionColor; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + struct Input { + + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + fixed3 viewDirForParallax; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (o.powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (o.powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (o.powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (o.powerNormal.x)) + + (-(worldNormal.y) * (o.powerNormal.y)) + + (-(worldNormal.z) * (o.powerNormal.z)) + ; + + #endif + + #ifdef _PARALLAXMAP + TANGENT_SPACE_ROTATION; + o.viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex)); + #endif + } + + void surf (Input IN, inout SurfaceOutputStandard o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float3 pos = IN.worldPos; + + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + // PARALLAX + // + + #ifdef _PARALLAXMAP + + half parallaxX = tex2D (_ParallaxMap, xUV).r; + half parallaxY = tex2D (_ParallaxMap, yUV).g; + half parallaxZ = tex2D (_ParallaxMap, zUV).b; + + half parallax = + parallaxX * IN.powerNormal.x + + parallaxY * IN.powerNormal.y + + parallaxZ * IN.powerNormal.z + ; + float2 parallaxOffset = ParallaxOffset (parallax, _Parallax, IN.viewDirForParallax); + xUV += parallaxOffset; + yUV += parallaxOffset; + zUV += parallaxOffset; + + #endif + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + fixed3 albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb * tint.rgb); + + + // DIFFUSE DETAIL + // + + #ifdef _DETAIL + fixed detailMaskX = tex2D(_DetailMask, xUV).a; + fixed detailMaskY = tex2D(_DetailMask, yUV).a; + fixed detailMaskZ = tex2D(_DetailMask, zUV).a; + + fixed detailMask = + detailMaskX * IN.powerNormal.x + + detailMaskY * IN.powerNormal.y + + detailMaskZ * IN.powerNormal.z; + + float2 xUVDetail = pos.zy * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 yUVDetail = pos.xz * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 zUVDetail = float2(-pos.x, pos.y) * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + xUVDetail.x *= powerSign.x; + zUVDetail.x *= powerSign.z; + yUVDetail.y *= powerSign.y; + #endif + + #ifdef _PARALLAXMAP + xUVDetail += parallaxOffset; + yUVDetail += parallaxOffset; + zUVDetail += parallaxOffset; + #endif + + fixed3 detailAlbedoX = tex2D (_DetailAlbedoMap, xUVDetail).rgb; + fixed3 detailAlbedoY = tex2D (_DetailAlbedoMap, yUVDetail).rgb; + fixed3 detailAlbedoZ = tex2D (_DetailAlbedoMap, zUVDetail).rgb; + + fixed3 detailAlbedo = + detailAlbedoX * IN.powerNormal.x + + detailAlbedoY * IN.powerNormal.y + + detailAlbedoZ * IN.powerNormal.z; + + albedo *= LerpWhiteTo (detailAlbedo * unity_ColorSpaceDouble.rgb, detailMask); + #endif + o.Albedo = albedo; + o.Alpha = tex.a * tint.a; + + // NORMAL + // + + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + + // NORMAL DETAIL + // + #ifdef _DETAIL + fixed3 detailNormalTangentX = UnpackScaleNormal(tex2D (_DetailNormalMap, xUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentY = UnpackScaleNormal(tex2D (_DetailNormalMap, yUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentZ = UnpackScaleNormal(tex2D (_DetailNormalMap, zUVDetail), _DetailNormalMapScale); + + fixed3 detailNormalTangent = + detailNormalTangentX * IN.powerNormal.x + + detailNormalTangentY * IN.powerNormal.y + + detailNormalTangentZ * IN.powerNormal.z; + + bump = lerp( + bump, + BlendNormals(bump, detailNormalTangent), + detailMask); + + #endif + + o.Normal = normalize(bump); + + // METALLIC/GLOSS + // + + fixed2 mg = fixed2( + _Metallic, + _Glossiness + ); + + #ifdef _METALLICGLOSSMAP + fixed2 mgX = lerp(mg, tex2D(_MetallicGlossMap, xUV).ra, _UsingMetallicGlossMap); + fixed2 mgY = lerp(mg, tex2D(_MetallicGlossMap, yUV).ra, _UsingMetallicGlossMap); + fixed2 mgZ = lerp(mg, tex2D(_MetallicGlossMap, zUV).ra, _UsingMetallicGlossMap); + + mg = + mgX * IN.powerNormal.x + + mgY * IN.powerNormal.y + + mgZ * IN.powerNormal.z; + + #endif + o.Metallic = mg.x; + o.Smoothness = mg.y; + + // EMISSION + // + + #ifndef _EMISSION + o.Emission = 0.0; + #else + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + + o.Emission = (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb; + + #endif + + // OCCLUSION + // + + #ifdef _OCCLUSION + + fixed occX = tex2D(_OcclusionMap, xUV).g; + fixed occY = tex2D(_OcclusionMap, yUV).g; + fixed occZ = tex2D(_OcclusionMap, zUV).g; + + o.Occlusion = LerpOneTo( + (occX * IN.powerNormal.x + occY * IN.powerNormal.y + occZ * IN.powerNormal.z), + _OcclusionStrength); + + #else + o.Occlusion = 1.0; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderGUI" + +} diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallic.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallic.shader.meta new file mode 100644 index 0000000..d67f77f --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallic.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b3ac26fce65714bddabaf5a2562d109a +timeCreated: 1426794833 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicNB.shader b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicNB.shader new file mode 100644 index 0000000..da28245 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicNB.shader @@ -0,0 +1,409 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/StandardMetallic/Single-Texture Non-Batched" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + + _Color ("Color", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 1.0 + + _Glossiness ("Smoothness", Range(0.0,1.0)) = 0.5 + + [Gamma] _Metallic ("Metallic", Range(0.0,1.0)) = 0.0 + _MetallicGlossMap("Metallic", 2D) = "black" {} + _UsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 + [ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 + _ParallaxMap ("Height Map", 2D) = "black" {} + + _OcclusionStrength("Occlusion Strength", Range(0.0, 1.0)) = 1.0 + _OcclusionMap("Occlusion", 2D) = "white" {} + + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _DetailMask("Detail Mask", 2D) = "white" {} + + _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} + _DetailNormalMapScale("Scale", Float) = 1.0 + _DetailNormalMap("Normal Map", 2D) = "bump" {} + + // UI-only data + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1.0,1.0,1.0) + + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + LOD 300 + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard vertex:vert fullforwardshadows nodynlightmap + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _DETAIL + #pragma shader_feature _OCCLUSION + #pragma shader_feature _PARALLAXMAP + #pragma shader_feature _SPECULARHIGHLIGHTS_OFF + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + half _TexPower; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Metallic; + fixed _Glossiness; + + #ifdef _DETAIL + sampler2D _DetailAlbedoMap; + float4 _DetailAlbedoMap_ST; + sampler2D _DetailMask; + sampler2D _DetailNormalMap; + half _DetailNormalMapScale; + #endif + + #ifdef _METALLICGLOSSMAP + sampler2D _MetallicGlossMap; + fixed _UsingMetallicGlossMap; + #endif + + #ifdef _OCCLUSION + sampler2D _OcclusionMap; + fixed _OcclusionStrength; + + #endif + + #ifdef _PARALLAXMAP + sampler2D _ParallaxMap; + half _Parallax; + #endif + + #ifdef _EMISSION + sampler2D _EmissionMap; + half4 _EmissionColor; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + struct Input { + + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + fixed3 viewDirForParallax; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (o.powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (o.powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (o.powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (o.powerNormal.x)) + + (-(worldNormal.y) * (o.powerNormal.y)) + + (-(worldNormal.z) * (o.powerNormal.z)) + ; + + #endif + + #ifdef _PARALLAXMAP + TANGENT_SPACE_ROTATION; + o.viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex)); + #endif + } + + void surf (Input IN, inout SurfaceOutputStandard o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float3 pos = IN.worldPos; + + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + // PARALLAX + // + + #ifdef _PARALLAXMAP + + half parallaxX = tex2D (_ParallaxMap, xUV).r; + half parallaxY = tex2D (_ParallaxMap, yUV).g; + half parallaxZ = tex2D (_ParallaxMap, zUV).b; + + half parallax = + parallaxX * IN.powerNormal.x + + parallaxY * IN.powerNormal.y + + parallaxZ * IN.powerNormal.z + ; + float2 parallaxOffset = ParallaxOffset (parallax, _Parallax, IN.viewDirForParallax); + xUV += parallaxOffset; + yUV += parallaxOffset; + zUV += parallaxOffset; + + #endif + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + fixed3 albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb * tint.rgb); + + + // DIFFUSE DETAIL + // + + #ifdef _DETAIL + fixed detailMaskX = tex2D(_DetailMask, xUV).a; + fixed detailMaskY = tex2D(_DetailMask, yUV).a; + fixed detailMaskZ = tex2D(_DetailMask, zUV).a; + + fixed detailMask = + detailMaskX * IN.powerNormal.x + + detailMaskY * IN.powerNormal.y + + detailMaskZ * IN.powerNormal.z; + + float2 xUVDetail = pos.zy * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 yUVDetail = pos.xz * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 zUVDetail = float2(-pos.x, pos.y) * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + xUVDetail.x *= powerSign.x; + zUVDetail.x *= powerSign.z; + yUVDetail.y *= powerSign.y; + #endif + + #ifdef _PARALLAXMAP + xUVDetail += parallaxOffset; + yUVDetail += parallaxOffset; + zUVDetail += parallaxOffset; + #endif + + fixed3 detailAlbedoX = tex2D (_DetailAlbedoMap, xUVDetail).rgb; + fixed3 detailAlbedoY = tex2D (_DetailAlbedoMap, yUVDetail).rgb; + fixed3 detailAlbedoZ = tex2D (_DetailAlbedoMap, zUVDetail).rgb; + + fixed3 detailAlbedo = + detailAlbedoX * IN.powerNormal.x + + detailAlbedoY * IN.powerNormal.y + + detailAlbedoZ * IN.powerNormal.z; + + albedo *= LerpWhiteTo (detailAlbedo * unity_ColorSpaceDouble.rgb, detailMask); + #endif + o.Albedo = albedo; + o.Alpha = tex.a * tint.a; + + // NORMAL + // + + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + + // NORMAL DETAIL + // + #ifdef _DETAIL + fixed3 detailNormalTangentX = UnpackScaleNormal(tex2D (_DetailNormalMap, xUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentY = UnpackScaleNormal(tex2D (_DetailNormalMap, yUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentZ = UnpackScaleNormal(tex2D (_DetailNormalMap, zUVDetail), _DetailNormalMapScale); + + fixed3 detailNormalTangent = + detailNormalTangentX * IN.powerNormal.x + + detailNormalTangentY * IN.powerNormal.y + + detailNormalTangentZ * IN.powerNormal.z; + + bump = lerp( + bump, + BlendNormals(bump, detailNormalTangent), + detailMask); + + #endif + + o.Normal = normalize(bump); + + // METALLIC/GLOSS + // + + fixed2 mg = fixed2( + _Metallic, + _Glossiness + ); + + #ifdef _METALLICGLOSSMAP + fixed2 mgX = lerp(mg, tex2D(_MetallicGlossMap, xUV).ra, _UsingMetallicGlossMap); + fixed2 mgY = lerp(mg, tex2D(_MetallicGlossMap, yUV).ra, _UsingMetallicGlossMap); + fixed2 mgZ = lerp(mg, tex2D(_MetallicGlossMap, zUV).ra, _UsingMetallicGlossMap); + + mg = + mgX * IN.powerNormal.x + + mgY * IN.powerNormal.y + + mgZ * IN.powerNormal.z; + + #endif + o.Metallic = mg.x; + o.Smoothness = mg.y; + + // EMISSION + // + + #ifndef _EMISSION + o.Emission = 0.0; + #else + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + + o.Emission = (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb; + + #endif + + // OCCLUSION + // + + #ifdef _OCCLUSION + + fixed occX = tex2D(_OcclusionMap, xUV).g; + fixed occY = tex2D(_OcclusionMap, yUV).g; + fixed occZ = tex2D(_OcclusionMap, zUV).g; + + o.Occlusion = LerpOneTo( + (occX * IN.powerNormal.x + occY * IN.powerNormal.y + occZ * IN.powerNormal.z), + _OcclusionStrength); + + #else + o.Occlusion = 1.0; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderGUI" + +} diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicNB.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicNB.shader.meta new file mode 100644 index 0000000..cccb0df --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4b4a183588f7044b9bb2f086b44f7621 +timeCreated: 1426794833 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottom.shader b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottom.shader new file mode 100644 index 0000000..ae6f7d6 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottom.shader @@ -0,0 +1,437 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/StandardMetallic/Top-Bottom-Texture" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0, 20)) = 10.0 + _TopMultiplier ("Top Multiplier", Range(0,8)) = 1.0 + _BottomMultiplier ("Bottom Multiplier", Range(0,8)) = 0.0 + _VertexColorStrength("Vertex Color Strength", Range(0,1)) = 1.0 + + // FRONT + + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _Glossiness ("Smoothness", Range(0,1)) = 0.0 + [Gamma] _Metallic ("Metallic", Range(0,1)) = 0.0 + _MetallicGlossMap("Metallic", 2D) = "black" {} + _UsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _EmissionColor("Emission Color", Color) = (0,0,0) + _EmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1,1,1) + + // TOP + + _TopColor ("Color", Color) = (1,1,1,1) + _TopMainTex ("Albedo (RGB)", 2D) = "white" {} + + _TopGlossiness ("Smoothness", Range(0,1)) = 0.0 + [Gamma] _TopMetallic ("Metallic", Range(0,1)) = 0.0 + _TopMetallicGlossMap("Metallic", 2D) = "black" {} + _TopUsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + + _TopBumpScale("Bump Scale", Float) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopEmissionColor("Emission Color", Color) = (0,0,0) + _TopEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _TopEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _TopEmissionColorUI("Color", Color) = (1,1,1) + + // BOTTOM + // bottom is ignored unless _UVFREE_BOTTOM shader feature is turned on + + _BottomColor ("Color", Color) = (1,1,1,1) + _BottomMainTex ("Albedo (RGB)", 2D) = "white" {} + + _BottomGlossiness ("Smoothness", Range(0,1)) = 0.5 + [Gamma] _BottomMetallic ("Metallic", Range(0,1)) = 0.0 + _BottomMetallicGlossMap("Metallic", 2D) = "black" {} + _BottomUsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + + _BottomBumpScale("Bump Scale", Float) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionColor("Emission Color", Color) = (0,0,0) + _BottomEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _BottomEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _BottomEmissionColorUI("Color", Color) = (1,1,1) + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + + LOD 300 + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard vertex:vert fullforwardshadows + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _UVFREE_BOTTOM + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + half _TexPower; + + // FRONT + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Metallic; + fixed _Glossiness; + + + fixed _UsingMetallicGlossMap; + #ifdef _METALLICGLOSSMAP + sampler2D _MetallicGlossMap; + #endif + + #ifdef _EMISSION + sampler2D _EmissionMap; + sampler2D _TopEmissionMap; + half4 _EmissionColor; + half4 _TopEmissionColor; + + #endif + + // TOP + half _TopMultiplier; + fixed4 _TopColor; + sampler2D _TopMainTex; + float4 _TopMainTex_ST; + sampler2D _TopBumpMap; + half _TopBumpScale; + fixed _TopMetallic; + fixed _TopGlossiness; + + #ifdef _METALLICGLOSSMAP + sampler2D _TopMetallicGlossMap; + fixed _TopUsingMetallicGlossMap; + #endif + + // BOTTOM + #ifdef _UVFREE_BOTTOM + half _BottomMultiplier; + fixed4 _BottomColor; + sampler2D _BottomMainTex; + float4 _BottomMainTex_ST; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + + fixed _BottomUsingMetallicGlossMap; + #ifdef _METALLICGLOSSMAP + sampler2D _BottomMetallicGlossMap; + #endif + + fixed _BottomMetallic; + fixed _BottomGlossiness; + + #ifdef _EMISSION + sampler2D _BottomEmissionMap; + half4 _BottomEmissionColor; + #endif + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + + float3 worldPos; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + o.normal = v.normal; + fixed3 powerNormal = v.normal; + fixed3 weightedPowerNormal = v.normal; + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutputStandard o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #if _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP(_Color_arr, _Color); + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #if _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb); + o.Alpha = tex.a; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #if _UVFREE_BOTTOM + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + o.Normal = normalize( + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ); + + // METALLIC/GLOSS + // + + fixed2 mgX = fixed2(_Metallic, _Glossiness); + fixed2 mgY = mgX; + fixed2 mgZ = mgX; + fixed2 mgTop = fixed2(_TopMetallic, _TopGlossiness); + + #ifdef _UVFREE_BOTTOM + fixed2 mgBottom = fixed2(_BottomMetallic, _BottomGlossiness); + #endif + + #ifdef _METALLICGLOSSMAP + #if SHADER_API_D3D9 && _EMISSION + // skip for top and bottom, because there are not enough samplers + #else + mgX = lerp(mgX, tex2D(_MetallicGlossMap, xUV).ra, _UsingMetallicGlossMap); + mgY = lerp(mgY, tex2D(_MetallicGlossMap, yUV).ra, _UsingMetallicGlossMap); + mgZ = lerp(mgZ, tex2D(_MetallicGlossMap, zUV).ra, _UsingMetallicGlossMap); + + mgTop = lerp(mgTop, tex2D(_TopMetallicGlossMap, yUVTop).ra, _TopUsingMetallicGlossMap); + #ifdef _UVFREE_BOTTOM + mgBottom = lerp(mgBottom, tex2D(_BottomMetallicGlossMap, yUVBottom).ra, _BottomUsingMetallicGlossMap); + #endif + #endif + #endif + + mgTop = lerp(mgY, mgTop, topLerp); + + #ifdef _UVFREE_BOTTOM + mgBottom = lerp(mgY, mgBottom, bottomLerp); + mgTop = lerp(mgBottom, mgTop, topBottomLerp); + #else + mgTop = lerp(mgY, mgTop, topBottomLerp); + #endif + + fixed2 mg = + lerp(mgX * IN.powerNormal.x, mgTop * weightedPowerNormal.x, yLerp) + + lerp(mgY * IN.powerNormal.y, mgTop * weightedPowerNormal.y, yLerp) + + lerp(mgZ * IN.powerNormal.z, mgTop * weightedPowerNormal.z, yLerp) + ; + + o.Metallic = mg.x; + o.Smoothness = mg.y; + + // EMISSION + // + + #ifdef _EMISSION + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb; + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderTopBottomGUI" +} + diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottom.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottom.shader.meta new file mode 100644 index 0000000..308ec5a --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottom.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cc1b0f60eb4c244ffb41d05775fdc42c +timeCreated: 1426831563 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottomNB.shader b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottomNB.shader new file mode 100644 index 0000000..b6b94a1 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottomNB.shader @@ -0,0 +1,432 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/StandardMetallic/Top-Bottom-Texture Non-Batched" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0, 20)) = 10.0 + _TopMultiplier ("Top Multiplier", Range(0,8)) = 1.0 + _BottomMultiplier ("Bottom Multiplier", Range(0,8)) = 0.0 + _VertexColorStrength("Vertex Color Strength", Range(0,1)) = 1.0 + + // FRONT + + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _Glossiness ("Smoothness", Range(0,1)) = 0.0 + [Gamma] _Metallic ("Metallic", Range(0,1)) = 0.0 + _MetallicGlossMap("Metallic", 2D) = "black" {} + _UsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _EmissionColor("Emission Color", Color) = (0,0,0) + _EmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1,1,1) + + // TOP + + _TopColor ("Color", Color) = (1,1,1,1) + _TopMainTex ("Albedo (RGB)", 2D) = "white" {} + + _TopGlossiness ("Smoothness", Range(0,1)) = 0.0 + [Gamma] _TopMetallic ("Metallic", Range(0,1)) = 0.0 + _TopMetallicGlossMap("Metallic", 2D) = "black" {} + _TopUsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + + _TopBumpScale("Bump Scale", Float) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopEmissionColor("Emission Color", Color) = (0,0,0) + _TopEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _TopEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _TopEmissionColorUI("Color", Color) = (1,1,1) + + // BOTTOM + // bottom is ignored unless _UVFREE_BOTTOM shader feature is turned on + + _BottomColor ("Color", Color) = (1,1,1,1) + _BottomMainTex ("Albedo (RGB)", 2D) = "white" {} + + _BottomGlossiness ("Smoothness", Range(0,1)) = 0.5 + [Gamma] _BottomMetallic ("Metallic", Range(0,1)) = 0.0 + _BottomMetallicGlossMap("Metallic", 2D) = "black" {} + _BottomUsingMetallicGlossMap("Using Metallic Gloss Map", float) = 0.0 + + _BottomBumpScale("Bump Scale", Float) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionColor("Emission Color", Color) = (0,0,0) + _BottomEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _BottomEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _BottomEmissionColorUI("Color", Color) = (1,1,1) + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + + LOD 300 + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard vertex:vert fullforwardshadows + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _UVFREE_BOTTOM + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + half _TexPower; + + // FRONT + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Metallic; + fixed _Glossiness; + + + fixed _UsingMetallicGlossMap; + #ifdef _METALLICGLOSSMAP + sampler2D _MetallicGlossMap; + #endif + + #ifdef _EMISSION + sampler2D _EmissionMap; + sampler2D _TopEmissionMap; + half4 _EmissionColor; + half4 _TopEmissionColor; + + #endif + + // TOP + half _TopMultiplier; + fixed4 _TopColor; + sampler2D _TopMainTex; + float4 _TopMainTex_ST; + sampler2D _TopBumpMap; + half _TopBumpScale; + fixed _TopMetallic; + fixed _TopGlossiness; + + #ifdef _METALLICGLOSSMAP + sampler2D _TopMetallicGlossMap; + fixed _TopUsingMetallicGlossMap; + #endif + + // BOTTOM + #ifdef _UVFREE_BOTTOM + half _BottomMultiplier; + fixed4 _BottomColor; + sampler2D _BottomMainTex; + float4 _BottomMainTex_ST; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + + fixed _BottomUsingMetallicGlossMap; + #ifdef _METALLICGLOSSMAP + sampler2D _BottomMetallicGlossMap; + #endif + + fixed _BottomMetallic; + fixed _BottomGlossiness; + + #ifdef _EMISSION + sampler2D _BottomEmissionMap; + half4 _BottomEmissionColor; + #endif + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + + float3 worldPos; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + o.normal = v.normal; + fixed3 powerNormal = v.normal; + fixed3 weightedPowerNormal = v.normal; + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutputStandard o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #if _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP(_Color_arr, _Color); + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #if _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb); + o.Alpha = tex.a; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #if _UVFREE_BOTTOM + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + o.Normal = normalize( + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ); + + // METALLIC/GLOSS + // + + fixed2 mgX = fixed2(_Metallic, _Glossiness); + fixed2 mgY = mgX; + fixed2 mgZ = mgX; + fixed2 mgTop = fixed2(_TopMetallic, _TopGlossiness); + + #ifdef _UVFREE_BOTTOM + fixed2 mgBottom = fixed2(_BottomMetallic, _BottomGlossiness); + #endif + + #ifdef _METALLICGLOSSMAP + #if SHADER_API_D3D9 && _EMISSION + // skip for top and bottom, because there are not enough samplers + #else + mgX = lerp(mgX, tex2D(_MetallicGlossMap, xUV).ra, _UsingMetallicGlossMap); + mgY = lerp(mgY, tex2D(_MetallicGlossMap, yUV).ra, _UsingMetallicGlossMap); + mgZ = lerp(mgZ, tex2D(_MetallicGlossMap, zUV).ra, _UsingMetallicGlossMap); + + mgTop = lerp(mgTop, tex2D(_TopMetallicGlossMap, yUVTop).ra, _TopUsingMetallicGlossMap); + #ifdef _UVFREE_BOTTOM + mgBottom = lerp(mgBottom, tex2D(_BottomMetallicGlossMap, yUVBottom).ra, _BottomUsingMetallicGlossMap); + #endif + #endif + #endif + + mgTop = lerp(mgY, mgTop, topLerp); + + #ifdef _UVFREE_BOTTOM + mgBottom = lerp(mgY, mgBottom, bottomLerp); + mgTop = lerp(mgBottom, mgTop, topBottomLerp); + #else + mgTop = lerp(mgY, mgTop, topBottomLerp); + #endif + + fixed2 mg = + lerp(mgX * IN.powerNormal.x, mgTop * weightedPowerNormal.x, yLerp) + + lerp(mgY * IN.powerNormal.y, mgTop * weightedPowerNormal.y, yLerp) + + lerp(mgZ * IN.powerNormal.z, mgTop * weightedPowerNormal.z, yLerp) + ; + + o.Metallic = mg.x; + o.Smoothness = mg.y; + + // EMISSION + // + + #ifdef _EMISSION + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb; + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderTopBottomGUI" +} + diff --git a/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottomNB.shader.meta b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottomNB.shader.meta new file mode 100644 index 0000000..12f1962 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Metallic/UVFreeStandardMetallicTopBottomNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d8cd05889c49f4d36a42c72f6529b1e0 +timeCreated: 1426831563 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain.meta b/Shaders/UVFree/Standard PBR/Standard Specular Terrain.meta new file mode 100644 index 0000000..71d50e5 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0b05b2893f35c4e57956c54852900435 +folderAsset: yes +timeCreated: 1427422590 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-AddPass.shader b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-AddPass.shader new file mode 100644 index 0000000..d670a21 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-AddPass.shader @@ -0,0 +1,267 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/UVFree/Terrain/StandardSpecular-AddPass" { + Properties { + _TexPower("Texture Power", Range (0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1.0) + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + [HideInInspector] _Smoothness0 ("Smoothness 0", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness1 ("Smoothness 1", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness2 ("Smoothness 2", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness3 ("Smoothness 3", Range(0.0, 1.0)) = 1.0 + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-99" + "IgnoreProjector"="True" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf StandardSpecular decal:add vertex:SplatmapVert finalcolor:SplatmapFinalColor fullforwardshadows + #define TERRAIN_SPLAT_ADDPASS + #define TERRAIN_SURFACE_OUTPUT SurfaceOutputStandardSpecular + + #pragma multi_compile_fog + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + #include "UnityPBSLighting.cginc" + + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + fixed _Smoothness0, _Smoothness1, _Smoothness2, _Smoothness3; + + half _TexPower; + half _BumpScale; + float _UVScale; + + struct Input + { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0 * fixed4(1.0, 1.0, 1.0, _Smoothness0); + mixedDiffuse += splat_control.g * tex1 * fixed4(1.0, 1.0, 1.0, _Smoothness1); + mixedDiffuse += splat_control.b * tex2 * fixed4(1.0, 1.0, 1.0, _Smoothness2); + mixedDiffuse += splat_control.a * tex3 * fixed4(1.0, 1.0, 1.0, _Smoothness3); + + o.Albedo = max(fixed3(0.0, 0.0, 0.0),mixedDiffuse.rgb); + o.Alpha = weight; + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + o.Smoothness = mixedDiffuse.a; + o.Specular = _SpecColor.rgb * mixedDiffuse.rgb; + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + + Fallback "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-AddPass.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-AddPass.shader.meta new file mode 100644 index 0000000..678a131 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-AddPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7e3af7d341f674531bc6b8e837af9d37 +timeCreated: 1427314227 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-Base.shader b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-Base.shader new file mode 100644 index 0000000..bf48e4e --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-Base.shader @@ -0,0 +1,50 @@ +Shader "Hidden/UVFree/Terrain/StandardSpecular-Base" { + Properties { + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1.0) + _Smoothness ("Smoothness", Range (0.03, 1)) = 0.078125 + + _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} + + // used in fallback on old cards + _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + } + + SubShader { + Tags { + "RenderType" = "Opaque" + "Queue" = "Geometry-100" + } + LOD 200 + + CGPROGRAM + #pragma surface surf StandardSpecular fullforwardshadows + #pragma target 3.0 + #pragma exclude_renderers gles + #include "UnityPBSLighting.cginc" + + sampler2D _MainTex; + fixed _Smoothness; + + struct Input { + float2 uv_MainTex; + }; + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + half4 c = tex2D (_MainTex, IN.uv_MainTex); + o.Albedo = max(fixed3(0.001, 0.001, 0.001),c.rgb); + o.Alpha = 1.0; + + #ifdef _TERRAIN_OVERRIDE_SMOOTHNESS + o.Smoothness = _Smoothness; + #else + o.Smoothness = c.a; + #endif + + o.Specular = _SpecColor; + } + + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-Base.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-Base.shader.meta new file mode 100644 index 0000000..f6c9a19 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardSpecular-Base.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 13504394cfd4f420b90356efe9ec74fa +timeCreated: 1427314224 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardspecular-FirstPass.shader b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardspecular-FirstPass.shader new file mode 100644 index 0000000..03d0035 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardspecular-FirstPass.shader @@ -0,0 +1,271 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "UVFree/Terrain/StandardSpecular" { + Properties { + _TexPower("Texture Power", Range (0.0, 20.0)) = 10.0 + _UVScale("Texture Scale %", Float) = 100.0 + _BumpScale("Bump Scale", Range(-2.0, 2.0)) = 1.0 + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1.0) + + // set by terrain engine + [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} + [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} + [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} + [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} + [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} + [HideInInspector] _Normal3 ("Normal 3 (A)", 2D) = "bump" {} + [HideInInspector] _Normal2 ("Normal 2 (B)", 2D) = "bump" {} + [HideInInspector] _Normal1 ("Normal 1 (G)", 2D) = "bump" {} + [HideInInspector] _Normal0 ("Normal 0 (R)", 2D) = "bump" {} + [HideInInspector] _Smoothness0 ("Smoothness 0", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness1 ("Smoothness 1", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness2 ("Smoothness 2", Range(0.0, 1.0)) = 1.0 + [HideInInspector] _Smoothness3 ("Smoothness 3", Range(0.0, 1.0)) = 1.0 + + // used in fallback on old cards & base map + [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} + [HideInInspector] _Color ("Main Color", Color) = (1.0,1.0,1.0,1.0) + + } + + SubShader { + Tags { + "SplatCount" = "4" + "Queue" = "Geometry-100" + "RenderType" = "Opaque" + } + + CGPROGRAM + #pragma surface surf StandardSpecular vertex:SplatmapVert finalcolor:SplatmapFinalColor fullforwardshadows + #define TERRAIN_SURFACE_OUTPUT SurfaceOutputStandardSpecular + + #pragma multi_compile_fog + #pragma target 3.0 + // needs more than 8 texcoords + #pragma exclude_renderers gles + #include "UnityPBSLighting.cginc" + + #pragma multi_compile __ _TERRAIN_NORMAL_MAP + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + sampler2D _Control; + float4 _Control_ST; + sampler2D _Splat0,_Splat1,_Splat2,_Splat3; + half4 _Splat0_ST, _Splat1_ST, _Splat2_ST, _Splat3_ST; + + #ifdef _TERRAIN_NORMAL_MAP + sampler2D _Normal0, _Normal1, _Normal2, _Normal3; + #endif + fixed _Smoothness0, _Smoothness1, _Smoothness2, _Smoothness3; + + half _TexPower; + half _BumpScale; + float _UVScale; + + struct Input + { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + + float2 tc_Control : TEXCOORD4; // Not prefixing '_Control' with 'uv' allows a tighter packing of interpolators, which is necessary to support directional lightmap. + UNITY_FOG_COORDS(5) + }; + + void SplatmapVert(inout appdata_full v, out Input o) + { + UNITY_INITIALIZE_OUTPUT(Input,o); + + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + fixed3 powerNormal = pow(abs(worldNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, half3(1.0,1.0,1.0)); + + o.powerNormal = powerNormal; + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (powerNormal.x)) + + (-(worldNormal.y) * (powerNormal.y)) + + (-(worldNormal.z) * (powerNormal.z)) + ; + + // Need to manually transform uv here, + // as we choose not to use 'uv' prefix for this texcoord. + o.tc_Control = TRANSFORM_TEX(v.texcoord, _Control); + float4 pos = UnityObjectToClipPos (v.vertex); + UNITY_TRANSFER_FOG(o, pos); + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + + // world space positions along the axis planes + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + float2 xUV = float2(powerSign.x, 1.0); + float2 zUV = float2(powerSign.z, 1.0); + float2 yUV = float2(1.0, powerSign.y); + #else + float2 xUV = float2(1.0, 1.0); + float2 zUV = xUV; + float2 yUV = xUV; + #endif + + half4 splat_control; + half weight; + fixed4 mixedDiffuse; + + splat_control = tex2D(_Control, IN.tc_Control); + weight = dot(splat_control, half4(1.0,1.0,1.0,1.0)); + + #ifndef UNITY_PASS_DEFERRED + splat_control /= (weight + 1e-3f); // avoid NaNs in splat_control + #endif + + #if !defined(SHADER_API_MOBILE) && defined(TERRAIN_SPLAT_ADDPASS) + clip(weight - 0.0039); + #endif + + fixed4 texX0 = tex2D(_Splat0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale); + fixed4 texY0 = tex2D(_Splat0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale); + fixed4 texZ0 = tex2D(_Splat0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale); + + fixed4 texX1 = tex2D(_Splat1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale); + fixed4 texY1 = tex2D(_Splat1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale); + fixed4 texZ1 = tex2D(_Splat1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale); + + fixed4 texX2 = tex2D(_Splat2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale); + fixed4 texY2 = tex2D(_Splat2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale); + fixed4 texZ2 = tex2D(_Splat2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale); + + fixed4 texX3 = tex2D(_Splat3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale); + fixed4 texY3 = tex2D(_Splat3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale); + fixed4 texZ3 = tex2D(_Splat3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale); + + + fixed4 tex0 = + + texX0 * IN.powerNormal.x + + texY0 * IN.powerNormal.y + + texZ0 * IN.powerNormal.z; + + fixed4 tex1 = + + texX1 * IN.powerNormal.x + + texY1 * IN.powerNormal.y + + texZ1 * IN.powerNormal.z; + + fixed4 tex2 = + + texX2 * IN.powerNormal.x + + texY2 * IN.powerNormal.y + + texZ2 * IN.powerNormal.z; + + fixed4 tex3 = + + texX3 * IN.powerNormal.x + + texY3 * IN.powerNormal.y + + texZ3 * IN.powerNormal.z; + + mixedDiffuse = 0.0f; + mixedDiffuse += splat_control.r * tex0 * fixed4(1.0, 1.0, 1.0, _Smoothness0); + mixedDiffuse += splat_control.g * tex1 * fixed4(1.0, 1.0, 1.0, _Smoothness1); + mixedDiffuse += splat_control.b * tex2 * fixed4(1.0, 1.0, 1.0, _Smoothness2); + mixedDiffuse += splat_control.a * tex3 * fixed4(1.0, 1.0, 1.0, _Smoothness3); + + o.Albedo = max(fixed3(0.0, 0.0, 0.0),mixedDiffuse.rgb); + o.Alpha = weight; + + #ifdef _TERRAIN_NORMAL_MAP + + // NORMAL + // + fixed4 flatNormal = fixed4(0.5,0.5,1.0,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases + + fixed4 bumpX0 = tex2D(_Normal0, (posX * _Splat0_ST.xy + _Splat0_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY0 = tex2D(_Normal0, (posY * _Splat0_ST.xy + _Splat0_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ0 = tex2D(_Normal0, (posZ * _Splat0_ST.xy + _Splat0_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX1 = tex2D(_Normal1, (posX * _Splat1_ST.xy + _Splat1_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY1 = tex2D(_Normal1, (posY * _Splat1_ST.xy + _Splat1_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ1 = tex2D(_Normal1, (posZ * _Splat1_ST.xy + _Splat1_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX2 = tex2D(_Normal2, (posX * _Splat2_ST.xy + _Splat2_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY2 = tex2D(_Normal2, (posY * _Splat2_ST.xy + _Splat2_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ2 = tex2D(_Normal2, (posZ * _Splat2_ST.xy + _Splat2_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bumpX3 = tex2D(_Normal3, (posX * _Splat3_ST.xy + _Splat3_ST.zw)*xUV/_UVScale) - flatNormal; + fixed4 bumpY3 = tex2D(_Normal3, (posY * _Splat3_ST.xy + _Splat3_ST.zw)*yUV/_UVScale) - flatNormal; + fixed4 bumpZ3 = tex2D(_Normal3, (posZ * _Splat3_ST.xy + _Splat3_ST.zw)*zUV/_UVScale) - flatNormal; + + fixed4 bump0 = + + bumpX0 * IN.powerNormal.x + + bumpY0 * IN.powerNormal.y + + bumpZ0 * IN.powerNormal.z; + + fixed4 bump1 = + + bumpX1 * IN.powerNormal.x + + bumpY1 * IN.powerNormal.y + + bumpZ1 * IN.powerNormal.z; + + fixed4 bump2 = + + bumpX2 * IN.powerNormal.x + + bumpY2 * IN.powerNormal.y + + bumpZ2 * IN.powerNormal.z; + + fixed4 bump3 = + + bumpX3 * IN.powerNormal.x + + bumpY3 * IN.powerNormal.y + + bumpZ3 * IN.powerNormal.z; + + fixed4 bump = + splat_control.r * bump0 + + splat_control.g * bump1 + + splat_control.b * bump2 + + splat_control.a * bump3; + bump *= _BumpScale; + + bump += flatNormal; + + o.Normal = UnpackNormal(bump); + + #endif + + o.Smoothness = mixedDiffuse.a; + o.Specular = _SpecColor.rgb * mixedDiffuse.rgb; + } + + void SplatmapFinalColor(Input IN, TERRAIN_SURFACE_OUTPUT o, inout fixed4 color) + { + color *= o.Alpha; + #ifdef TERRAIN_SPLAT_ADDPASS + UNITY_APPLY_FOG_COLOR(IN.fogCoord, color, fixed4(0,0,0,0)); + #else + UNITY_APPLY_FOG(IN.fogCoord, color); + #endif + } + + ENDCG + } + + Dependency "AddPassShader" = "Hidden/UVFree/Terrain/StandardSpecular-AddPass" + Dependency "BaseMapShader" = "Hidden/UVFree/Terrain/StandardSpecular-Base" + + Fallback "Nature/Terrain/Diffuse" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardspecular-FirstPass.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardspecular-FirstPass.shader.meta new file mode 100644 index 0000000..67c116d --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular Terrain/UVFreeTerrainStandardspecular-FirstPass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cd37e0b49bce84f099a62f77d42e8a90 +timeCreated: 1427314231 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular.meta b/Shaders/UVFree/Standard PBR/Standard Specular.meta new file mode 100644 index 0000000..d977a47 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 45d491b295c2147108081df19e215aa4 +folderAsset: yes +timeCreated: 1426831333 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecular.shader b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecular.shader new file mode 100644 index 0000000..796f51b --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecular.shader @@ -0,0 +1,407 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/StandardSpecular/Single-Texture" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + + _Color ("Color", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 1.0 + + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _SpecColor("Specular", Color) = (0.2,0.2,0.2) + _SpecGlossMap("Specular", 2D) = "white" {} + _UsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 + _ParallaxMap ("Height Map", 2D) = "black" {} + + _OcclusionStrength("Occlusion Strength", Range(0.0, 1.0)) = 1.0 + _OcclusionMap("Occlusion", 2D) = "white" {} + + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _DetailMask("Detail Mask", 2D) = "white" {} + + _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} + _DetailNormalMapScale("Scale", Float) = 1.0 + _DetailNormalMap("Normal Map", 2D) = "bump" {} + + // UI-only data + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1.0,1.0,1.0) + + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + + LOD 300 + + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf StandardSpecular vertex:vert fullforwardshadows + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _SPECGLOSSMAP + #pragma shader_feature _DETAIL + #pragma shader_feature _OCCLUSION + #pragma shader_feature _PARALLAXMAP + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + half _TexPower; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Glossiness; + + #ifdef _DETAIL + sampler2D _DetailAlbedoMap; + float4 _DetailAlbedoMap_ST; + sampler2D _DetailMask; + sampler2D _DetailNormalMap; + half _DetailNormalMapScale; + #endif + + #ifdef _SPECGLOSSMAP + sampler2D _SpecGlossMap; + fixed _UsingSpecGlossMap; + #endif + + #ifdef _OCCLUSION + sampler2D _OcclusionMap; + fixed _OcclusionStrength; + #endif + + #ifdef _PARALLAXMAP + sampler2D _ParallaxMap; + half _Parallax; + #endif + + #ifdef _EMISSION + sampler2D _EmissionMap; + half4 _EmissionColor; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + half _UVSec; + + struct Input { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + fixed3 viewDirForParallax; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (o.powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (o.powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (o.powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (o.powerNormal.x)) + + (-(worldNormal.y) * (o.powerNormal.y)) + + (-(worldNormal.z) * (o.powerNormal.z)) + ; + #endif + + #ifdef _PARALLAXMAP + TANGENT_SPACE_ROTATION; + o.viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex)); + #endif + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float3 pos = IN.worldPos; + + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + // PARALLAX + // + + #ifdef _PARALLAXMAP + + half parallaxX = tex2D (_ParallaxMap, xUV).r; + half parallaxY = tex2D (_ParallaxMap, yUV).g; + half parallaxZ = tex2D (_ParallaxMap, zUV).b; + + half parallax = + parallaxX * IN.powerNormal.x + + parallaxY * IN.powerNormal.y + + parallaxZ * IN.powerNormal.z + ; + float2 parallaxOffset = ParallaxOffset (parallax, _Parallax, IN.viewDirForParallax); + xUV += parallaxOffset; + yUV += parallaxOffset; + zUV += parallaxOffset; + + #endif + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + fixed3 albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb * tint.rgb); + + + // DIFFUSE DETAIL + // + + #ifdef _DETAIL + fixed detailMaskX = tex2D(_DetailMask, xUV).a; + fixed detailMaskY = tex2D(_DetailMask, yUV).a; + fixed detailMaskZ = tex2D(_DetailMask, zUV).a; + + fixed detailMask = + detailMaskX * IN.powerNormal.x + + detailMaskY * IN.powerNormal.y + + detailMaskZ * IN.powerNormal.z; + + float2 xUVDetail = pos.zy * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 yUVDetail = pos.xz * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 zUVDetail = float2(-pos.x, pos.y) * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + xUVDetail.x *= powerSign.x; + zUVDetail.x *= powerSign.z; + yUVDetail.y *= powerSign.y; + #endif + + #ifdef _PARALLAXMAP + xUVDetail += parallaxOffset; + yUVDetail += parallaxOffset; + zUVDetail += parallaxOffset; + #endif + + fixed3 detailAlbedoX = tex2D (_DetailAlbedoMap, xUVDetail).rgb; + fixed3 detailAlbedoY = tex2D (_DetailAlbedoMap, yUVDetail).rgb; + fixed3 detailAlbedoZ = tex2D (_DetailAlbedoMap, zUVDetail).rgb; + + fixed3 detailAlbedo = + detailAlbedoX * IN.powerNormal.x + + detailAlbedoY * IN.powerNormal.y + + detailAlbedoZ * IN.powerNormal.z; + + albedo *= LerpWhiteTo (detailAlbedo * unity_ColorSpaceDouble.rgb, detailMask); + #endif + o.Albedo = albedo; + o.Alpha = tex.a * tint.a; + + + // NORMAL + // + + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + // NORMAL DETAIL + // + #ifdef _DETAIL + fixed3 detailNormalTangentX = UnpackScaleNormal(tex2D (_DetailNormalMap, xUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentY = UnpackScaleNormal(tex2D (_DetailNormalMap, yUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentZ = UnpackScaleNormal(tex2D (_DetailNormalMap, zUVDetail), _DetailNormalMapScale); + + fixed3 detailNormalTangent = + detailNormalTangentX * IN.powerNormal.x + + detailNormalTangentY * IN.powerNormal.y + + detailNormalTangentZ * IN.powerNormal.z; + + bump = lerp( + bump, + BlendNormals(bump, detailNormalTangent), + detailMask); + + #endif + + o.Normal = normalize(bump); + + + // SPECULAR/GLOSS + // + + fixed4 sg = fixed4( + _SpecColor.rgb, + _Glossiness + ); + + #ifdef _SPECGLOSSMAP + fixed4 sgX = lerp(sg, tex2D(_SpecGlossMap, xUV), _UsingSpecGlossMap); + fixed4 sgY = lerp(sg, tex2D(_SpecGlossMap, yUV), _UsingSpecGlossMap); + fixed4 sgZ = lerp(sg, tex2D(_SpecGlossMap, zUV), _UsingSpecGlossMap); + + sg = + sgX * IN.powerNormal.x + + sgY * IN.powerNormal.y + + sgZ * IN.powerNormal.z; + #endif + + o.Specular = sg.rgb; + o.Smoothness = sg.a; + + // EMISSION + // + + #ifndef _EMISSION + o.Emission = 0.0; + #else + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + + o.Emission = (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb; + + #endif + + // OCCLUSION + // + + #ifdef _OCCLUSION + + fixed occX = tex2D(_OcclusionMap, xUV).g; + fixed occY = tex2D(_OcclusionMap, yUV).g; + fixed occZ = tex2D(_OcclusionMap, zUV).g; + + o.Occlusion = LerpOneTo( + (occX * IN.powerNormal.x + occY * IN.powerNormal.y + occZ * IN.powerNormal.z), + _OcclusionStrength); + + #else + o.Occlusion = 1.0; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderGUI" + +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecular.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecular.shader.meta new file mode 100644 index 0000000..f8e26c1 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecular.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b037cc9f7b4b34ed8be6c81e1b20c146 +timeCreated: 1426794818 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularNB.shader b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularNB.shader new file mode 100644 index 0000000..cd50e59 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularNB.shader @@ -0,0 +1,402 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/StandardSpecular/Single-Texture Non-Batching" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + + _Color ("Color", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 1.0 + + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _SpecColor("Specular", Color) = (0.2,0.2,0.2) + _SpecGlossMap("Specular", 2D) = "white" {} + _UsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 + _ParallaxMap ("Height Map", 2D) = "black" {} + + _OcclusionStrength("Occlusion Strength", Range(0.0, 1.0)) = 1.0 + _OcclusionMap("Occlusion", 2D) = "white" {} + + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + _DetailMask("Detail Mask", 2D) = "white" {} + + _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} + _DetailNormalMapScale("Scale", Float) = 1.0 + _DetailNormalMap("Normal Map", 2D) = "bump" {} + + // UI-only data + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1.0,1.0,1.0) + + } + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + + LOD 300 + + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf StandardSpecular vertex:vert fullforwardshadows + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _SPECGLOSSMAP + #pragma shader_feature _DETAIL + #pragma shader_feature _OCCLUSION + #pragma shader_feature _PARALLAXMAP + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + // Non-instanced properties + half _TexPower; + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Glossiness; + + #ifdef _DETAIL + sampler2D _DetailAlbedoMap; + float4 _DetailAlbedoMap_ST; + sampler2D _DetailMask; + sampler2D _DetailNormalMap; + half _DetailNormalMapScale; + #endif + + #ifdef _SPECGLOSSMAP + sampler2D _SpecGlossMap; + fixed _UsingSpecGlossMap; + #endif + + #ifdef _OCCLUSION + sampler2D _OcclusionMap; + fixed _OcclusionStrength; + #endif + + #ifdef _PARALLAXMAP + sampler2D _ParallaxMap; + half _Parallax; + #endif + + #ifdef _EMISSION + sampler2D _EmissionMap; + half4 _EmissionColor; + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + half _UVSec; + + struct Input { + fixed3 powerNormal; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 normal; + #endif + + float3 worldPos; + fixed3 viewDirForParallax; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = v.normal; + #endif + o.powerNormal = pow(abs(v.normal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (o.powerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (o.powerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (o.powerNormal.z) + ; + + v.tangent.w = + (-(v.normal.x) * (o.powerNormal.x)) + + (-(v.normal.y) * (o.powerNormal.y)) + + (-(v.normal.z) * (o.powerNormal.z)) + ; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + o.normal = worldNormal; + #endif + o.powerNormal = pow(abs(worldNormal), _TexPower); + o.powerNormal = max(o.powerNormal, 0.0001); + o.powerNormal /= dot(o.powerNormal, 1.0); + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (o.powerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (o.powerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (o.powerNormal.z)) + ; + + v.tangent.w = + (-(worldNormal.x) * (o.powerNormal.x)) + + (-(worldNormal.y) * (o.powerNormal.y)) + + (-(worldNormal.z) * (o.powerNormal.z)) + ; + #endif + + #ifdef _PARALLAXMAP + TANGENT_SPACE_ROTATION; + o.viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex)); + #endif + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float3 pos = IN.worldPos; + + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + #endif + + // PARALLAX + // + + #ifdef _PARALLAXMAP + + half parallaxX = tex2D (_ParallaxMap, xUV).r; + half parallaxY = tex2D (_ParallaxMap, yUV).g; + half parallaxZ = tex2D (_ParallaxMap, zUV).b; + + half parallax = + parallaxX * IN.powerNormal.x + + parallaxY * IN.powerNormal.y + + parallaxZ * IN.powerNormal.z + ; + float2 parallaxOffset = ParallaxOffset (parallax, _Parallax, IN.viewDirForParallax); + xUV += parallaxOffset; + yUV += parallaxOffset; + zUV += parallaxOffset; + + #endif + + // DIFFUSE + // + + fixed4 texX = tex2D(_MainTex, xUV); + fixed4 texY = tex2D(_MainTex, yUV); + fixed4 texZ = tex2D(_MainTex, zUV); + + fixed4 tex = + texX * IN.powerNormal.x + + texY * IN.powerNormal.y + + texZ * IN.powerNormal.z; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP (_Color_arr, _Color); + fixed3 albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb * tint.rgb); + + + // DIFFUSE DETAIL + // + + #ifdef _DETAIL + fixed detailMaskX = tex2D(_DetailMask, xUV).a; + fixed detailMaskY = tex2D(_DetailMask, yUV).a; + fixed detailMaskZ = tex2D(_DetailMask, zUV).a; + + fixed detailMask = + detailMaskX * IN.powerNormal.x + + detailMaskY * IN.powerNormal.y + + detailMaskZ * IN.powerNormal.z; + + float2 xUVDetail = pos.zy * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 yUVDetail = pos.xz * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + float2 zUVDetail = float2(-pos.x, pos.y) * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + xUVDetail.x *= powerSign.x; + zUVDetail.x *= powerSign.z; + yUVDetail.y *= powerSign.y; + #endif + + #ifdef _PARALLAXMAP + xUVDetail += parallaxOffset; + yUVDetail += parallaxOffset; + zUVDetail += parallaxOffset; + #endif + + fixed3 detailAlbedoX = tex2D (_DetailAlbedoMap, xUVDetail).rgb; + fixed3 detailAlbedoY = tex2D (_DetailAlbedoMap, yUVDetail).rgb; + fixed3 detailAlbedoZ = tex2D (_DetailAlbedoMap, zUVDetail).rgb; + + fixed3 detailAlbedo = + detailAlbedoX * IN.powerNormal.x + + detailAlbedoY * IN.powerNormal.y + + detailAlbedoZ * IN.powerNormal.z; + + albedo *= LerpWhiteTo (detailAlbedo * unity_ColorSpaceDouble.rgb, detailMask); + #endif + o.Albedo = albedo; + o.Alpha = tex.a * tint.a; + + + // NORMAL + // + + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bump = + bumpX * IN.powerNormal.x + + bumpY * IN.powerNormal.y + + bumpZ * IN.powerNormal.z + ; + + // NORMAL DETAIL + // + #ifdef _DETAIL + fixed3 detailNormalTangentX = UnpackScaleNormal(tex2D (_DetailNormalMap, xUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentY = UnpackScaleNormal(tex2D (_DetailNormalMap, yUVDetail), _DetailNormalMapScale); + fixed3 detailNormalTangentZ = UnpackScaleNormal(tex2D (_DetailNormalMap, zUVDetail), _DetailNormalMapScale); + + fixed3 detailNormalTangent = + detailNormalTangentX * IN.powerNormal.x + + detailNormalTangentY * IN.powerNormal.y + + detailNormalTangentZ * IN.powerNormal.z; + + bump = lerp( + bump, + BlendNormals(bump, detailNormalTangent), + detailMask); + + #endif + + o.Normal = normalize(bump); + + + // SPECULAR/GLOSS + // + + fixed4 sg = fixed4( + _SpecColor.rgb, + _Glossiness + ); + + #ifdef _SPECGLOSSMAP + fixed4 sgX = lerp(sg, tex2D(_SpecGlossMap, xUV), _UsingSpecGlossMap); + fixed4 sgY = lerp(sg, tex2D(_SpecGlossMap, yUV), _UsingSpecGlossMap); + fixed4 sgZ = lerp(sg, tex2D(_SpecGlossMap, zUV), _UsingSpecGlossMap); + + sg = + sgX * IN.powerNormal.x + + sgY * IN.powerNormal.y + + sgZ * IN.powerNormal.z; + #endif + + o.Specular = sg.rgb; + o.Smoothness = sg.a; + + // EMISSION + // + + #ifndef _EMISSION + o.Emission = 0.0; + #else + fixed3 emissionX = tex2D(_EmissionMap, xUV).rgb; + fixed3 emissionY = tex2D(_EmissionMap, yUV).rgb; + fixed3 emissionZ = tex2D(_EmissionMap, zUV).rgb; + + o.Emission = (emissionX * IN.powerNormal.x + emissionY * IN.powerNormal.y + emissionZ * IN.powerNormal.z) + * _EmissionColor.rgb; + + #endif + + // OCCLUSION + // + + #ifdef _OCCLUSION + + fixed occX = tex2D(_OcclusionMap, xUV).g; + fixed occY = tex2D(_OcclusionMap, yUV).g; + fixed occZ = tex2D(_OcclusionMap, zUV).g; + + o.Occlusion = LerpOneTo( + (occX * IN.powerNormal.x + occY * IN.powerNormal.y + occZ * IN.powerNormal.z), + _OcclusionStrength); + + #else + o.Occlusion = 1.0; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderGUI" + +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularNB.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularNB.shader.meta new file mode 100644 index 0000000..c51d78d --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 85b575738c24e452dae1e4251469cee7 +timeCreated: 1426794818 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottom.shader b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottom.shader new file mode 100644 index 0000000..c16f3de --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottom.shader @@ -0,0 +1,445 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +// Use the non-batching version of this shader if you are using +// local mode, and are seeing the textures move when you zoom in +// due to dynamic batching. (Dynamic batching converts local vertex +// data into world space, making local vertex position data unavailable +// to the shader.) + +Shader "UVFree/StandardSpecular/Top-Bottom-Texture" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + + _TopMultiplier ("Top Multiplier", Range(0.0,8.0)) = 1.0 + _BottomMultiplier ("Bottom Multiplier", Range(0.0,8.0)) = 0.0 + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 1.0 + + // FRONT + + _Color ("Color", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _SpecColor("Specular", Color) = (0.2,0.2,0.2) + _SpecGlossMap("Specular", 2D) = "white" {} + + _UsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1.0,1.0,1.0) + + // TOP + + _TopColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _TopMainTex ("Albedo (RGB)", 2D) = "white" {} + + _TopGlossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _TopSpecColor("Specular", Color) = (0.2,0.2,0.2) + _TopSpecGlossMap("Specular", 2D) = "white" {} + + _TopUsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _TopBumpScale("Bump Scale", Float) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _TopEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _TopEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _TopEmissionColorUI("Color", Color) = (1,1,1) + + // BOTTOM + // bottom is ignored unless _UVFREE_BOTTOM shader feature is turned on + + _BottomColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _BottomMainTex ("Albedo (RGB)", 2D) = "white" {} + + _BottomGlossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _BottomSpecColor("Specular", Color) = (0.2,0.2,0.2) + _BottomSpecGlossMap("Specular", 2D) = "white" {} + + _BottomUsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _BottomBumpScale("Bump Scale", Float) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _BottomEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _BottomEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _BottomEmissionColorUI("Color", Color) = (1.0,1.0,1.0) + } + + + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + } + + LOD 300 + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf StandardSpecular vertex:vert fullforwardshadows + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _SPECGLOSSMAP + #pragma shader_feature _UVFREE_BOTTOM + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + half _TexPower; + + // FRONT + + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Glossiness; + + #ifdef _SPECGLOSSMAP + sampler2D _SpecGlossMap; + fixed _UsingSpecGlossMap; + #endif + + #ifdef _EMISSION + half4 _EmissionColor; + sampler2D _EmissionMap; + sampler2D _TopEmissionMap; + half4 _TopEmissionColor; + #endif + + // TOP + half _TopMultiplier; + fixed4 _TopColor; + sampler2D _TopMainTex; + float4 _TopMainTex_ST; + sampler2D _TopBumpMap; + half _TopBumpScale; + fixed _TopGlossiness; + fixed4 _TopSpecColor; + + #ifdef _SPECGLOSSMAP + sampler2D _TopSpecGlossMap; + fixed _TopUsingSpecGlossMap; + #endif + + + // BOTTOM + + #ifdef _UVFREE_BOTTOM + half _BottomMultiplier; + fixed4 _BottomColor; + sampler2D _BottomMainTex; + float4 _BottomMainTex_ST; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + fixed4 _BottomSpecColor; + fixed _BottomGlossiness; + + #ifdef _SPECGLOSSMAP + sampler2D _BottomSpecGlossMap; + fixed _BottomUsingSpecGlossMap; + #endif + + #ifdef _EMISSION + sampler2D _BottomEmissionMap; + half4 _BottomEmissionColor; + #endif + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + float3 worldPos; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + fixed3 powerNormal = v.normal; + o.normal = v.normal; + fixed topFactor = sign(v.normal.y)*0.5+0.5; + fixed3 weightedPowerNormal = v.normal; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #if _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP(_Color_arr, _Color); + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #if _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb); + o.Alpha = tex.a; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #if _UVFREE_BOTTOM + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + o.Normal = normalize( + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ); + + // SPECULAR/GLOSS + // + + fixed4 sgX = fixed4(_SpecColor.rgb, _Glossiness); + fixed4 sgY = sgX; + fixed4 sgZ = sgX; + fixed4 sgTop = fixed4(_TopSpecColor.rgb, _TopGlossiness); + + #ifdef _UVFREE_BOTTOM + fixed4 sgBottom = fixed4(_BottomSpecColor.rgb, _BottomGlossiness); + #endif + + #ifdef _SPECGLOSSMAP + + sgX = lerp(sgX, tex2D(_SpecGlossMap, xUV), _UsingSpecGlossMap); + sgY = lerp(sgY, tex2D(_SpecGlossMap, yUV), _UsingSpecGlossMap); + sgZ = lerp(sgZ, tex2D(_SpecGlossMap, zUV), _UsingSpecGlossMap); + + #if SHADER_API_D3D9 && _EMISSION + // skip for top and bottom, because there are not enough samplers + #else + sgTop = lerp(sgTop, tex2D(_TopSpecGlossMap, yUVTop), _TopUsingSpecGlossMap); + #ifdef _UVFREE_BOTTOM + sgBottom = lerp(sgBottom, tex2D(_BottomSpecGlossMap, yUVBottom), _BottomUsingSpecGlossMap); + #endif + #endif + + #endif + + sgTop = lerp(sgY, sgTop, topLerp); + + #ifdef _UVFREE_BOTTOM + sgBottom = lerp(sgY, sgBottom, bottomLerp); + sgTop = lerp(sgBottom, sgTop, topBottomLerp); + #else + sgTop = lerp(sgY, sgTop, topBottomLerp); + #endif + + fixed4 sg = + lerp(sgX * IN.powerNormal.x, sgTop * weightedPowerNormal.x, yLerp) + + lerp(sgY * IN.powerNormal.y, sgTop * weightedPowerNormal.y, yLerp) + + lerp(sgZ * IN.powerNormal.z, sgTop * weightedPowerNormal.z, yLerp) + ; + + o.Specular = sg.rgb; + o.Smoothness = sg.a; + + // EMISSION + // + + #ifdef _EMISSION + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb; + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderTopBottomGUI" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottom.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottom.shader.meta new file mode 100644 index 0000000..e944304 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottom.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4ab1ec931c54345fbba6c717fb297e9a +timeCreated: 1426831500 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottomNB.shader b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottomNB.shader new file mode 100644 index 0000000..6833e64 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottomNB.shader @@ -0,0 +1,440 @@ +// Upgrade NOTE: upgraded instancing buffer 'MyProperties' to new syntax. + +Shader "UVFree/StandardSpecular/Top-Bottom-Texture Non-Batching" { + Properties { + // Triplanar space, for UI + [HideInInspector] _TriplanarSpace("Triplanar Space", Float) = 0.0 + + _TexPower("Texture Power", Range(0.0, 20.0)) = 10.0 + + _TopMultiplier ("Top Multiplier", Range(0.0,8.0)) = 1.0 + _BottomMultiplier ("Bottom Multiplier", Range(0.0,8.0)) = 0.0 + _VertexColorStrength("Vertex Color Strength", Range(0.0,1.0)) = 1.0 + + // FRONT + + _Color ("Color", Color) = (1.0,1.0,1.0,1.0) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _SpecColor("Specular", Color) = (0.2,0.2,0.2) + _SpecGlossMap("Specular", 2D) = "white" {} + + _UsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _BumpScale("Bump Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _EmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _EmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _EmissionColorUI("Color", Color) = (1.0,1.0,1.0) + + // TOP + + _TopColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _TopMainTex ("Albedo (RGB)", 2D) = "white" {} + + _TopGlossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _TopSpecColor("Specular", Color) = (0.2,0.2,0.2) + _TopSpecGlossMap("Specular", 2D) = "white" {} + + _TopUsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _TopBumpScale("Bump Scale", Float) = 1.0 + _TopBumpMap("Normal Map", 2D) = "bump" {} + + _TopEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _TopEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _TopEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _TopEmissionColorUI("Color", Color) = (1,1,1) + + // BOTTOM + // bottom is ignored unless _UVFREE_BOTTOM shader feature is turned on + + _BottomColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _BottomMainTex ("Albedo (RGB)", 2D) = "white" {} + + _BottomGlossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _BottomSpecColor("Specular", Color) = (0.2,0.2,0.2) + _BottomSpecGlossMap("Specular", 2D) = "white" {} + + _BottomUsingSpecGlossMap("Using Spec Gloss Map", float) = 0.0 + + _BottomBumpScale("Bump Scale", Float) = 1.0 + _BottomBumpMap("Normal Map", 2D) = "bump" {} + + _BottomEmissionColor("Emission Color", Color) = (0.0,0.0,0.0) + _BottomEmissionMap("Emission", 2D) = "white" {} + + [HideInInspector] _BottomEmissionScaleUI("Scale", Float) = 0.0 + [HideInInspector] _BottomEmissionColorUI("Color", Color) = (1.0,1.0,1.0) + } + + + SubShader { + Tags { + "RenderType"="Opaque" + "PerformanceChecks"="False" + "DisableBatching"="True" + } + + LOD 300 + + CGPROGRAM + #pragma target 3.0 + + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf StandardSpecular vertex:vert fullforwardshadows + #pragma shader_feature _UVFREE_LOCAL + #pragma shader_feature _EMISSION + #pragma shader_feature _SPECGLOSSMAP + #pragma shader_feature _UVFREE_BOTTOM + #include "UnityCG.cginc" + + // Uncomment to enable experimental feature which flips + // backward textures. Note: Causes some normals to be flipped. + // #define _UVFREE_FLIP_BACKWARD_TEXTURES + + // Comment out following line to omit vertex colors + #define _UVFREE_VERTEX_COLOR + + // Instanced Properties + // https://docs.unity3d.com/Manual/GPUInstancing.html + UNITY_INSTANCING_BUFFER_START (MyProperties) + UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) +#define _Color_arr MyProperties + UNITY_INSTANCING_BUFFER_END(MyProperties) + + half _TexPower; + + // FRONT + + sampler2D _MainTex; + float4 _MainTex_ST; + sampler2D _BumpMap; + half _BumpScale; + fixed _Glossiness; + + #ifdef _SPECGLOSSMAP + sampler2D _SpecGlossMap; + fixed _UsingSpecGlossMap; + #endif + + #ifdef _EMISSION + half4 _EmissionColor; + sampler2D _EmissionMap; + sampler2D _TopEmissionMap; + half4 _TopEmissionColor; + #endif + + // TOP + half _TopMultiplier; + fixed4 _TopColor; + sampler2D _TopMainTex; + float4 _TopMainTex_ST; + sampler2D _TopBumpMap; + half _TopBumpScale; + fixed _TopGlossiness; + fixed4 _TopSpecColor; + + #ifdef _SPECGLOSSMAP + sampler2D _TopSpecGlossMap; + fixed _TopUsingSpecGlossMap; + #endif + + + // BOTTOM + + #ifdef _UVFREE_BOTTOM + half _BottomMultiplier; + fixed4 _BottomColor; + sampler2D _BottomMainTex; + float4 _BottomMainTex_ST; + sampler2D _BottomBumpMap; + half _BottomBumpScale; + fixed4 _BottomSpecColor; + fixed _BottomGlossiness; + + #ifdef _SPECGLOSSMAP + sampler2D _BottomSpecGlossMap; + fixed _BottomUsingSpecGlossMap; + #endif + + #ifdef _EMISSION + sampler2D _BottomEmissionMap; + half4 _BottomEmissionColor; + #endif + #endif + + #ifdef _UVFREE_VERTEX_COLOR + fixed _VertexColorStrength; + #endif + + struct Input { + fixed3 powerNormal; + fixed3 normal; + float3 worldPos; + + #ifdef _UVFREE_VERTEX_COLOR + fixed4 color:COLOR; + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + void vert (inout appdata_full v, out Input o) { + + UNITY_INITIALIZE_OUTPUT(Input,o); + + #ifdef _UVFREE_LOCAL + fixed3 powerNormal = v.normal; + o.normal = v.normal; + fixed topFactor = sign(v.normal.y)*0.5+0.5; + fixed3 weightedPowerNormal = v.normal; + + #else + fixed3 worldNormal = normalize(mul(unity_ObjectToWorld, fixed4(v.normal, 0.0)).xyz); + o.normal = worldNormal; + fixed3 powerNormal = worldNormal; + fixed3 weightedPowerNormal = worldNormal; + + #endif + + // texpower sets the sharpness + powerNormal = pow(abs(powerNormal), _TexPower); + + powerNormal = max(powerNormal, 0.0001); + powerNormal /= dot(powerNormal, 1.0); + o.powerNormal = powerNormal; + + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed3 lerpedPowerNormal = lerp(powerNormal, weightedPowerNormal, weightedPowerNormal.y); + + #ifdef _UVFREE_LOCAL + + v.tangent.xyz = + cross(v.normal, fixed3(0.0,sign(v.normal.x),0.0)) * (lerpedPowerNormal.x) + + cross(v.normal, fixed3(0.0,0.0,sign(v.normal.y))) * (lerpedPowerNormal.y) + + cross(v.normal, fixed3(0.0,sign(v.normal.z),0.0)) * (lerpedPowerNormal.z) + ; + + v.tangent.w = dot(-v.normal, lerpedPowerNormal); + + #else + + v.tangent.xyz = + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.x),0.0,0.0)).xyz * (lerpedPowerNormal.x)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,0.0,sign(worldNormal.y),0.0)).xyz * (lerpedPowerNormal.y)) + + cross(v.normal, mul(unity_WorldToObject,fixed4(0.0,sign(worldNormal.z),0.0,0.0)).xyz * (lerpedPowerNormal.z)) + ; + + v.tangent.w = dot(-worldNormal, lerpedPowerNormal); + + #endif + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + + fixed topLerp = smoothstep(0.0, 1.0, _TopMultiplier); + + #if _UVFREE_BOTTOM + fixed bottomLerp = smoothstep(0.0, 1.0, _BottomMultiplier); + #endif + + fixed3 weightedPowerNormal = IN.normal; + #if _UVFREE_BOTTOM + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y)*_BottomMultiplier; + #else + weightedPowerNormal.y = max(0.0, weightedPowerNormal.y)*_TopMultiplier + min(0.0, weightedPowerNormal.y); + #endif + + weightedPowerNormal = pow(abs(weightedPowerNormal), _TexPower); + weightedPowerNormal = max(weightedPowerNormal, 0.0001); + weightedPowerNormal /= dot(weightedPowerNormal, 1.0); + + fixed topBottomLerp = sign(IN.normal.y)*0.5 + 0.5; + fixed yLerp = weightedPowerNormal.y; + + // TRIPLANAR UVs BASED ON WORLD OR LOCAL POSITION + // + + #ifdef _UVFREE_LOCAL + float3 pos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz; + + float2 posX = pos.zy; + float2 posY = pos.xz; + float2 posZ = float2(-pos.x, pos.y); + #else + float2 posX = IN.worldPos.zy; + float2 posY = IN.worldPos.xz; + float2 posZ = float2(-IN.worldPos.x, IN.worldPos.y); + #endif + + float2 xUV = posX * _MainTex_ST.xy + _MainTex_ST.zw; + + float2 yUVTop = posY * _TopMainTex_ST.xy + _TopMainTex_ST.zw; + + #ifdef _UVFREE_BOTTOM + float2 yUVBottom = posY * _BottomMainTex_ST.xy + _BottomMainTex_ST.zw; + #endif + + float2 yUV = posY * _MainTex_ST.xy + _MainTex_ST.zw; + float2 zUV = posZ * _MainTex_ST.xy + _MainTex_ST.zw; + + #ifdef _UVFREE_FLIP_BACKWARD_TEXTURES + fixed3 powerSign = sign(IN.normal); + xUV.x *= powerSign.x; + zUV.x *= powerSign.z; + yUV.y *= powerSign.y; + yUVTop.y *= powerSign.y; + #ifdef _UVFREE_BOTTOM + yUVBottom.y *= powerSign.y; + #endif + #endif + + // DIFFUSE + // + fixed4 tint = UNITY_ACCESS_INSTANCED_PROP(_Color_arr, _Color); + fixed4 texX = tex2D(_MainTex, xUV) * tint; + fixed4 texY = tex2D(_MainTex, yUV) * tint; + fixed4 texZ = tex2D(_MainTex, zUV) * tint; + + fixed4 texTop = tex2D(_TopMainTex, yUVTop) * _TopColor; + texTop = lerp(texY, texTop, topLerp); + + #if _UVFREE_BOTTOM + fixed4 texBottom = tex2D(_BottomMainTex, yUVBottom) * _BottomColor; + texBottom = lerp(texY, texBottom, bottomLerp); + texTop = lerp(texBottom, texTop, topBottomLerp); + #else + texTop = lerp(texY, texTop, topBottomLerp); + #endif + + fixed4 tex = + lerp(texX * IN.powerNormal.x, texTop * weightedPowerNormal.x, yLerp) + + lerp(texY * IN.powerNormal.y, texTop * weightedPowerNormal.y, yLerp) + + lerp(texZ * IN.powerNormal.z, texTop * weightedPowerNormal.z, yLerp) + ; + + #ifdef _UVFREE_VERTEX_COLOR + tex *= lerp(fixed4(1.0,1.0,1.0,1.0), IN.color, _VertexColorStrength); + #endif + + o.Albedo = max(fixed3(0.0, 0.0, 0.0), tex.rgb); + o.Alpha = tex.a; + + // NORMAL + // + fixed3 bumpX = UnpackScaleNormal(tex2D(_BumpMap, xUV), _BumpScale); + fixed3 bumpY = UnpackScaleNormal(tex2D(_BumpMap, yUV), _BumpScale); + fixed3 bumpZ = UnpackScaleNormal(tex2D(_BumpMap, zUV), _BumpScale); + + fixed3 bumpTop = UnpackScaleNormal(tex2D(_TopBumpMap, yUVTop), _TopBumpScale); + bumpTop = lerp(bumpY, bumpTop, topLerp); + + #if _UVFREE_BOTTOM + fixed3 bumpBottom = UnpackScaleNormal(tex2D(_BottomBumpMap, yUVBottom), _BottomBumpScale); + bumpBottom = lerp(bumpY, bumpBottom, bottomLerp); + bumpTop = lerp(bumpBottom, bumpTop, topBottomLerp); + #else + bumpTop = lerp(bumpY, bumpTop, topBottomLerp); + #endif + + o.Normal = normalize( + lerp(bumpX * IN.powerNormal.x, bumpTop * weightedPowerNormal.x, yLerp) + + lerp(bumpY * IN.powerNormal.y, bumpTop * weightedPowerNormal.y, yLerp) + + lerp(bumpZ * IN.powerNormal.z, bumpTop * weightedPowerNormal.z, yLerp) + ); + + // SPECULAR/GLOSS + // + + fixed4 sgX = fixed4(_SpecColor.rgb, _Glossiness); + fixed4 sgY = sgX; + fixed4 sgZ = sgX; + fixed4 sgTop = fixed4(_TopSpecColor.rgb, _TopGlossiness); + + #ifdef _UVFREE_BOTTOM + fixed4 sgBottom = fixed4(_BottomSpecColor.rgb, _BottomGlossiness); + #endif + + #ifdef _SPECGLOSSMAP + + sgX = lerp(sgX, tex2D(_SpecGlossMap, xUV), _UsingSpecGlossMap); + sgY = lerp(sgY, tex2D(_SpecGlossMap, yUV), _UsingSpecGlossMap); + sgZ = lerp(sgZ, tex2D(_SpecGlossMap, zUV), _UsingSpecGlossMap); + + #if SHADER_API_D3D9 && _EMISSION + // skip for top and bottom, because there are not enough samplers + #else + sgTop = lerp(sgTop, tex2D(_TopSpecGlossMap, yUVTop), _TopUsingSpecGlossMap); + #ifdef _UVFREE_BOTTOM + sgBottom = lerp(sgBottom, tex2D(_BottomSpecGlossMap, yUVBottom), _BottomUsingSpecGlossMap); + #endif + #endif + + #endif + + sgTop = lerp(sgY, sgTop, topLerp); + + #ifdef _UVFREE_BOTTOM + sgBottom = lerp(sgY, sgBottom, bottomLerp); + sgTop = lerp(sgBottom, sgTop, topBottomLerp); + #else + sgTop = lerp(sgY, sgTop, topBottomLerp); + #endif + + fixed4 sg = + lerp(sgX * IN.powerNormal.x, sgTop * weightedPowerNormal.x, yLerp) + + lerp(sgY * IN.powerNormal.y, sgTop * weightedPowerNormal.y, yLerp) + + lerp(sgZ * IN.powerNormal.z, sgTop * weightedPowerNormal.z, yLerp) + ; + + o.Specular = sg.rgb; + o.Smoothness = sg.a; + + // EMISSION + // + + #ifdef _EMISSION + half3 emissionX = tex2D(_EmissionMap, xUV).rgb * _EmissionColor.rgb; + half3 emissionY = tex2D(_EmissionMap, yUV).rgb * _EmissionColor.rgb; + + half3 emissionYTop = tex2D(_TopEmissionMap, yUVTop).rgb * _TopEmissionColor.rgb; + emissionYTop = lerp(emissionY, emissionYTop, topLerp); + + #ifdef _UVFREE_BOTTOM + half3 emissionYBottom = tex2D(_BottomEmissionMap, yUVBottom).rgb * _BottomEmissionColor.rgb; + emissionYBottom = lerp(emissionY, emissionYBottom, bottomLerp); + emissionYTop = lerp(emissionYBottom, emissionYTop, topBottomLerp); + #else + emissionYTop = lerp(emissionY, emissionYTop, topBottomLerp); + #endif + + half3 emissionZ = tex2D(_EmissionMap, zUV).rgb * _EmissionColor.rgb; + + o.Emission += + lerp(emissionX * IN.powerNormal.x, emissionYTop * weightedPowerNormal.x, yLerp) + + lerp(emissionY * IN.powerNormal.y, emissionYTop * weightedPowerNormal.y, yLerp) + + lerp(emissionZ * IN.powerNormal.z, emissionYTop * weightedPowerNormal.z, yLerp) + ; + #endif + + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "UVFreePBRShaderTopBottomGUI" +} diff --git a/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottomNB.shader.meta b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottomNB.shader.meta new file mode 100644 index 0000000..ed4cbc8 --- /dev/null +++ b/Shaders/UVFree/Standard PBR/Standard Specular/UVFreeStandardSpecularTopBottomNB.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a18eb636b612d497bb0afa0ce8c67b12 +timeCreated: 1426831500 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..69b93ff --- /dev/null +++ b/readme.txt @@ -0,0 +1,8 @@ +UV-Free Triplanar Shader Pack +by Andrew C. Wang (@andyman404) +Version 2.1.0 + +Please see documentation online at: +https://uvfree.s3.amazonaws.com/v2.1.0/index.html + +You can delete the Sample folder after viewing. \ No newline at end of file diff --git a/readme.txt.meta b/readme.txt.meta new file mode 100644 index 0000000..3633e83 --- /dev/null +++ b/readme.txt.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: bd10d0a1a981e40219aaf3dd18065d1c +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: