From 8a364259dbf07c2d9fb09ada776c9d5db1cc1ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Br=C3=BCckner?= Date: Mon, 19 Apr 2021 21:42:09 +0200 Subject: [PATCH] Fix creation of overlay materials --- blender/arm/material/make_overlay.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/blender/arm/material/make_overlay.py b/blender/arm/material/make_overlay.py index 4d13c412..47c71df3 100644 --- a/blender/arm/material/make_overlay.py +++ b/blender/arm/material/make_overlay.py @@ -1,8 +1,9 @@ -import arm.material.cycles as cycles -import arm.material.mat_state as mat_state +import arm.material.make_finalize as make_finalize import arm.material.make_mesh as make_mesh +import arm.material.mat_state as mat_state import arm.material.mat_utils as mat_utils + def make(context_id): con = { 'name': context_id, 'depth_write': True, 'compare_mode': 'less', 'cull_mode': 'clockwise' } mat = mat_state.material @@ -14,14 +15,14 @@ def make(context_id): con['alpha_blend_source'] = mat.arm_blending_source_alpha con['alpha_blend_destination'] = mat.arm_blending_destination_alpha con['alpha_blend_operation'] = mat.arm_blending_operation_alpha - + con_overlay = mat_state.data.add_context(con) arm_discard = mat.arm_discard is_transluc = mat_utils.is_transluc(mat) parse_opacity = (blend and is_transluc) or arm_discard make_mesh.make_base(con_overlay, parse_opacity=parse_opacity) - + frag = con_overlay.frag if arm_discard: @@ -36,4 +37,6 @@ def make(context_id): frag.write('fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));') + make_finalize.make(con_overlay) + return con_overlay