public float getOutlineWidth() { return _wireframeState.getLineWidth(); }
/** * Set whether this wireframe should use antialiasing when drawing lines. May decrease performance. If you want to * enabled antialiasing, you should also use an alphastate with a source of SourceFunction.SourceAlpha and a * destination of DB_ONE_MINUS_SRC_ALPHA or DB_ONE. * * @param antialiased * true for using smoothed antialiased lines. */ public void setAntialiased(final boolean antialiased) { _antialiased = antialiased; setNeedsRefresh(true); }
public static void apply(final JoglRenderer renderer, final WireframeState state) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final WireframeStateRecord record = (WireframeStateRecord) context.getStateRecord(StateType.Wireframe); context.setCurrentState(StateType.Wireframe, state); if (state.isEnabled()) { renderer.setupLineParameters(state.getLineWidth(), 1, (short) 0xFFFF, state.isAntialiased()); switch (state.getFace()) { case Front: applyPolyMode(GL2GL3.GL_LINE, GL2GL3.GL_FILL, record); break; case Back: applyPolyMode(GL2GL3.GL_FILL, GL2GL3.GL_LINE, record); break; case FrontAndBack: default: applyPolyMode(GL2GL3.GL_LINE, GL2GL3.GL_LINE, record); break; } } else { applyPolyMode(GL2GL3.GL_FILL, GL2GL3.GL_FILL, record); } if (!record.isValid()) { record.validate(); } }
public OutlinePass(final boolean antialiased) { _wireframeState = new WireframeState(); _wireframeState.setFace(WireframeState.Face.FrontAndBack); _wireframeState.setLineWidth(DEFAULT_LINE_WIDTH); _wireframeState.setEnabled(true); _frontCull = new CullState(); _frontCull.setCullFace(Face.Front); _backCull = new CullState(); _backCull.setCullFace(Face.Back); _wireframeState.setAntialiased(antialiased); _noLights = new LightState(); _noLights.setGlobalAmbient(DEFAULT_OUTLINE_COLOR); _noLights.setEnabled(true); _noTexture = new TextureState(); _noTexture.setEnabled(true); _blendState = new BlendState(); _blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha); _blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha); _blendState.setBlendEnabled(true); _blendState.setEnabled(true); }
public static RenderState createState(final StateType type) { switch (type) { case Blend: return new BlendState(); case ColorMask: return new ColorMaskState(); case Cull: return new CullState(); case Light: return new LightState(); case Offset: return new OffsetState(); case Stencil: return new StencilState(); case Texture: return new TextureState(); case Wireframe: return new WireframeState(); case ZBuffer: return new ZBufferState(); } throw new IllegalArgumentException("Unknown state type: " + type); } }
public static void apply(final LwjglRenderer renderer, final WireframeState state) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final WireframeStateRecord record = (WireframeStateRecord) context.getStateRecord(StateType.Wireframe); context.setCurrentState(StateType.Wireframe, state); if (state.isEnabled()) { renderer.setupLineParameters(state.getLineWidth(), 1, (short) 0xFFFF, state.isAntialiased()); switch (state.getFace()) { case Front: applyPolyMode(GL11.GL_LINE, GL11.GL_FILL, record); break; case Back: applyPolyMode(GL11.GL_FILL, GL11.GL_LINE, record); break; case FrontAndBack: default: applyPolyMode(GL11.GL_LINE, GL11.GL_LINE, record); break; } } else { applyPolyMode(GL11.GL_FILL, GL11.GL_FILL, record); } if (!record.isValid()) { record.validate(); } }
return new VertexProgramState(); case Wireframe: return new WireframeState(); case ZBuffer: return new ZBufferState();
public static void apply(final Lwjgl3Renderer renderer, final WireframeState state) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final WireframeStateRecord record = (WireframeStateRecord) context.getStateRecord(StateType.Wireframe); context.setCurrentState(StateType.Wireframe, state); if (state.isEnabled()) { renderer.setupLineParameters(state.getLineWidth(), state.isAntialiased()); switch (state.getFace()) { case Front: applyPolyMode(GL11C.GL_LINE, GL11C.GL_FILL, record); break; case Back: applyPolyMode(GL11C.GL_FILL, GL11C.GL_LINE, record); break; case FrontAndBack: default: applyPolyMode(GL11C.GL_LINE, GL11C.GL_LINE, record); break; } } else { applyPolyMode(GL11C.GL_FILL, GL11C.GL_FILL, record); } if (!record.isValid()) { record.validate(); } }
/** * Set whether this wireframe should use antialiasing when drawing lines. May decrease performance. If you want to * enabled antialiasing, you should also use an alphastate with a source of SourceFunction.SourceAlpha and a * destination of DB_ONE_MINUS_SRC_ALPHA or DB_ONE. * * @param antialiased * true for using smoothed antialiased lines. */ public void setAntialiased(final boolean antialiased) { _antialiased = antialiased; setNeedsRefresh(true); }
/** * <code>setFace</code> sets which face will recieve the wireframe. * * @param face * which face will be rendered in wireframe. * @throws IllegalArgumentException * if face is null */ public void setFace(final Face face) { if (face == null) { throw new IllegalArgumentException("face can not be null."); } _face = face; setNeedsRefresh(true); }
/** * <code>setLineWidth</code> sets the width of lines the wireframe is drawn in. Attempting to set a line width * smaller than 0.0 throws an <code>IllegalArgumentException</code>. * * @param width * the line width, in pixels */ public void setLineWidth(final float width) { if (width < 0.0f) { throw new IllegalArgumentException("Line width must be positive"); } _lineWidth = width; setNeedsRefresh(true); }
/** * <code>setLineWidth</code> sets the width of lines the wireframe is drawn in. Attempting to set a line width * smaller than 0.0 throws an <code>IllegalArgumentException</code>. * * @param width * the line width, in pixels */ public void setLineWidth(final float width) { if (width < 0.0f) { throw new IllegalArgumentException("Line width must be positive"); } _lineWidth = width; setNeedsRefresh(true); }
/** * <code>setFace</code> sets which face will recieve the wireframe. * * @param face * which face will be rendered in wireframe. * @throws IllegalArgumentException * if face is null */ public void setFace(final Face face) { if (face == null) { throw new IllegalArgumentException("face can not be null."); } _face = face; setNeedsRefresh(true); }