Hi,
I am new to 3D graphics programming and I am currently implementing a simple block/voxel system as practice for shapes, geometries, lighting, materials, etc.
I am already properly rendering solid standard block faces. Now I implemented my first block type with transparent textures.
Unfortunately they do not render properly from some angles.
First, how the block is created:
It consists of 12 faces (6 front, 6 back, in the example picture the bottom face is not being rendered due to being connected to the ground).
The faces have a UV map which applies a transparent part of an image to them (the transparent part of the image has an alpha channel).
I use position, index, normal, and TexCoord buffers to create them. I first add the backface data then the front face data.
I am loading my texture like this:
blockTextures = assetManager.loadTexture(new TextureKey("Textures/TextureAtlas.png", false));
and this is the material I create
Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
material.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
material.setTexture("ColorMap", blockTextureAtlas);
which I apply to my chunk geometry.
Here is how the artefact looks like. It appears differently (or not at all) depending on the viewing angle.
As you can see it creates some solid blue area which I dont want to be there.
How can I get rid of this?