pioneerspacesim/pioneer — pull request #1976 by robn (2013-01-20 22:27:36+00:00)
Title: Draw "empty" decals with transparent colour

On Intel (with shaders) an empty/uninitialised decal gets you this:

![](http://i.imgur.com/C8qgxZV.png)

Presumably some difference in the say null/uninitialised textures are sampled.

This patch works around it by setting the diffuse and specular to have zero alpha if the decal is not set. I've also added a `ClearDecal` method, because that seems useful.

I'm not super-happy about the way I've done this - I really don't enjoying fiddling around inside materials. And it seems that trying to draw a null texture is kind of a dangerous thing to do. Perhaps nicer would be to actually disable the decal meshes, but since they could be all over the place its kind of painful to do.

Anyway, I'll leave it to someone to decide whether to merge this as-is, tell me the right way to do it, or fix it yourself. I'm don't mind :)