Is gstate.isMaterialDiffuseUsed() look better ?