Skip to content

Commit

Permalink
workaround alpha blending for blender 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Aug 30, 2024
1 parent 661ede7 commit 31b4ae0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion io_ogre/ogre/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def generate_pass( self, mat, pass_name="" ):
if mat.blend_method == "CLIP":
alpha = mat_wrapper.alpha
self.w.iword('alpha_rejection greater_equal').round(255*mat.alpha_threshold).nl()
elif mat.blend_method != "OPAQUE":
elif mat.blend_method == "BLEND":
alpha = mat_wrapper.alpha
self.w.iword('scene_blend alpha_blend').nl()
if mat.show_transparent_back:
Expand Down
2 changes: 1 addition & 1 deletion io_ogre/ogre/materialv2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def generate_pbs_datablock(self, material):
pass
elif material.blend_method == "CLIP": # CLIP enables alpha_test (alpha rejection)
datablock["alpha_test"] = ["greater_equal", material.alpha_threshold, False]
elif material.blend_method in ["HASHED", "BLEND"]:
elif material.blend_method == "BLEND":
datablock["transparency"] = {
"mode": "Transparent",
"use_alpha_from_textures": tex_filename != None, # DEFAULT
Expand Down

0 comments on commit 31b4ae0

Please sign in to comment.