Hi,
I am trying to see if I can use a different approach for farmlands…
So I created a Quad mesh and applied a dirt texture to it and created a halo-like AlphaMap in gimp
and so far everything looks fine:
here is the relevent code:
CenterQuad quad = new CenterQuad(size.x, size.z, true);
Geometry land = new Geometry(null, quad);
land.setLocalTranslation(loc);
Material mat = new Material(assets, Materials.LIGHTING);
Texture diffuse = assets.loadTexture("Textures/Dirt/28.png");
mat.setTexture("DiffuseMap", diffuse);
alpha = assets.loadTexture("Textures/farmland-alpha.png");
mat.setTexture("AlphaMap", alpha);
mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
land.setMaterial(mat);
then I decided to scale texture coordinates and set dirt texture to wrap repeat like this:
quad.scaleTextureCoordinates(new Vector2f(size.x / 4, size.z / 4));
diffuse.setWrap(Texture.WrapMode.Repeat);
and this is how it looks, which is not what I want
if I remove the AlphaMap it looks fine but of course without the transparency over the land borders.
Is there a simple trick I can do to fix this?
Thanks in advance