public void Init(string[] paths) { if (gen == null) { gen = new MicroSplatGenerator(); } gen.Init(paths); for (int i = 0; i < paths.Length; ++i) { string p = paths[i]; if (p.EndsWith("microsplat_template_hdrp2019_template.txt")) { templateHDRP = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_func_tess2.txt")) { templateTess = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_shaderdesc.txt")) { templateShaderDesc = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_chain.txt")) { templateChain = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_passforward.txt")) { templatePassForward = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_passgbuffer.txt")) { templatePassGBuffer = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_passdepthonly.txt")) { templatePassDepthOnly = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_passmeta.txt")) { templatePassMeta = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_passsceneelection.txt")) { templatePassSceneSelection = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_passshadow.txt")) { templatePassShadow = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_shared.txt")) { templateHDRPShared = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_shared.txt")) { templateShared = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_vert.txt")) { templateVert = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_hdrp2019_include.txt")) { templateInclude = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } } if (templateHDRP == null || templateInclude == null || templateShared == null || templateVert == null || templateHDRPShared == null || templatePassGBuffer == null) { Debug.LogError("HDRP Template files not found, will not be able to compile shaders"); } }
public void Init(string[] paths) { if (gen == null) { gen = new MicroSplatGenerator(); } gen.Init(paths); foreach (var p in paths) { if (p.EndsWith("microsplat_template_standard.txt")) { templateStandard = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_func_tess2.txt")) { templateTess = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_chain.txt")) { templateChain = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_standard_passforward.txt")) { templatePassForward = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_standard_passforwardadd.txt")) { templatePassForwardAdd = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_standard_passgbuffer.txt")) { templatePassGBuffer = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_standard_passmeta.txt")) { templatePassMeta = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_standard_passshadow.txt")) { templatePassShadow = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_standard_commonHLSL.txt")) { templateCommonHLSL = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_shaderdesc.txt")) { templateShaderDesc = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } else if (p.EndsWith("microsplat_template_shared.txt")) { templateShared = AssetDatabase.LoadAssetAtPath <TextAsset>(p); } } if (templateStandard == null) { Debug.LogError("Cannot find microsplat_template_standard.txt, will not be able to compile valid shaders"); } if (templateChain == null) { Debug.LogError("Cannot find microsplat_template_chain.txt, will not be able to compile valid shaders"); } if (templatePassForward == null) { Debug.LogError("Cannot find template for pass forward, will not be able to compile valid shaders"); } if (templatePassForwardAdd == null) { Debug.LogError("Cannot find template for pass forward add, will not be able to compile valid shaders"); } if (templatePassGBuffer == null) { Debug.LogError("Cannot find template for pass gbuffer, will not be able to compile valid shaders"); } if (templatePassShadow == null) { Debug.LogError("Cannot find template for pass shadow, will not be able to compile valid shaders"); } if (templatePassMeta == null) { Debug.LogError("Cannot find template for pass meta, will not be able to compile valid shaders"); } if (templateShaderDesc == null) { Debug.LogError("Cannot find template for shader desc, will not be able to compile valid shaders"); } if (templateShared == null) { Debug.LogError("Cannot find template for template shared, will not be able to compile valid shaders"); } if (templateCommonHLSL == null) { Debug.LogError("Cannot find template for template common HLSL, will not be able to compile valid shaders"); } }