I’m trying to render a polyhedron where each triangle (or face) consists of an outer triangle which is uniformly colored and an inside triangle which is not. To do this I’m using textures for the inside triangle.
The problem is that the textures are not rendered at certain angles. The two pictures below show the exact same polyhedron but with the camera slightly rotated. The texture is only displayed on one and shifts in the two pictures. I assume this is due to the angle as that is all that was changed.
The code i use to generate the inside material :
private Material getMaterial(ColorRGBA colorRGBA) {
Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
TextureKey key = new TextureKey("/squigly.jpg");
Texture tex = assetManager.loadTexture(key);
material.setTexture("ColorMap", tex);
material.setColor("Color", colorRGBA);
return material;
}
EDIT: The provided code looks fine so the problem must be elsewhere, can you post your full test-case?.
For texture loading you can use: assetManager.loadTexture("path-to-texture") instead of manually creating a key previously.