From: Mikko Rasa Date: Sun, 28 Mar 2021 12:02:23 +0000 (+0300) Subject: Export texture extension modes from Blender X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b9ba5757a3d139234b5445945b32eae4471724b7;p=libs%2Fgl.git Export texture extension modes from Blender --- diff --git a/blender/io_mspgl/export_texture.py b/blender/io_mspgl/export_texture.py index f75d8f93..2ffb5246 100644 --- a/blender/io_mspgl/export_texture.py +++ b/blender/io_mspgl/export_texture.py @@ -64,6 +64,14 @@ class SamplerExporter: else: samp_res.statements.append(Statement("filter", Token('NEAREST'))) + if tex_node.extension=="REPEAT": + samp_res.statements.append(Statement("wrap", Token('REPEAT'))) + elif tex_node.extension=="EXTEND": + samp_res.statements.append(Statement("wrap", Token('CLAMP_TO_EDGE'))) + elif tex_node.extension=="CLIP": + samp_res.statements.append(Statement("wrap", Token('CLAMP_TO_BORDER'))) + samp_res.statements.append(Statement("border_color", 0.0, 0.0, 0.0, 0.0)) + return samp_res def get_sampler_name(self, tex_node): @@ -75,5 +83,7 @@ class SamplerExporter: name_parts.append("mip") if use_interpolation and tex_node.max_anisotropy>1: name_parts.append("aniso{:g}x".format(tex_node.max_anisotropy)) + if tex_node.extension!="REPEAT": + name_parts.append("clip" if tex_node.extension=="CLIP" else "clamp") return "_".join(name_parts)+".samp"