Search in sources :

Example 6 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class BillboardParticleBatch method setTexture.

public void setTexture(Texture texture) {
    renderablePool.freeAll(renderables);
    renderables.clear();
    for (int i = 0, free = renderablePool.getFree(); i < free; ++i) {
        Renderable renderable = renderablePool.obtain();
        TextureAttribute attribute = (TextureAttribute) renderable.material.get(TextureAttribute.Diffuse);
        attribute.textureDescription.texture = texture;
    }
    this.texture = texture;
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable) TextureAttribute(com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute)

Example 7 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class BillboardParticleBatch method allocShader.

private void allocShader() {
    Renderable newRenderable = allocRenderable();
    shader = newRenderable.shader = getShader(newRenderable);
    renderablePool.free(newRenderable);
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable)

Example 8 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class BillboardParticleBatch method clearRenderablesPool.

private void clearRenderablesPool() {
    renderablePool.freeAll(renderables);
    for (int i = 0, free = renderablePool.getFree(); i < free; ++i) {
        Renderable renderable = renderablePool.obtain();
        renderable.meshPart.mesh.dispose();
    }
    renderables.clear();
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable)

Example 9 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class RenderableShapeBuilder method buildNormals.

/** Builds normal, tangent and binormal of a RenderableProvider.
	 * @param builder
	 * @param renderableProvider
	 * @param vectorSize Size of the normal vector
	 * @param normalColor Normal vector's color
	 * @param tangentColor Tangent vector's color
	 * @param binormalColor Binormal vector's color */
public static void buildNormals(MeshPartBuilder builder, RenderableProvider renderableProvider, float vectorSize, Color normalColor, Color tangentColor, Color binormalColor) {
    renderableProvider.getRenderables(renderables, renderablesPool);
    for (Renderable renderable : renderables) {
        buildNormals(builder, renderable, vectorSize, normalColor, tangentColor, binormalColor);
    }
    renderablesPool.flush();
    renderables.clear();
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable)

Example 10 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class PointSpriteParticleBatch method allocRenderable.

protected void allocRenderable() {
    renderable = new Renderable();
    renderable.meshPart.primitiveType = GL20.GL_POINTS;
    renderable.meshPart.offset = 0;
    renderable.material = new Material(new BlendingAttribute(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA, 1f), new DepthTestAttribute(GL20.GL_LEQUAL, false), TextureAttribute.createDiffuse((Texture) null));
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable) BlendingAttribute(com.badlogic.gdx.graphics.g3d.attributes.BlendingAttribute) Material(com.badlogic.gdx.graphics.g3d.Material) DepthTestAttribute(com.badlogic.gdx.graphics.g3d.attributes.DepthTestAttribute)

Aggregations

Renderable (com.badlogic.gdx.graphics.g3d.Renderable)14 Material (com.badlogic.gdx.graphics.g3d.Material)6 ModelBuilder (com.badlogic.gdx.graphics.g3d.utils.ModelBuilder)3 Mesh (com.badlogic.gdx.graphics.Mesh)2 PerspectiveCamera (com.badlogic.gdx.graphics.PerspectiveCamera)2 ModelInstance (com.badlogic.gdx.graphics.g3d.ModelInstance)2 Shader (com.badlogic.gdx.graphics.g3d.Shader)2 ColorAttribute (com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute)2 DirectionalLight (com.badlogic.gdx.graphics.g3d.environment.DirectionalLight)2 InputMultiplexer (com.badlogic.gdx.InputMultiplexer)1 AssetManager (com.badlogic.gdx.assets.AssetManager)1 Pixmap (com.badlogic.gdx.graphics.Pixmap)1 Texture (com.badlogic.gdx.graphics.Texture)1 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)1 Environment (com.badlogic.gdx.graphics.g3d.Environment)1 Model (com.badlogic.gdx.graphics.g3d.Model)1 ModelBatch (com.badlogic.gdx.graphics.g3d.ModelBatch)1 ModelCache (com.badlogic.gdx.graphics.g3d.ModelCache)1 BlendingAttribute (com.badlogic.gdx.graphics.g3d.attributes.BlendingAttribute)1 DepthTestAttribute (com.badlogic.gdx.graphics.g3d.attributes.DepthTestAttribute)1