public RotateWidget withZAxis(final ReadOnlyColorRGBA color, final float scale, final float width) { if (_zRing != null) { _zRing.removeFromParent(); } _zRing = new InteractRing("zRotRing", 4, 32, scale, width); _zRing.setDefaultColor(color); _handle.attachChild(_zRing); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); _zRing.setRenderState(blend); return this; }
private static UIQuad createStandinQuad() { final UIQuad quad = new UIQuad("standin", 1, 1); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); quad.setRenderState(blend); quad.updateWorldRenderStates(false); return quad; } }
public static UIArc createStandinArc() { final UIArc arc = new UIArc("standin", MathUtils.TWO_PI / 60, 1, 0.5); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); arc.setRenderState(blend); arc.updateWorldRenderStates(false); return arc; } }
public static UIDisk createStandinDisk() { final UIDisk disk = new UIDisk("standin", 60, 1, 0); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); disk.setRenderState(blend); disk.updateWorldRenderStates(false); return disk; } }
private static UIQuad createStandinQuad() { final UIQuad quad = new UIQuad("standin", 1, 1); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); quad.setRenderState(blend); quad.updateWorldRenderStates(false); return quad; } }
public BlendState getBlendState() { if (forceBlend || d != -1 && d < 1.0f) { final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blend.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); blend.setTestEnabled(true); blend.setTestFunction(BlendState.TestFunction.GreaterThan); blend.setReference(0); return blend; } return null; }
/** * @return a blend state that does alpha blending and writes the max alpha value (source or destination) back to the * color buffer. */ private static BlendState createSrcRGBMaxAlphaBlend() { final BlendState state = new BlendState(); state.setBlendEnabled(true); state.setSourceFunctionRGB(SourceFunction.SourceAlpha); state.setDestinationFunctionRGB(DestinationFunction.Zero); state.setBlendEquationRGB(BlendEquation.Add); state.setSourceFunctionAlpha(SourceFunction.SourceAlpha); state.setDestinationFunctionAlpha(DestinationFunction.DestinationAlpha); state.setBlendEquationAlpha(BlendEquation.Max); return state; }
/** * @return a blend state that does alpha blending and writes the max alpha value (source or destination) back to the * color buffer. */ private static BlendState createBlendRGBMaxAlphaBlend() { final BlendState state = new BlendState(); state.setBlendEnabled(true); state.setSourceFunctionRGB(SourceFunction.SourceAlpha); state.setDestinationFunctionRGB(DestinationFunction.OneMinusSourceAlpha); state.setBlendEquationRGB(BlendEquation.Add); state.setSourceFunctionAlpha(SourceFunction.SourceAlpha); state.setDestinationFunctionAlpha(DestinationFunction.DestinationAlpha); state.setBlendEquationAlpha(BlendEquation.Max); return state; }
public LineGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) { super(width, height, renderer, caps); // Setup our static horizontal graph lines createHLines(); _defBlendState = new BlendState(); _defBlendState.setEnabled(true); _defBlendState.setBlendEnabled(true); _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _graphRoot.setRenderState(_defBlendState); _graphRoot.getSceneHints().setCullHint(CullHint.Never); }
public TimedAreaGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) { super(width, height, renderer, caps); // Setup our static horizontal graph lines createHLines(); _defBlendState = new BlendState(); _defBlendState.setEnabled(true); _defBlendState.setBlendEnabled(true); _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _graphRoot.setRenderState(_defBlendState); _graphRoot.getSceneHints().setCullHint(CullHint.Never); }
public LineGrapher(final int width, final int height, final Renderer renderer) { super(width, height, renderer); // Setup our static horizontal graph lines createHLines(); _defBlendState = new BlendState(); _defBlendState.setEnabled(true); _defBlendState.setBlendEnabled(true); _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _graphRoot.setRenderState(_defBlendState); _graphRoot.getSceneHints().setCullHint(CullHint.Never); }
public TimedAreaGrapher(final int width, final int height, final Renderer renderer) { super(width, height, renderer); // Setup our static horizontal graph lines createHLines(); _defBlendState = new BlendState(); _defBlendState.setEnabled(true); _defBlendState.setBlendEnabled(true); _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _graphRoot.setRenderState(_defBlendState); _graphRoot.getSceneHints().setCullHint(CullHint.Never); }
RenderStateSetter(final Texture texture, final boolean useBlend) { textureState = new TextureState(); textureState.setTexture(texture); blendState = new BlendState(); blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); blendState.setTestEnabled(true); blendState.setTestFunction(BlendState.TestFunction.GreaterThan); zBuffState = new ZBufferState(); zBuffState.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo); setUseBlend(useBlend); }
RenderStateSetter(final Texture texture, final boolean useBlend) { textureState = new TextureState(); textureState.setTexture(texture); blendState = new BlendState(); blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); blendState.setTestEnabled(true); blendState.setTestFunction(BlendState.TestFunction.GreaterThan); zBuffState = new ZBufferState(); zBuffState.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo); setUseBlend(useBlend); }
private void updateBlendState(final boolean additive) { BlendState blend = (BlendState) getEdittedParticles().getLocalRenderState(StateType.Blend); if (blend == null) { blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blend.setTestEnabled(true); blend.setTestFunction(BlendState.TestFunction.GreaterThan); getEdittedParticles().setRenderState(blend); } blend.setDestinationFunction( additive ? BlendState.DestinationFunction.One : BlendState.DestinationFunction.OneMinusSourceAlpha); }
public TabledLabelGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) { super(width, height, renderer, caps); _defBlendState = new BlendState(); _defBlendState.setEnabled(true); _defBlendState.setBlendEnabled(true); _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _graphRoot.setRenderState(_defBlendState); _bgQuad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); _bgQuad.setDefaultColor(new ColorRGBA(ColorRGBA.BLACK)); _graphRoot.getSceneHints().setCullHint(CullHint.Never); }
public TabledLabelGrapher(final int width, final int height, final Renderer renderer) { super(width, height, renderer); _defBlendState = new BlendState(); _defBlendState.setEnabled(true); _defBlendState.setBlendEnabled(true); _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _graphRoot.setRenderState(_defBlendState); _bgQuad.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); _bgQuad.setDefaultColor(new ColorRGBA(ColorRGBA.BLACK)); _graphRoot.getSceneHints().setCullHint(CullHint.Never); }
private void applyStates(final TextMesh mesh, final Texture2D tex) { final TextureState textureState = new TextureState(); textureState.setTexture(tex); mesh.setRenderState(textureState); final BlendState blendState = new BlendState(); blendState.setBlendEnabled(true); blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); blendState.setTestEnabled(true); blendState.setTestFunction(BlendState.TestFunction.GreaterThan); blendState.setReference(0f); mesh.setRenderState(blendState); mesh.updateWorldRenderStates(false); }
protected Mesh createSelectionMesh() { final Mesh mesh = new Mesh("selectionMesh"); mesh.setRenderMaterial("ui/untextured/default_color.yaml"); final MeshData mData = mesh.getMeshData(); mData.setVertexBuffer(BufferUtils.createVector3Buffer(6)); mData.setIndexMode(IndexMode.Triangles); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); mesh.setDefaultColor(ColorRGBA.LIGHT_GRAY); return mesh; }
private static Mesh createMesh() { final Mesh mesh = new Mesh(); mesh.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(4)); mesh.getMeshData().setColorBuffer(BufferUtils.createColorBuffer(4)); mesh.getMeshData().setIndexMode(IndexMode.TriangleFan); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); return mesh; } }