I got this problem and cant find the reason why since days… the thing is I did not manage to isolate/reproduce it in a simple blend so here are the symptoms :
blf objects I update on the overlay scene (ortho cam) are always ok
blf objects I update on the main scene (persp cam) can disappear depending on the camera position/orientation.
here is the setup :
. got a background, main, and interface scene,
. main camera : perspective, interface camera : ortho
. the blf class I made display/hide/move/rescale etc blf texts/boxes/img on each scene, so I can have blf objects hidden by the geometry of the nest scene.
| background scene 3d objects
| blf layer of background
| main scene 3d objects
| blf layer of main
| interface scene 3d objects
| blf layer of interface
v
final render
. got this 4000x4000 pseudo coordinates system for blf that is converted to the dimension of the viewport.
. matrices stuff to scale/locate the blf objects, common to any scene/cam type :
actually it does not disappear, the blf text colors are altered. I even obtain gradient on, could be cool if it was on purpose.
this is not a 3d text object, this is a blf one… omg
code used :
# finally render it
blf.position(font_id, x, y, 1.0)
# bgl.glColor4f(r, g, b, a)
bgl.glColor4f(1.0,1.0,1.0,1.0)
blf.enable(font_id, st)
blf.draw(font_id, area.body)
blf.disable(font_id, st)
so color should be pure white…
area.body is a string to display.
st is zero here.
tried various values in [-1,1] for blf.position z comp, similar results.
sometimes it loads a texture in blf too… I think it retrieves it from a shader in which I use several texture sampler, it could also come from videotexture objects… lost… help…
ok well if it can interest someone, I found 2 causes :
1 this comes from a particular mesh from the main scene, which has 4 vertices + one face. I use the verts to avoid a bug about object culling.
without the face it goes well,
without the verts it goes well,
both, it goes wrong.
2 this also append when I replace a mat with a gl shader. even a very simple one :
the bug appears when the object with the gl shader goes out the camera frustrum and disappear ( or at the exact moment it should disappear, if you use a 4 vertices mesh proxy before to load the mesh in the object.)
I believe the problem comes from object culling. it impacts blf objects related to the scene (post_draw) in some ways. othe blf objects are not impacted.
if they does not disappear the blf boxes and texts use one of the videotexture objects in memory.
unfortunately occlusion cant be disabled in 2.67, and world/physic = None on EACH of my blend files (omg) gives another bug before to crash :
KX_Scene::MergeScene: physics scenes type differ, aborting