List of usage examples for com.badlogic.gdx.graphics.g3d.attributes BlendingAttribute Type
long Type
To view the source code for com.badlogic.gdx.graphics.g3d.attributes BlendingAttribute Type.
Click Source Link
From source file:com.badlogic.gdx.tests.g3d.shadows.system.classical.Pass2Shader.java
License:Apache License
@Override public void render(Renderable renderable, Attributes combinedAttributes) { if (shadowSystem.isFirstCallPass2()) combinedAttributes.remove(BlendingAttribute.Type); else//from w w w . j a v a2s .com combinedAttributes.set(blend); combinedAttributes.set(depth); super.render(renderable, combinedAttributes); }
From source file:com.github.fauu.helix.displayable.ModelDisplayable.java
License:Open Source License
public void updateOpacity(float opacity) { for (Material material : instance.materials) { BlendingAttribute ba = (BlendingAttribute) material.get(BlendingAttribute.Type); ba.opacity = opacity;//from w ww . j a va2 s .c om } }
From source file:com.uos.mortaldestiny.rendering.FrontShader.java
License:Apache License
@Override public boolean canRender(Renderable renderable) { final Attributes attributes = combineAttributes(renderable); if (attributes.has(BlendingAttribute.Type)) { if ((attributesMask & BlendingAttribute.Type) != BlendingAttribute.Type) return false; if (attributes.has(TextureAttribute.Diffuse) != ((attributesMask & TextureAttribute.Diffuse) == TextureAttribute.Diffuse)) return false; }/*from w w w .j av a2 s .c om*/ final boolean skinned = ((renderable.meshPart.mesh.getVertexAttributes().getMask() & Usage.BoneWeight) == Usage.BoneWeight); if (skinned != (numBones > 0)) return false; if (!skinned) return true; int w = 0; final int n = renderable.meshPart.mesh.getVertexAttributes().size(); for (int i = 0; i < n; i++) { final VertexAttribute attr = renderable.meshPart.mesh.getVertexAttributes().get(i); if (attr.usage == Usage.BoneWeight) w |= (1 << attr.unit); } return w == weights; }
From source file:com.uos.mortaldestiny.rendering.FrontShader.java
License:Apache License
@Override public void render(Renderable renderable, Attributes combinedAttributes) { if (combinedAttributes.has(BlendingAttribute.Type)) { final BlendingAttribute blending = (BlendingAttribute) combinedAttributes.get(BlendingAttribute.Type); combinedAttributes.remove(BlendingAttribute.Type); final boolean hasAlphaTest = combinedAttributes.has(FloatAttribute.AlphaTest); if (!hasAlphaTest) combinedAttributes.set(alphaTestAttribute); if (blending.opacity >= ((FloatAttribute) combinedAttributes.get(FloatAttribute.AlphaTest)).value) super.render(renderable, combinedAttributes); if (!hasAlphaTest) combinedAttributes.remove(FloatAttribute.AlphaTest); combinedAttributes.set(blending); } else//from ww w . j a va 2s. com super.render(renderable, combinedAttributes); }
From source file:gaia.cu9.ari.gaiaorbit.util.override.AtmosphereShader.java
License:Apache License
@Override public void render(final Renderable renderable) { if (!renderable.material.has(BlendingAttribute.Type)) context.setBlending(false, GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); bindMaterial(renderable);/* w w w . ja v a2s. com*/ super.render(renderable); }