Skip to content

Commit f298d09

Browse files
committed
drop wrong and broken TEXTURE_COLOUR_OP_EX mapping
1 parent 95643c6 commit f298d09

File tree

1 file changed

+11
-30
lines changed

1 file changed

+11
-30
lines changed

io_ogre/ogre/material.py

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -249,28 +249,19 @@ def generate_texture_unit(self, slot, name=None, uv_layer=None):
249249
idx = find_uv_layer_index( slot.uv_layer, self.material )
250250
self.w.iword('tex_coord_set').integer(idx).nl()
251251

252-
rgba = False
253-
if texture.image.depth == 32: rgba = True
254252
btype = slot.blend_type # TODO - fix this hack if/when slots support pyRNA
255253
ex = False; texop = None
256-
if btype in TEXTURE_COLOUR_OP:
257-
if btype=='MIX' and \
258-
((slot.use_map_alpha and not slot.use_stencil) or \
259-
(slot.texture.use_alpha and slot.texture.image.use_alpha and not slot.use_map_alpha)):
260-
if slot.diffuse_color_factor >= 1.0:
261-
texop = 'alpha_blend'
262-
else:
263-
texop = TEXTURE_COLOUR_OP[ btype ]
264-
ex = True
265-
elif btype=='MIX' and slot.use_map_alpha and slot.use_stencil:
266-
texop = 'blend_current_alpha'; ex=True
267-
elif btype=='MIX' and not slot.use_map_alpha and slot.use_stencil:
268-
texop = 'blend_texture_alpha'; ex=True
269-
else:
270-
texop = TEXTURE_COLOUR_OP[ btype ]
271-
elif btype in TEXTURE_COLOUR_OP_EXcolour_op_ex:
272-
texop = TEXTURE_COLOUR_OP_EX[ btype ]
273-
ex = True
254+
if btype=='MIX' and \
255+
((slot.use_map_alpha and not slot.use_stencil) or \
256+
(slot.texture.use_alpha and slot.texture.image.use_alpha and not slot.use_map_alpha)):
257+
if slot.diffuse_color_factor >= 1.0:
258+
texop = 'alpha_blend'
259+
elif btype=='MIX' and slot.use_map_alpha and slot.use_stencil:
260+
texop = 'blend_current_alpha'; ex=True
261+
elif btype=='MIX' and not slot.use_map_alpha and slot.use_stencil:
262+
texop = 'blend_texture_alpha'; ex=True
263+
elif btype in TEXTURE_COLOUR_OP:
264+
texop = TEXTURE_COLOUR_OP[ btype ]
274265

275266
if texop and ex:
276267
if texop == 'blend_manual':
@@ -362,16 +353,6 @@ def change_ext( self, name, image ):
362353
'MIX' : 'modulate', # Ogre Default - was "replace" but that kills lighting
363354
'ADD' : 'add',
364355
'MULTIPLY' : 'modulate',
365-
#'alpha_blend' : '',
366-
}
367-
TEXTURE_COLOUR_OP_EX = {
368-
'MIX' : 'blend_manual',
369-
'SCREEN': 'modulate_x2',
370-
'LIGHTEN': 'modulate_x4',
371-
'SUBTRACT': 'subtract',
372-
'OVERLAY': 'add_signed',
373-
'DIFFERENCE': 'dotproduct', # best match?
374-
'VALUE': 'blend_diffuse_colour',
375356
}
376357

377358
TEXTURE_ADDRESS_MODE = {

0 commit comments

Comments
 (0)