From: Mikko Rasa Date: Sat, 16 Oct 2021 12:51:11 +0000 (+0300) Subject: Add blend statement also with custom shaders X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7833c79d7d8c0741f7f3a99c7af24654a2d2f811;p=libs%2Fgl.git Add blend statement also with custom shaders --- diff --git a/blender/io_mspgl/export_material.py b/blender/io_mspgl/export_material.py index 617a683f..6a194dfb 100644 --- a/blender/io_mspgl/export_material.py +++ b/blender/io_mspgl/export_material.py @@ -6,12 +6,19 @@ def create_technique_resource(material, resources): mat_res = resources[material.name+".mat"] + blend_st = None + if material.blended: + blend_st = Statement("blend", Token("SRC_ALPHA"), Token("ONE_MINUS_SRC_ALPHA")) + if material.render_mode=='CUSTOM': for m in material.render_methods: st = Statement("method", m.tag) if mat_res and m.use_material: st.sub.append(tech_res.create_reference_statement("material", mat_res)) + if m.tag=="blended" and blend_st: + st.sub.append(blend_st) + shader = m.shader if shader.endswith(".glsl"): shader += ".shader" @@ -30,8 +37,8 @@ def create_technique_resource(material, resources): if mat_res: st.sub.append(tech_res.create_embed_statement("material", mat_res)) - if material.blended: - ss.sub.append(Statement("blend", Token("SRC_ALPHA"), Token("ONE_MINUS_SRC_ALPHA"))) + if blend_st: + st.sub.append(blend_st) if material.receive_shadows: st.sub.append(Statement("receive_shadows", True)) if material.image_based_lighting: