public RenderState extract(final Stack<? extends RenderState> stack, final Spatial spat) {
if (spat == null) {
return stack.peek();
}
final TextureCombineMode mode = spat.getSceneHints().getTextureCombineMode();
if (mode == TextureCombineMode.Replace || (mode != TextureCombineMode.Off && stack.size() == 1)) {
// todo: use dummy state if off?
return stack.peek();
}