[Bf-codereview] BGE: Material replacement for texface options (issue4289041)

dfelinto at gmail.com dfelinto at gmail.com
Tue Mar 15 03:51:30 CET 2011


Comments over the last patch.
1)renamed all blend modes, alpha modes, ... to alphablend (using
alpha_blend for DNA but alphablend for the code variables).

2)bug fixed - in GLSL mode tface alpha mode was being used in 3dview

3) there is still a last known bug. See comments in DerivedMesh.c

4) as commented before I couldn't make the UI without the labels.


http://codereview.appspot.com/4289041/diff/29/source/blender/blenkernel/intern/DerivedMesh.c
File source/blender/blenkernel/intern/DerivedMesh.c (right):

http://codereview.appspot.com/4289041/diff/29/source/blender/blenkernel/intern/DerivedMesh.c#newcode965
source/blender/blenkernel/intern/DerivedMesh.c:965: dodraw =
setMaterial(matnr = new_matnr, &gattribs);
~remaining BUG~
In GLSL and edit mode AlphaBlend is always SOLID.

When Blender goes to edit mode the GMS.alphapass is 0. That happens
because v3d->transp=FALSE since we are not in the "view3d_draw_transp"
pass.
The old workaround was to set the alphablend after setting the material.
I see 2 options:
(1) set alphapass TRUE when in edit mode; OR
(2)get material from GPU and set alpha based on the material (on the
real Material, not GMS.alphablend since this is solid when we are not in
the alpha pass).

http://codereview.appspot.com/4289041/diff/29/source/blender/blenkernel/intern/cdderivedmesh.c
File source/blender/blenkernel/intern/cdderivedmesh.c (right):

http://codereview.appspot.com/4289041/diff/29/source/blender/blenkernel/intern/cdderivedmesh.c#newcode1021
source/blender/blenkernel/intern/cdderivedmesh.c:1021: continue;
Unlike in DerivedMesh.c we have the right alpha when we get here. So no
need to set it again based on the face.

http://codereview.appspot.com/4289041/diff/29/source/blender/blenkernel/intern/cdderivedmesh.c#newcode1177
source/blender/blenkernel/intern/cdderivedmesh.c:1177: }
I'm not so sure of what it's going on here, I probably over deleted
code. I will leave it for later, in a final round of adjustments.

http://codereview.appspot.com/4289041/diff/29/source/blender/editors/space_view3d/drawmesh.c
File source/blender/editors/space_view3d/drawmesh.c (right):

http://codereview.appspot.com/4289041/diff/29/source/blender/editors/space_view3d/drawmesh.c#newcode274
source/blender/editors/space_view3d/drawmesh.c:274: /* Icky globals, fix
with userdata parameter */
moved this to above the set_draw_settings_cached to avoid the need of a
prototype.

http://codereview.appspot.com/4289041/


More information about the Bf-codereview mailing list