[SOLVED] Quad geometry appears as yellow

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):
image

And this is what ends up in the scene (bottom right). The result looks yellow with white letters appearing on it

image

Does anyone have a good idea as to what is going on ?

AFAIK, that’s the default “Missing Texture” image that is used when it can not find/load the actual texture I guess.

3 Likes

Ah, thanks for pointing me in that direction.

If you check out the console logs JME should provide you with the the detailed log on what is missing, I guess.

Does JME even support bm2 files (or rather does Java ImageIO)?

It worked previously, so I think it does. I previously just used the AWTLoader to load them with no issue. I’ll update this later today.

My build was not including the bm2 files. It works now. Thank you both.

2 Likes