Hey
I run into a weird bug regarding quads/textures, after doing some refactoring. I create the spatial as such:
private Spatial createOver2(EntityId eId) {
Quad quad = new Quad(CoreViewConstants.OVER2SIZE, CoreViewConstants.OVER2SIZE);
//<-- Move into the material?
float halfSize = CoreViewConstants.OVER2SIZE * 0.5f;
quad.setBuffer(VertexBuffer.Type.Position, 3, this.getArray(halfSize));
//-->
quad.updateBound();
Geometry geom = new Geometry("Over2", quad);
Material mat = assets.loadMaterial("Materials/Over2MaterialLight.j3m");
mat.setFloat("StartTime", timer.getTimeInSeconds());
geom.setMaterial(mat);
geom.setQueueBucket(RenderQueue.Bucket.Transparent);
return geom;
}
private float[] getArray(float halfSize) {
float[] res = new float[]{
halfSize, 0, -halfSize,
-halfSize, 0, -halfSize,
-halfSize, 0, halfSize,
halfSize, 0, halfSize
};
return res;
}
This is the j3m file:
Material Over2MaterialLight : MatDefs/Multiline/AnimateMultilineSpriteLightShader.j3md {
MaterialParameters {
numTilesX : 10
numTilesY : 3
Speed : 20
numTilesOffsetX : 0
numTilesOffsetY : 0
DiffuseMap : Flip Textures/Subspace/over2.bm2
UseMaterialColors : true
Specular : 1.0 1.0 1.0 1.0
Diffuse : 1.0 1.0 1.0 1.0
Shininess : 1
}
AdditionalRenderState {
Blend Alpha
Wireframe Off
}
}
This is the over2.bm2
file (a bitmap loaded through AWTLoader):
And this is what ends up in the scene (bottom right). The result looks yellow with white letters appearing on it
Does anyone have a good idea as to what is going on ?