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;
}
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);
}
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();
}
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();
}
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));
}
Aggregations