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

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

Introduction

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

Prototype

public final Attribute get(final long type) 

Source Link

Document

Example usage: ((BlendingAttribute)material.get(BlendingAttribute.ID)).sourceFunction;

Usage

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