Example usage for com.badlogic.gdx.graphics.g3d Attributes remove

List of usage examples for com.badlogic.gdx.graphics.g3d Attributes remove

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d Attributes remove.

Prototype

public final void remove(final long mask) 

Source Link

Document

Removes the attribute from the material, i.e.: material.remove(BlendingAttribute.ID); Can also be used to remove multiple attributes also, i.e.

Usage

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/*  ww w. java  2s.  c o m*/
        combinedAttributes.set(blend);

    combinedAttributes.set(depth);

    super.render(renderable, combinedAttributes);
}

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  w w  w .j  ava  2 s  .  c o  m*/
        super.render(renderable, combinedAttributes);
}