From 796a03e9e61ccfb06284fd2e0b227b3c31959838 Mon Sep 17 00:00:00 2001 From: LMW Date: Fri, 23 Aug 2024 23:08:45 +0800 Subject: [PATCH 1/9] Add Unity URP Lit export target --- addons/material_maker/nodes/material.mmg | 834 +++++++++++++++++++++++ 1 file changed, 834 insertions(+) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index 8470ce7ad..958d91450 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -1991,6 +1991,840 @@ ], "uids": 5 }, + "Unity/URP": { + "export_extension": "mat", + "files": [ + { + "conditions": "$(connected:albedo_tex)", + "file_name": "$(path_prefix)_albedo.png", + "output": 0, + "type": "texture" + }, + { + "conditions": "$(connected:albedo_tex)", + "file_name": "$(path_prefix)_albedo.png.meta", + "prompt_overwrite": true, + "template": [ + "fileFormatVersion: 2", + "guid: $uid(0)", + "TextureImporter:", + " internalIDToNameTable: []", + " externalObjects: {}", + " serializedVersion: 10", + " mipmaps:", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", + " bumpmap:", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + " isReadable: 0", + " streamingMipmaps: 0", + " streamingMipmapsPriority: 0", + " grayScaleToAlpha: 0", + " generateCubemap: 6", + " cubemapConvolution: 0", + " seamlessCubemap: 0", + " textureFormat: 1", + " maxTextureSize: 2048", + " textureSettings:", + "\tserializedVersion: 2", + "\tfilterMode: -1", + "\taniso: -1", + "\tmipBias: -100", + "\twrapU: -1", + "\twrapV: -1", + "\twrapW: -1", + " nPOTScale: 1", + " lightmap: 0", + " compressionQuality: 50", + " spriteMode: 0", + " spriteExtrude: 1", + " spriteMeshType: 1", + " alignment: 0", + " spritePivot: {x: 0.5, y: 0.5}", + " spritePixelsToUnits: 100", + " spriteBorder: {x: 0, y: 0, z: 0, w: 0}", + " spriteGenerateFallbackPhysicsShape: 1", + " alphaUsage: 1", + " alphaIsTransparency: 0", + " spriteTessellationDetail: -1", + " textureType: 0", + " textureShape: 1", + " singleChannelComponent: 0", + " maxTextureSizeSet: 0", + " compressionQualitySet: 0", + " textureFormatSet: 0", + " platformSettings:", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " spriteSheet:", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + " spritePackingTag: ", + " pSDRemoveMatte: 0", + " pSDShowRemoveMatteOption: 0", + " userData: ", + " assetBundleName: ", + " assetBundleVariant: ", + "" + ], + "type": "template" + }, + { + "conditions": "$(connected:roughness_tex) or $(connected:metallic_tex)", + "file_name": "$(path_prefix)_metal_smoothness.png", + "output": 6, + "type": "texture" + }, + { + "conditions": "$(connected:roughness_tex) or $(connected:metallic_tex)", + "file_name": "$(path_prefix)_metal_smoothness.png.meta", + "prompt_overwrite": true, + "template": [ + "fileFormatVersion: 2", + "guid: $uid(1)", + "TextureImporter:", + " internalIDToNameTable: []", + " externalObjects: {}", + " serializedVersion: 10", + " mipmaps:", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", + " bumpmap:", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + " isReadable: 0", + " streamingMipmaps: 0", + " streamingMipmapsPriority: 0", + " grayScaleToAlpha: 0", + " generateCubemap: 6", + " cubemapConvolution: 0", + " seamlessCubemap: 0", + " textureFormat: 1", + " maxTextureSize: 2048", + " textureSettings:", + "\tserializedVersion: 2", + "\tfilterMode: -1", + "\taniso: -1", + "\tmipBias: -100", + "\twrapU: -1", + "\twrapV: -1", + "\twrapW: -1", + " nPOTScale: 1", + " lightmap: 0", + " compressionQuality: 50", + " spriteMode: 0", + " spriteExtrude: 1", + " spriteMeshType: 1", + " alignment: 0", + " spritePivot: {x: 0.5, y: 0.5}", + " spritePixelsToUnits: 100", + " spriteBorder: {x: 0, y: 0, z: 0, w: 0}", + " spriteGenerateFallbackPhysicsShape: 1", + " alphaUsage: 1", + " alphaIsTransparency: 0", + " spriteTessellationDetail: -1", + " textureType: 0", + " textureShape: 1", + " singleChannelComponent: 0", + " maxTextureSizeSet: 0", + " compressionQualitySet: 0", + " textureFormatSet: 0", + " platformSettings:", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " spriteSheet:", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + " spritePackingTag: ", + " pSDRemoveMatte: 0", + " pSDShowRemoveMatteOption: 0", + " userData: ", + " assetBundleName: ", + " assetBundleVariant: ", + "" + ], + "type": "template" + }, + { + "conditions": "$(connected:normal_tex)", + "file_name": "$(path_prefix)_normal.png", + "output": 7, + "type": "texture" + }, + { + "conditions": "$(connected:normal_tex)", + "file_name": "$(path_prefix)_normal.png.meta", + "prompt_overwrite": true, + "template": [ + "fileFormatVersion: 2", + "guid: $uid(2)", + "TextureImporter:", + " internalIDToNameTable: []", + " externalObjects: {}", + " serializedVersion: 10", + " mipmaps:", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 0", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", + " bumpmap:", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + "\tflipGreenChannel: 0", + " isReadable: 0", + " streamingMipmaps: 0", + " streamingMipmapsPriority: 0", + " vTOnly: 0", + " ignoreMipmapLimit: 0", + " grayScaleToAlpha: 0", + " generateCubemap: 6", + " cubemapConvolution: 0", + " seamlessCubemap: 0", + " textureFormat: 1", + " maxTextureSize: 2048", + " textureSettings:", + "\tserializedVersion: 2", + "\tfilterMode: 1", + "\taniso: 1", + "\tmipBias: 0", + "\twrapU: 0", + "\twrapV: 0", + "\twrapW: 0", + " nPOTScale: 1", + " lightmap: 0", + " compressionQuality: 50", + " spriteMode: 0", + " spriteExtrude: 1", + " spriteMeshType: 1", + " alignment: 0", + " spritePivot: {x: 0.5, y: 0.5}", + " spritePixelsToUnits: 100", + " spriteBorder: {x: 0, y: 0, z: 0, w: 0}", + " spriteGenerateFallbackPhysicsShape: 1", + " alphaUsage: 1", + " alphaIsTransparency: 0", + " spriteTessellationDetail: -1", + " textureType: 1", + " textureShape: 1", + " singleChannelComponent: 0", + " flipbookRows: 1", + " flipbookColumns: 1", + " maxTextureSizeSet: 0", + " compressionQualitySet: 0", + " textureFormatSet: 0", + " ignorePngGamma: 0", + " applyGammaDecoding: 1", + " swizzle: 50462976", + " cookieLightType: 1", + " platformSettings:", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tignorePlatformSupport: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " - serializedVersion: 3", + "\tbuildTarget: Standalone", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tignorePlatformSupport: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " spriteSheet:", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + "\tnameFileIdTable: {}", + " mipmapLimitGroupName: ", + " pSDRemoveMatte: 0", + " userData: ", + " assetBundleName: ", + " assetBundleVariant: " + ], + "type": "template" + }, + { + "conditions": "$(connected:depth_tex)", + "file_name": "$(path_prefix)_height.png", + "output": 8, + "type": "texture" + }, + { + "conditions": "$(connected:depth_tex)", + "file_name": "$(path_prefix)_height.png.meta", + "prompt_overwrite": true, + "template": [ + "fileFormatVersion: 2", + "guid: $uid(3)", + "TextureImporter:", + " internalIDToNameTable: []", + " externalObjects: {}", + " serializedVersion: 10", + " mipmaps:", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", + " bumpmap:", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + " isReadable: 0", + " streamingMipmaps: 0", + " streamingMipmapsPriority: 0", + " grayScaleToAlpha: 0", + " generateCubemap: 6", + " cubemapConvolution: 0", + " seamlessCubemap: 0", + " textureFormat: 1", + " maxTextureSize: 2048", + " textureSettings:", + "\tserializedVersion: 2", + "\tfilterMode: -1", + "\taniso: -1", + "\tmipBias: -100", + "\twrapU: -1", + "\twrapV: -1", + "\twrapW: -1", + " nPOTScale: 1", + " lightmap: 0", + " compressionQuality: 50", + " spriteMode: 0", + " spriteExtrude: 1", + " spriteMeshType: 1", + " alignment: 0", + " spritePivot: {x: 0.5, y: 0.5}", + " spritePixelsToUnits: 100", + " spriteBorder: {x: 0, y: 0, z: 0, w: 0}", + " spriteGenerateFallbackPhysicsShape: 1", + " alphaUsage: 1", + " alphaIsTransparency: 0", + " spriteTessellationDetail: -1", + " textureType: 0", + " textureShape: 1", + " singleChannelComponent: 0", + " maxTextureSizeSet: 0", + " compressionQualitySet: 0", + " textureFormatSet: 0", + " platformSettings:", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " spriteSheet:", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + " spritePackingTag: ", + " pSDRemoveMatte: 0", + " pSDShowRemoveMatteOption: 0", + " userData: ", + " assetBundleName: ", + " assetBundleVariant: ", + "" + ], + "type": "template" + }, + { + "conditions": "$(connected:ao_tex)", + "file_name": "$(path_prefix)_occlusion.png", + "output": 9, + "type": "texture" + }, + { + "conditions": "$(connected:ao_tex)", + "file_name": "$(path_prefix)_occlusion.png.meta", + "prompt_overwrite": true, + "template": [ + "fileFormatVersion: 2", + "guid: $uid(4)", + "TextureImporter:", + " internalIDToNameTable: []", + " externalObjects: {}", + " serializedVersion: 10", + " mipmaps:", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", + " bumpmap:", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + " isReadable: 0", + " streamingMipmaps: 0", + " streamingMipmapsPriority: 0", + " grayScaleToAlpha: 0", + " generateCubemap: 6", + " cubemapConvolution: 0", + " seamlessCubemap: 0", + " textureFormat: 1", + " maxTextureSize: 2048", + " textureSettings:", + "\tserializedVersion: 2", + "\tfilterMode: -1", + "\taniso: -1", + "\tmipBias: -100", + "\twrapU: -1", + "\twrapV: -1", + "\twrapW: -1", + " nPOTScale: 1", + " lightmap: 0", + " compressionQuality: 50", + " spriteMode: 0", + " spriteExtrude: 1", + " spriteMeshType: 1", + " alignment: 0", + " spritePivot: {x: 0.5, y: 0.5}", + " spritePixelsToUnits: 100", + " spriteBorder: {x: 0, y: 0, z: 0, w: 0}", + " spriteGenerateFallbackPhysicsShape: 1", + " alphaUsage: 1", + " alphaIsTransparency: 0", + " spriteTessellationDetail: -1", + " textureType: 0", + " textureShape: 1", + " singleChannelComponent: 0", + " maxTextureSizeSet: 0", + " compressionQualitySet: 0", + " textureFormatSet: 0", + " platformSettings:", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " spriteSheet:", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + " spritePackingTag: ", + " pSDRemoveMatte: 0", + " pSDShowRemoveMatteOption: 0", + " userData: ", + " assetBundleName: ", + " assetBundleVariant: ", + "" + ], + "type": "template" + }, + { + "conditions": "$(connected:emission_tex)", + "file_name": "$(path_prefix)_emission.png", + "output": 2, + "type": "texture" + }, + { + "conditions": "$(connected:emission_tex)", + "file_name": "$(path_prefix)_emission.png.meta", + "prompt_overwrite": true, + "template": [ + "fileFormatVersion: 2", + "guid: $uid(5)", + "TextureImporter:", + " internalIDToNameTable: []", + " externalObjects: {}", + " serializedVersion: 10", + " mipmaps:", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", + " bumpmap:", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + " isReadable: 0", + " streamingMipmaps: 0", + " streamingMipmapsPriority: 0", + " grayScaleToAlpha: 0", + " generateCubemap: 6", + " cubemapConvolution: 0", + " seamlessCubemap: 0", + " textureFormat: 1", + " maxTextureSize: 2048", + " textureSettings:", + "\tserializedVersion: 2", + "\tfilterMode: -1", + "\taniso: -1", + "\tmipBias: -100", + "\twrapU: -1", + "\twrapV: -1", + "\twrapW: -1", + " nPOTScale: 1", + " lightmap: 0", + " compressionQuality: 50", + " spriteMode: 0", + " spriteExtrude: 1", + " spriteMeshType: 1", + " alignment: 0", + " spritePivot: {x: 0.5, y: 0.5}", + " spritePixelsToUnits: 100", + " spriteBorder: {x: 0, y: 0, z: 0, w: 0}", + " spriteGenerateFallbackPhysicsShape: 1", + " alphaUsage: 1", + " alphaIsTransparency: 0", + " spriteTessellationDetail: -1", + " textureType: 0", + " textureShape: 1", + " singleChannelComponent: 0", + " maxTextureSizeSet: 0", + " compressionQualitySet: 0", + " textureFormatSet: 0", + " platformSettings:", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " spriteSheet:", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + " spritePackingTag: ", + " pSDRemoveMatte: 0", + " pSDShowRemoveMatteOption: 0", + " userData: ", + " assetBundleName: ", + " assetBundleVariant: ", + "" + ], + "type": "template" + }, + { + "file_name": "$(path_prefix).mat", + "prompt_overwrite": true, + "template": [ + "%YAML 1.1", + "%TAG !u! tag:unity3d.com,2011:", + "--- !u!21 &2100000", + "Material:", + " serializedVersion: 6", + " m_ObjectHideFlags: 0", + " m_CorrespondingSourceObject: {fileID: 0}", + " m_PrefabInstance: {fileID: 0}", + " m_PrefabAsset: {fileID: 0}", + " m_Name: $(file_prefix)", + " m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}", + " m_Parent: {fileID: 0}", + " m_ModifiedSerializedProperties: 0", + " m_ValidKeywords:", + " - _NORMALMAP", + " - _PARALLAXMAP", + " m_LightmapFlags: 4", + " m_EnableInstancingVariants: 0", + " m_DoubleSidedGI: 0", + " m_CustomRenderQueue: -1", + " stringTagMap:", + "\tRenderType: Opaque", + " disabledShaderPasses: []", + " m_LockedProperties: ", + " m_SavedProperties:", + "\tserializedVersion: 3", + "\tm_TexEnvs:", + "\t- _BaseMap:", + "$if $(connected:albedo_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(0), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _BumpMap:", + "$if $(connected:normal_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(2), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _DetailAlbedoMap:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _DetailMask:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _DetailNormalMap:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _EmissionMap:", + "$if $(connected:emission_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(5), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _MainTex:", + "$if $(connected:albedo_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(0), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _MetallicGlossMap:", + "$if $(connected:roughness_tex) or $(connected:metallic_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(1), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _OcclusionMap:", + "$if $(connected:ao_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(4), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _ParallaxMap:", + "$if $(connected:depth_tex)", + "\t\tm_Texture: {fileID: 2800000, guid: $uid(3), type: 3}", + "$else", + "\t\tm_Texture: {fileID: 0}", + "$fi", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- _SpecGlossMap:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- unity_Lightmaps:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- unity_LightmapsInd:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\t- unity_ShadowMasks:", + "\t\tm_Texture: {fileID: 0}", + "\t\tm_Scale: {x: 1, y: 1}", + "\t\tm_Offset: {x: 0, y: 0}", + "\tm_Ints: []", + "\tm_Floats:", + "\t- _AlphaClip: 0", + "\t- _AlphaToMask: 0", + "\t- _Blend: 0", + "\t- _BlendModePreserveSpecular: 1", + "\t- _BumpScale: 1", + "\t- _ClearCoatMask: 0", + "\t- _ClearCoatSmoothness: 0", + "\t- _Cull: 2", + "\t- _Cutoff: 0.5", + "\t- _DetailAlbedoMapScale: 1", + "\t- _DetailNormalMapScale: 1", + "\t- _DstBlend: 0", + "\t- _DstBlendAlpha: 0", + "\t- _EnvironmentReflections: 1", + "\t- _GlossMapScale: 0", + "\t- _Glossiness: 0", + "\t- _GlossyReflections: 0", + "\t- _Metallic: 0", + "\t- _OcclusionStrength: 1", + "\t- _Parallax: 0.005", + "\t- _QueueOffset: 0", + "\t- _ReceiveShadows: 1", + "\t- _Smoothness: 1.0", + "\t- _SmoothnessTextureChannel: 0", + "\t- _SpecularHighlights: 1", + "\t- _SrcBlend: 1", + "\t- _SrcBlendAlpha: 1", + "\t- _Surface: 0", + "\t- _WorkflowMode: 1", + "\t- _ZWrite: 1", + "\tm_Colors:", + "\t- _BaseColor: {r: 1, g: 1, b: 1, a: 1}", + "\t- _Color: {r: 1, g: 1, b: 1, a: 1}", + "\t- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}", + "\t- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}", + " m_BuildTextureStacks: []", + "--- !u!114 &7209760610770189720", + "MonoBehaviour:", + " m_ObjectHideFlags: 11", + " m_CorrespondingSourceObject: {fileID: 0}", + " m_PrefabInstance: {fileID: 0}", + " m_PrefabAsset: {fileID: 0}", + " m_GameObject: {fileID: 0}", + " m_Enabled: 1", + " m_EditorHideFlags: 0", + " m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}", + " m_Name: ", + " m_EditorClassIdentifier: ", + " version: 7", + "" + ], + "type": "template" + } + ], + "uids": 6 + }, "Unreal/Unreal Engine 4": { "export_extension": "mm2ue", "files": [ From cbbe0537f3d258f57f94411a9bde9b8c51922a3c Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 16:22:08 +0800 Subject: [PATCH 2/9] fix .mat export --- addons/material_maker/nodes/material.mmg | 449 +++++++++++------------ 1 file changed, 223 insertions(+), 226 deletions(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index 958d91450..3a046c6ad 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -2224,22 +2224,22 @@ " externalObjects: {}", " serializedVersion: 10", " mipmaps:", - "\tmipMapMode: 0", - "\tenableMipMap: 1", - "\tsRGBTexture: 0", - "\tlinearTexture: 0", - "\tfadeOut: 0", - "\tborderMipMap: 0", - "\tmipMapsPreserveCoverage: 0", - "\talphaTestReferenceValue: 0.5", - "\tmipMapFadeDistanceStart: 1", - "\tmipMapFadeDistanceEnd: 3", + " mipMapMode: 0", + " enableMipMap: 1", + " sRGBTexture: 0", + " linearTexture: 0", + " fadeOut: 0", + " borderMipMap: 0", + " mipMapsPreserveCoverage: 0", + " alphaTestReferenceValue: 0.5", + " mipMapFadeDistanceStart: 1", + " mipMapFadeDistanceEnd: 3", " bumpmap:", - "\tconvertToNormalMap: 0", - "\texternalNormalMap: 0", - "\theightScale: 0.25", - "\tnormalMapFilter: 0", - "\tflipGreenChannel: 0", + " convertToNormalMap: 0", + " externalNormalMap: 0", + " heightScale: 0.25", + " normalMapFilter: 0", + " flipGreenChannel: 0", " isReadable: 0", " streamingMipmaps: 0", " streamingMipmapsPriority: 0", @@ -2252,13 +2252,13 @@ " textureFormat: 1", " maxTextureSize: 2048", " textureSettings:", - "\tserializedVersion: 2", - "\tfilterMode: 1", - "\taniso: 1", - "\tmipBias: 0", - "\twrapU: 0", - "\twrapV: 0", - "\twrapW: 0", + " serializedVersion: 2", + " filterMode: 1", + " aniso: 1", + " mipBias: 0", + " wrapU: 0", + " wrapV: 0", + " wrapW: 0", " nPOTScale: 1", " lightmap: 0", " compressionQuality: 50", @@ -2287,45 +2287,45 @@ " cookieLightType: 1", " platformSettings:", " - serializedVersion: 3", - "\tbuildTarget: DefaultTexturePlatform", - "\tmaxTextureSize: 2048", - "\tresizeAlgorithm: 0", - "\ttextureFormat: -1", - "\ttextureCompression: 1", - "\tcompressionQuality: 50", - "\tcrunchedCompression: 0", - "\tallowsAlphaSplitting: 0", - "\toverridden: 0", - "\tignorePlatformSupport: 0", - "\tandroidETC2FallbackOverride: 0", - "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " buildTarget: DefaultTexturePlatform", + " maxTextureSize: 2048", + " resizeAlgorithm: 0", + " textureFormat: -1", + " textureCompression: 1", + " compressionQuality: 50", + " crunchedCompression: 0", + " allowsAlphaSplitting: 0", + " overridden: 0", + " ignorePlatformSupport: 0", + " androidETC2FallbackOverride: 0", + " forceMaximumCompressionQuality_BC6H_BC7: 0", " - serializedVersion: 3", - "\tbuildTarget: Standalone", - "\tmaxTextureSize: 2048", - "\tresizeAlgorithm: 0", - "\ttextureFormat: -1", - "\ttextureCompression: 1", - "\tcompressionQuality: 50", - "\tcrunchedCompression: 0", - "\tallowsAlphaSplitting: 0", - "\toverridden: 0", - "\tignorePlatformSupport: 0", - "\tandroidETC2FallbackOverride: 0", - "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " buildTarget: Standalone", + " maxTextureSize: 2048", + " resizeAlgorithm: 0", + " textureFormat: -1", + " textureCompression: 1", + " compressionQuality: 50", + " crunchedCompression: 0", + " allowsAlphaSplitting: 0", + " overridden: 0", + " ignorePlatformSupport: 0", + " androidETC2FallbackOverride: 0", + "forceMaximumCompressionQuality_BC6H_BC7: 0", " spriteSheet:", - "\tserializedVersion: 2", - "\tsprites: []", - "\toutline: []", - "\tphysicsShape: []", - "\tbones: []", - "\tspriteID: ", - "\tinternalID: 0", - "\tvertices: []", - "\tindices: ", - "\tedges: []", - "\tweights: []", - "\tsecondaryTextures: []", - "\tnameFileIdTable: {}", + " serializedVersion: 2", + " sprites: []", + " outline: []", + " physicsShape: []", + " bones: []", + " spriteID: ", + " internalID: 0", + " vertices: []", + " indices: ", + " edges: []", + " weights: []", + " secondaryTextures: []", + " nameFileIdTable: {}", " mipmapLimitGroupName: ", " pSDRemoveMatte: 0", " userData: ", @@ -2564,21 +2564,21 @@ " externalObjects: {}", " serializedVersion: 10", " mipmaps:", - "\tmipMapMode: 0", - "\tenableMipMap: 1", - "\tsRGBTexture: 1", - "\tlinearTexture: 0", - "\tfadeOut: 0", - "\tborderMipMap: 0", - "\tmipMapsPreserveCoverage: 0", - "\talphaTestReferenceValue: 0.5", - "\tmipMapFadeDistanceStart: 1", - "\tmipMapFadeDistanceEnd: 3", + " mipMapMode: 0", + " enableMipMap: 1", + " sRGBTexture: 1", + " linearTexture: 0", + " fadeOut: 0", + " borderMipMap: 0", + " mipMapsPreserveCoverage: 0", + " alphaTestReferenceValue: 0.5", + " mipMapFadeDistanceStart: 1", + " mipMapFadeDistanceEnd: 3", " bumpmap:", - "\tconvertToNormalMap: 0", - "\texternalNormalMap: 0", - "\theightScale: 0.25", - "\tnormalMapFilter: 0", + " convertToNormalMap: 0", + " externalNormalMap: 0", + " heightScale: 0.25", + " normalMapFilter: 0", " isReadable: 0", " streamingMipmaps: 0", " streamingMipmapsPriority: 0", @@ -2589,13 +2589,13 @@ " textureFormat: 1", " maxTextureSize: 2048", " textureSettings:", - "\tserializedVersion: 2", - "\tfilterMode: -1", - "\taniso: -1", - "\tmipBias: -100", - "\twrapU: -1", - "\twrapV: -1", - "\twrapW: -1", + " serializedVersion: 2", + " filterMode: -1", + " aniso: -1", + " mipBias: -100", + " wrapU: -1", + " wrapV: -1", + " wrapW: -1", " nPOTScale: 1", " lightmap: 0", " compressionQuality: 50", @@ -2618,30 +2618,30 @@ " textureFormatSet: 0", " platformSettings:", " - serializedVersion: 3", - "\tbuildTarget: DefaultTexturePlatform", - "\tmaxTextureSize: 2048", - "\tresizeAlgorithm: 0", - "\ttextureFormat: -1", - "\ttextureCompression: 1", - "\tcompressionQuality: 50", - "\tcrunchedCompression: 0", - "\tallowsAlphaSplitting: 0", - "\toverridden: 0", - "\tandroidETC2FallbackOverride: 0", - "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " buildTarget: DefaultTexturePlatform", + " maxTextureSize: 2048", + " resizeAlgorithm: 0", + " textureFormat: -1", + " textureCompression: 1", + " compressionQuality: 50", + " crunchedCompression: 0", + " allowsAlphaSplitting: 0", + " overridden: 0", + " androidETC2FallbackOverride: 0", + " forceMaximumCompressionQuality_BC6H_BC7: 0", " spriteSheet:", - "\tserializedVersion: 2", - "\tsprites: []", - "\toutline: []", - "\tphysicsShape: []", - "\tbones: []", - "\tspriteID: ", - "\tinternalID: 0", - "\tvertices: []", - "\tindices: ", - "\tedges: []", - "\tweights: []", - "\tsecondaryTextures: []", + " serializedVersion: 2", + " sprites: []", + " outline: []", + " physicsShape: []", + " bones: []", + " spriteID: ", + " internalID: 0", + " vertices: []", + " indices: ", + " edges: []", + " weights: []", + " secondaryTextures: []", " spritePackingTag: ", " pSDRemoveMatte: 0", " pSDShowRemoveMatteOption: 0", @@ -2658,9 +2658,22 @@ "template": [ "%YAML 1.1", "%TAG !u! tag:unity3d.com,2011:", + "--- !u!114 &-486273074595757742", + "MonoBehaviour:", + " m_ObjectHideFlags: 11", + " m_CorrespondingSourceObject: {fileID: 0}", + " m_PrefabInstance: {fileID: 0}", + " m_PrefabAsset: {fileID: 0}", + " m_GameObject: {fileID: 0}", + " m_Enabled: 1", + " m_EditorHideFlags: 0", + " m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}", + " m_Name: ", + " m_EditorClassIdentifier: ", + " version: 7", "--- !u!21 &2100000", "Material:", - " serializedVersion: 6", + " serializedVersion: 8", " m_ObjectHideFlags: 0", " m_CorrespondingSourceObject: {fileID: 0}", " m_PrefabInstance: {fileID: 0}", @@ -2672,152 +2685,136 @@ " m_ValidKeywords:", " - _NORMALMAP", " - _PARALLAXMAP", + " - _METALLICSPECGLOSSMAP", " m_LightmapFlags: 4", " m_EnableInstancingVariants: 0", " m_DoubleSidedGI: 0", " m_CustomRenderQueue: -1", " stringTagMap:", - "\tRenderType: Opaque", + " RenderType: Opaque", " disabledShaderPasses: []", " m_LockedProperties: ", " m_SavedProperties:", - "\tserializedVersion: 3", - "\tm_TexEnvs:", - "\t- _BaseMap:", + " serializedVersion: 3", + " m_TexEnvs:", + " - _BaseMap:", "$if $(connected:albedo_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(0), type: 3}", + " m_Texture: {fileID: 2800000, guid: $uid(0), type: 3}", "$else", - "\t\tm_Texture: {fileID: 0}", + " m_Texture: {fileID: 0}", "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _BumpMap:", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - _BumpMap:", "$if $(connected:normal_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(2), type: 3}", + " m_Texture: {fileID: 2800000, guid: $uid(2), type: 3}", "$else", - "\t\tm_Texture: {fileID: 0}", - "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _DetailAlbedoMap:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _DetailMask:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _DetailNormalMap:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _EmissionMap:", + " m_Texture: {fileID: 0}", + "$fi", + " 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:", "$if $(connected:emission_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(5), type: 3}", + " m_Texture: {fileID: 2800000, guid: $uid(5), type: 3}", "$else", - "\t\tm_Texture: {fileID: 0}", - "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _MainTex:", - "$if $(connected:albedo_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(0), type: 3}", - "$else", - "\t\tm_Texture: {fileID: 0}", - "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _MetallicGlossMap:", + " m_Texture: {fileID: 0}", + "$fi", + " 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}", + " - _MetallicGlossMap:", "$if $(connected:roughness_tex) or $(connected:metallic_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(1), type: 3}", + " m_Texture: {fileID: 2800000, guid: $uid(1), type: 3}", "$else", - "\t\tm_Texture: {fileID: 0}", + " m_Texture: {fileID: 0}", "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _OcclusionMap:", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - _OcclusionMap:", "$if $(connected:ao_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(4), type: 3}", + " m_Texture: {fileID: 2800000, guid: $uid(4), type: 3}", "$else", - "\t\tm_Texture: {fileID: 0}", + " m_Texture: {fileID: 0}", "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _ParallaxMap:", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - _ParallaxMap:", "$if $(connected:depth_tex)", - "\t\tm_Texture: {fileID: 2800000, guid: $uid(3), type: 3}", + " m_Texture: {fileID: 2800000, guid: $uid(3), type: 3}", "$else", - "\t\tm_Texture: {fileID: 0}", - "$fi", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- _SpecGlossMap:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- unity_Lightmaps:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- unity_LightmapsInd:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\t- unity_ShadowMasks:", - "\t\tm_Texture: {fileID: 0}", - "\t\tm_Scale: {x: 1, y: 1}", - "\t\tm_Offset: {x: 0, y: 0}", - "\tm_Ints: []", - "\tm_Floats:", - "\t- _AlphaClip: 0", - "\t- _AlphaToMask: 0", - "\t- _Blend: 0", - "\t- _BlendModePreserveSpecular: 1", - "\t- _BumpScale: 1", - "\t- _ClearCoatMask: 0", - "\t- _ClearCoatSmoothness: 0", - "\t- _Cull: 2", - "\t- _Cutoff: 0.5", - "\t- _DetailAlbedoMapScale: 1", - "\t- _DetailNormalMapScale: 1", - "\t- _DstBlend: 0", - "\t- _DstBlendAlpha: 0", - "\t- _EnvironmentReflections: 1", - "\t- _GlossMapScale: 0", - "\t- _Glossiness: 0", - "\t- _GlossyReflections: 0", - "\t- _Metallic: 0", - "\t- _OcclusionStrength: 1", - "\t- _Parallax: 0.005", - "\t- _QueueOffset: 0", - "\t- _ReceiveShadows: 1", - "\t- _Smoothness: 1.0", - "\t- _SmoothnessTextureChannel: 0", - "\t- _SpecularHighlights: 1", - "\t- _SrcBlend: 1", - "\t- _SrcBlendAlpha: 1", - "\t- _Surface: 0", - "\t- _WorkflowMode: 1", - "\t- _ZWrite: 1", - "\tm_Colors:", - "\t- _BaseColor: {r: 1, g: 1, b: 1, a: 1}", - "\t- _Color: {r: 1, g: 1, b: 1, a: 1}", - "\t- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}", - "\t- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}", + " m_Texture: {fileID: 0}", + "$fi", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - _SpecGlossMap:", + " m_Texture: {fileID: 0}", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - unity_Lightmaps:", + " m_Texture: {fileID: 0}", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - unity_LightmapsInd:", + " m_Texture: {fileID: 0}", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " - unity_ShadowMasks:", + " m_Texture: {fileID: 0}", + " m_Scale: {x: 1, y: 1}", + " m_Offset: {x: 0, y: 0}", + " m_Ints: []", + " m_Floats:", + " - _AlphaClip: 0", + " - _AlphaToMask: 0", + " - _Blend: 0", + " - _BlendModePreserveSpecular: 1", + " - _BumpScale: 1", + " - _ClearCoatMask: 0", + " - _ClearCoatSmoothness: 0", + " - _Cull: 2", + " - _Cutoff: 0.5", + " - _DetailAlbedoMapScale: 1", + " - _DetailNormalMapScale: 1", + " - _DstBlend: 0", + " - _DstBlendAlpha: 0", + " - _EnvironmentReflections: 1", + " - _GlossMapScale: 0", + " - _Glossiness: 0", + " - _GlossyReflections: 0", + " - _Metallic: 0", + " - _OcclusionStrength: 1", + " - _Parallax: $(expr:0.005+(0.08-0.005)*$(param:depth_scale))", + " - _QueueOffset: 0", + " - _ReceiveShadows: 1", + " - _Smoothness: 0.5", + " - _SmoothnessTextureChannel: 0", + " - _SpecularHighlights: 1", + " - _SrcBlend: 1", + " - _SrcBlendAlpha: 1", + " - _Surface: 0", + " - _WorkflowMode: 1", + " - _ZWrite: 1", + " m_Colors:", + " - _BaseColor: {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: 1}", + " - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}", " m_BuildTextureStacks: []", - "--- !u!114 &7209760610770189720", - "MonoBehaviour:", - " m_ObjectHideFlags: 11", - " m_CorrespondingSourceObject: {fileID: 0}", - " m_PrefabInstance: {fileID: 0}", - " m_PrefabAsset: {fileID: 0}", - " m_GameObject: {fileID: 0}", - " m_Enabled: 1", - " m_EditorHideFlags: 0", - " m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}", - " m_Name: ", - " m_EditorClassIdentifier: ", - " version: 7", "" ], "type": "template" From 8e19303fd78ede496177c4cecd0acae329207418 Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 16:24:26 +0800 Subject: [PATCH 3/9] export material ao/roughness strengths --- addons/material_maker/nodes/material.mmg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index 3a046c6ad..2e8aa23e8 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -2797,11 +2797,11 @@ " - _Glossiness: 0", " - _GlossyReflections: 0", " - _Metallic: 0", - " - _OcclusionStrength: 1", + " - _OcclusionStrength: $(param:ao)", " - _Parallax: $(expr:0.005+(0.08-0.005)*$(param:depth_scale))", " - _QueueOffset: 0", " - _ReceiveShadows: 1", - " - _Smoothness: 0.5", + " - _Smoothness: $(expr:1.0-$(param:roughness))", " - _SmoothnessTextureChannel: 0", " - _SpecularHighlights: 1", " - _SrcBlend: 1", From c88150bd418e5a74e11d61ebde3e6d76d9c0d9cc Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 17:04:21 +0800 Subject: [PATCH 4/9] export emission strength --- addons/material_maker/nodes/material.mmg | 92 ++++++++++++------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index 2e8aa23e8..a9d4be2eb 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -2066,7 +2066,7 @@ " textureFormatSet: 0", " platformSettings:", " - serializedVersion: 3", - "\tbuildTarget: DefaultTexturePlatform", + " buildTarget: DefaultTexturePlatform", "\tmaxTextureSize: 2048", "\tresizeAlgorithm: 0", "\ttextureFormat: -1", @@ -2172,7 +2172,7 @@ " textureFormatSet: 0", " platformSettings:", " - serializedVersion: 3", - "\tbuildTarget: DefaultTexturePlatform", + " buildTarget: DefaultTexturePlatform", "\tmaxTextureSize: 2048", "\tresizeAlgorithm: 0", "\ttextureFormat: -1", @@ -2564,21 +2564,21 @@ " externalObjects: {}", " serializedVersion: 10", " mipmaps:", - " mipMapMode: 0", - " enableMipMap: 1", - " sRGBTexture: 1", - " linearTexture: 0", - " fadeOut: 0", - " borderMipMap: 0", - " mipMapsPreserveCoverage: 0", - " alphaTestReferenceValue: 0.5", - " mipMapFadeDistanceStart: 1", - " mipMapFadeDistanceEnd: 3", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", " bumpmap:", - " convertToNormalMap: 0", - " externalNormalMap: 0", - " heightScale: 0.25", - " normalMapFilter: 0", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", " isReadable: 0", " streamingMipmaps: 0", " streamingMipmapsPriority: 0", @@ -2589,13 +2589,13 @@ " textureFormat: 1", " maxTextureSize: 2048", " textureSettings:", - " serializedVersion: 2", - " filterMode: -1", - " aniso: -1", - " mipBias: -100", - " wrapU: -1", - " wrapV: -1", - " wrapW: -1", + "\tserializedVersion: 2", + "\tfilterMode: -1", + "\taniso: -1", + "\tmipBias: -100", + "\twrapU: -1", + "\twrapV: -1", + "\twrapW: -1", " nPOTScale: 1", " lightmap: 0", " compressionQuality: 50", @@ -2619,29 +2619,29 @@ " platformSettings:", " - serializedVersion: 3", " buildTarget: DefaultTexturePlatform", - " maxTextureSize: 2048", - " resizeAlgorithm: 0", - " textureFormat: -1", - " textureCompression: 1", - " compressionQuality: 50", - " crunchedCompression: 0", - " allowsAlphaSplitting: 0", - " overridden: 0", - " androidETC2FallbackOverride: 0", - " forceMaximumCompressionQuality_BC6H_BC7: 0", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", " spriteSheet:", - " serializedVersion: 2", - " sprites: []", - " outline: []", - " physicsShape: []", - " bones: []", - " spriteID: ", - " internalID: 0", - " vertices: []", - " indices: ", - " edges: []", - " weights: []", - " secondaryTextures: []", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", " spritePackingTag: ", " pSDRemoveMatte: 0", " pSDShowRemoveMatteOption: 0", @@ -2812,7 +2812,7 @@ " m_Colors:", " - _BaseColor: {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: 1}", + " - _EmissionColor: {r: $(param:emission_energy), g: $(param:emission_energy), b: $(param:emission_energy), a: 1}", " - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}", " m_BuildTextureStacks: []", "" From eed43ee215425dec3a51c177b1a595cd2bed7b24 Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 17:11:33 +0800 Subject: [PATCH 5/9] revert roughness export --- addons/material_maker/nodes/material.mmg | 88 ++++++++++++------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index a9d4be2eb..d388d20a1 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -2564,21 +2564,21 @@ " externalObjects: {}", " serializedVersion: 10", " mipmaps:", - "\tmipMapMode: 0", - "\tenableMipMap: 1", - "\tsRGBTexture: 1", - "\tlinearTexture: 0", - "\tfadeOut: 0", - "\tborderMipMap: 0", - "\tmipMapsPreserveCoverage: 0", - "\talphaTestReferenceValue: 0.5", - "\tmipMapFadeDistanceStart: 1", - "\tmipMapFadeDistanceEnd: 3", + " mipMapMode: 0", + " enableMipMap: 1", + " sRGBTexture: 1", + " linearTexture: 0", + " fadeOut: 0", + " borderMipMap: 0", + " mipMapsPreserveCoverage: 0", + " alphaTestReferenceValue: 0.5", + " mipMapFadeDistanceStart: 1", + " mipMapFadeDistanceEnd: 3", " bumpmap:", - "\tconvertToNormalMap: 0", - "\texternalNormalMap: 0", - "\theightScale: 0.25", - "\tnormalMapFilter: 0", + " convertToNormalMap: 0", + " externalNormalMap: 0", + " heightScale: 0.25", + " normalMapFilter: 0", " isReadable: 0", " streamingMipmaps: 0", " streamingMipmapsPriority: 0", @@ -2589,13 +2589,13 @@ " textureFormat: 1", " maxTextureSize: 2048", " textureSettings:", - "\tserializedVersion: 2", - "\tfilterMode: -1", - "\taniso: -1", - "\tmipBias: -100", - "\twrapU: -1", - "\twrapV: -1", - "\twrapW: -1", + " serializedVersion: 2", + " filterMode: -1", + " aniso: -1", + " mipBias: -100", + " wrapU: -1", + " wrapV: -1", + " wrapW: -1", " nPOTScale: 1", " lightmap: 0", " compressionQuality: 50", @@ -2619,29 +2619,29 @@ " platformSettings:", " - serializedVersion: 3", " buildTarget: DefaultTexturePlatform", - "\tmaxTextureSize: 2048", - "\tresizeAlgorithm: 0", - "\ttextureFormat: -1", - "\ttextureCompression: 1", - "\tcompressionQuality: 50", - "\tcrunchedCompression: 0", - "\tallowsAlphaSplitting: 0", - "\toverridden: 0", - "\tandroidETC2FallbackOverride: 0", - "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " maxTextureSize: 2048", + " resizeAlgorithm: 0", + " textureFormat: -1", + " textureCompression: 1", + " compressionQuality: 50", + " crunchedCompression: 0", + " allowsAlphaSplitting: 0", + " overridden: 0", + " androidETC2FallbackOverride: 0", + " forceMaximumCompressionQuality_BC6H_BC7: 0", " spriteSheet:", - "\tserializedVersion: 2", - "\tsprites: []", - "\toutline: []", - "\tphysicsShape: []", - "\tbones: []", - "\tspriteID: ", - "\tinternalID: 0", - "\tvertices: []", - "\tindices: ", - "\tedges: []", - "\tweights: []", - "\tsecondaryTextures: []", + " serializedVersion: 2", + " sprites: []", + " outline: []", + " physicsShape: []", + " bones: []", + " spriteID: ", + " internalID: 0", + " vertices: []", + " indices: ", + " edges: []", + " weights: []", + " secondaryTextures: []", " spritePackingTag: ", " pSDRemoveMatte: 0", " pSDShowRemoveMatteOption: 0", @@ -2801,7 +2801,7 @@ " - _Parallax: $(expr:0.005+(0.08-0.005)*$(param:depth_scale))", " - _QueueOffset: 0", " - _ReceiveShadows: 1", - " - _Smoothness: $(expr:1.0-$(param:roughness))", + " - _Smoothness: $(param:roughness)", " - _SmoothnessTextureChannel: 0", " - _SpecularHighlights: 1", " - _SrcBlend: 1", From 0778ca3d31a163acc745d691d485c5f4ecb0b826 Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 17:13:38 +0800 Subject: [PATCH 6/9] export normal map strength(_BumpScale) --- addons/material_maker/nodes/material.mmg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index d388d20a1..fa1a20460 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -1139,7 +1139,7 @@ "\t\tm_Scale: {x: 1, y: 1}", "\t\tm_Offset: {x: 0, y: 0}", "\tm_Floats:", - "\t- _BumpScale: 1", + "\t- _BumpScale: $(param:normal)", "\t- _Cutoff: 0.5", "\t- _DetailNormalMapScale: 1", "\t- _DstBlend: 0", From 742ef0425546dac64078e03dcf2065536f42c48a Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 17:18:07 +0800 Subject: [PATCH 7/9] update normal strength export --- addons/material_maker/nodes/material.mmg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index fa1a20460..39ac52261 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -1139,7 +1139,7 @@ "\t\tm_Scale: {x: 1, y: 1}", "\t\tm_Offset: {x: 0, y: 0}", "\tm_Floats:", - "\t- _BumpScale: $(param:normal)", + "\t- _BumpScale: 1", "\t- _Cutoff: 0.5", "\t- _DetailNormalMapScale: 1", "\t- _DstBlend: 0", @@ -2783,7 +2783,7 @@ " - _AlphaToMask: 0", " - _Blend: 0", " - _BlendModePreserveSpecular: 1", - " - _BumpScale: 1", + " - _BumpScale: $(param:normal)", " - _ClearCoatMask: 0", " - _ClearCoatSmoothness: 0", " - _Cull: 2", @@ -2801,7 +2801,7 @@ " - _Parallax: $(expr:0.005+(0.08-0.005)*$(param:depth_scale))", " - _QueueOffset: 0", " - _ReceiveShadows: 1", - " - _Smoothness: $(param:roughness)", + " - _Smoothness: $(param:roughness))", " - _SmoothnessTextureChannel: 0", " - _SpecularHighlights: 1", " - _SrcBlend: 1", From f29ab7f7d52dee02c759f52ede2a70523ef09dd7 Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 17:50:45 +0800 Subject: [PATCH 8/9] fix emission export --- addons/material_maker/nodes/material.mmg | 132 ++++++++++++++--------- 1 file changed, 84 insertions(+), 48 deletions(-) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index 39ac52261..7fc14d504 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -2557,31 +2557,34 @@ "file_name": "$(path_prefix)_emission.png.meta", "prompt_overwrite": true, "template": [ - "fileFormatVersion: 2", + "fileFormatVersion: 2", "guid: $uid(5)", "TextureImporter:", " internalIDToNameTable: []", " externalObjects: {}", " serializedVersion: 10", " mipmaps:", - " mipMapMode: 0", - " enableMipMap: 1", - " sRGBTexture: 1", - " linearTexture: 0", - " fadeOut: 0", - " borderMipMap: 0", - " mipMapsPreserveCoverage: 0", - " alphaTestReferenceValue: 0.5", - " mipMapFadeDistanceStart: 1", - " mipMapFadeDistanceEnd: 3", + "\tmipMapMode: 0", + "\tenableMipMap: 1", + "\tsRGBTexture: 1", + "\tlinearTexture: 0", + "\tfadeOut: 0", + "\tborderMipMap: 0", + "\tmipMapsPreserveCoverage: 0", + "\talphaTestReferenceValue: 0.5", + "\tmipMapFadeDistanceStart: 1", + "\tmipMapFadeDistanceEnd: 3", " bumpmap:", - " convertToNormalMap: 0", - " externalNormalMap: 0", - " heightScale: 0.25", - " normalMapFilter: 0", + "\tconvertToNormalMap: 0", + "\texternalNormalMap: 0", + "\theightScale: 0.25", + "\tnormalMapFilter: 0", + "\tflipGreenChannel: 0", " isReadable: 0", " streamingMipmaps: 0", " streamingMipmapsPriority: 0", + " vTOnly: 0", + " ignoreMipmapLimit: 0", " grayScaleToAlpha: 0", " generateCubemap: 6", " cubemapConvolution: 0", @@ -2589,13 +2592,13 @@ " textureFormat: 1", " maxTextureSize: 2048", " textureSettings:", - " serializedVersion: 2", - " filterMode: -1", - " aniso: -1", - " mipBias: -100", - " wrapU: -1", - " wrapV: -1", - " wrapW: -1", + "\tserializedVersion: 2", + "\tfilterMode: 1", + "\taniso: 1", + "\tmipBias: 0", + "\twrapU: 0", + "\twrapV: 0", + "\twrapW: 0", " nPOTScale: 1", " lightmap: 0", " compressionQuality: 50", @@ -2613,42 +2616,75 @@ " textureType: 0", " textureShape: 1", " singleChannelComponent: 0", + " flipbookRows: 1", + " flipbookColumns: 1", " maxTextureSizeSet: 0", " compressionQualitySet: 0", " textureFormatSet: 0", + " ignorePngGamma: 0", + " applyGammaDecoding: 1", + " swizzle: 50462976", + " cookieLightType: 1", " platformSettings:", " - serializedVersion: 3", - " buildTarget: DefaultTexturePlatform", - " maxTextureSize: 2048", - " resizeAlgorithm: 0", - " textureFormat: -1", - " textureCompression: 1", - " compressionQuality: 50", - " crunchedCompression: 0", - " allowsAlphaSplitting: 0", - " overridden: 0", - " androidETC2FallbackOverride: 0", - " forceMaximumCompressionQuality_BC6H_BC7: 0", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tignorePlatformSupport: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " - serializedVersion: 3", + "\tbuildTarget: DefaultTexturePlatform", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 0", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tignorePlatformSupport: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", + " - serializedVersion: 3", + "\tbuildTarget: Standalone", + "\tmaxTextureSize: 2048", + "\tresizeAlgorithm: 0", + "\ttextureFormat: -1", + "\ttextureCompression: 1", + "\tcompressionQuality: 50", + "\tcrunchedCompression: 0", + "\tallowsAlphaSplitting: 0", + "\toverridden: 0", + "\tignorePlatformSupport: 0", + "\tandroidETC2FallbackOverride: 0", + "\tforceMaximumCompressionQuality_BC6H_BC7: 0", " spriteSheet:", - " serializedVersion: 2", - " sprites: []", - " outline: []", - " physicsShape: []", - " bones: []", - " spriteID: ", - " internalID: 0", - " vertices: []", - " indices: ", - " edges: []", - " weights: []", - " secondaryTextures: []", - " spritePackingTag: ", + "\tserializedVersion: 2", + "\tsprites: []", + "\toutline: []", + "\tphysicsShape: []", + "\tbones: []", + "\tspriteID: ", + "\tinternalID: 0", + "\tvertices: []", + "\tindices: ", + "\tedges: []", + "\tweights: []", + "\tsecondaryTextures: []", + "\tnameFileIdTable: {}", + " mipmapLimitGroupName: ", " pSDRemoveMatte: 0", - " pSDShowRemoveMatteOption: 0", " userData: ", " assetBundleName: ", " assetBundleVariant: ", - "" + "" ], "type": "template" }, From daa199c4a2318a71dd2dadf68377fa3c8e0e7533 Mon Sep 17 00:00:00 2001 From: LMW Date: Sat, 24 Aug 2024 18:11:30 +0800 Subject: [PATCH 9/9] toggle emission if emission texture is connected --- addons/material_maker/nodes/material.mmg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/material_maker/nodes/material.mmg b/addons/material_maker/nodes/material.mmg index 7fc14d504..d8d944887 100644 --- a/addons/material_maker/nodes/material.mmg +++ b/addons/material_maker/nodes/material.mmg @@ -2722,7 +2722,11 @@ " - _NORMALMAP", " - _PARALLAXMAP", " - _METALLICSPECGLOSSMAP", + "$if $(connected:emission_tex)", + " m_LightmapFlags: 0", + "$else", " m_LightmapFlags: 4", + "$fi", " m_EnableInstancingVariants: 0", " m_DoubleSidedGI: 0", " m_CustomRenderQueue: -1",