Hello,
Having some difficulty here. I have a greyscale cloud texture that I am trying to apply to a quad, but I don’t seem to have the blending quite right (see screenshot):
Code is here:
Quad newQuad = new Quad("test", 1000, 1000);
newQuad.setLocalTranslation(20, 100, 20);
Texture tex = TextureManager.loadTexture(imageBuf,
Texture.MinificationFilter.BilinearNearestMipMap,
Texture.MagnificationFilter.Bilinear, 1, false);
TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
ts.setTexture(tex);
BlendState as = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
as.setBlendEnabled(true);
as.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
as.setDestinationFunction(BlendState.DestinationFunction.One);
as.setTestEnabled(true);
as.setTestFunction(BlendState.TestFunction.GreaterThan);
newQuad.setRenderState(ts);
newQuad.setRenderState(as);
newQuad.updateRenderState();
World.rootNode.attachChild(newQuad);
World.rootNode.updateRenderState();
So what am I doing wrong? Do I also need to be using a materialstate?
-Prime