[Bf-codereview] BGE Harmony Branch (issue 5491068)

mogurijin at gmail.com mogurijin at gmail.com
Tue Mar 6 04:53:36 CET 2012


Okay, so I was looking into fixing up the lamp texture code. This was
previously trying to mimic Unity's light "cookies", which alter shadows,
but then the feature expanded to just light textures in general. So, I
cleaned it up to not depend on shadow code. Instead now, it modifies the
light's color value. The downside to this is that a lamp's dynpersmat
was only properly updated when shadow buffers were bound (persmat was
updated, which allowed dynpersmat to be calculated correctly), which
made the feature not work with shadows disabled. I moved the matrix
update code into another function that is now also called in
GPU_material_bind_uniforms(), but now the matrix updates (moved to
GPU_lamp_update_buffer_mats()) are called twice for shadow buffer
updates (binding shadow buffers and then binding uniforms).

Here's a patch of gpu_material.c against the Harmony branch:
http://www.pasteall.org/29768/diff

Any thoughts?

https://codereview.appspot.com/5491068/


More information about the Bf-codereview mailing list