public static TextureRenderer fetch(final int width, final int height, final Renderer renderer) { for (final Iterator<TextureRenderer> it = INSTANCE.renderers.iterator(); it.hasNext();) { final TextureRenderer texRend = it.next(); if (texRend.getWidth() == width && texRend.getHeight() == height) { it.remove(); return texRend; } } // none found, make one return TextureRendererFactory.INSTANCE.createTextureRenderer(width, height, renderer, ContextManager .getCurrentContext().getCapabilities()); }
private void createVLines() { // some basic stats: final int texWidth = _textureRenderer.getWidth(); final int texHeight = _textureRenderer.getHeight(); final FloatBuffer verts = BufferUtils.createVector3Buffer(((int) (texWidth / _vSpan) + 1) * 2); for (float x = _vSpan; x <= texWidth + _vSpan; x += _vSpan) { verts.put(x).put(0).put(0); verts.put(x).put(texHeight).put(0); } _verticals = new Line("vert", verts, null, null, null); _verticals.getMeshData().setIndexMode(IndexMode.Lines); _verticals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); _verticals.setDefaultColor(getColorConfig(LineGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA( ColorRGBA.RED))); _verticals.setLineWidth(getIntConfig(LineGrapher.Vertical, ConfigKeys.Width.name(), 1)); _verticals.setStipplePattern(getShortConfig(LineGrapher.Vertical, ConfigKeys.Stipple.name(), (short) 0xFF00)); _verticals.setAntialiased(getBooleanConfig(LineGrapher.Vertical, ConfigKeys.Antialias.name(), true)); }
private void createHLines() { // some basic stats: final int texWidth = _textureRenderer.getWidth(); final int texHeight = _textureRenderer.getHeight(); final FloatBuffer verts = BufferUtils.createVector3Buffer((100 / majorHBar) * 2); final float div = texHeight * majorHBar / 100f; for (int y = 0, i = 0; i < verts.capacity(); i += 6, y += div) { verts.put(0).put(y).put(0); verts.put(texWidth).put(y).put(0); } _horizontals = new Line("horiz", verts, null, null, null); _horizontals.getMeshData().setIndexMode(IndexMode.Lines); _horizontals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); _horizontals.setDefaultColor(getColorConfig(LineGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA( ColorRGBA.BLUE))); _horizontals.setLineWidth(getIntConfig(LineGrapher.Horizontal, ConfigKeys.Width.name(), 1)); _horizontals .setStipplePattern(getShortConfig(LineGrapher.Horizontal, ConfigKeys.Stipple.name(), (short) 0xFF00)); _horizontals.setAntialiased(getBooleanConfig(LineGrapher.Horizontal, ConfigKeys.Antialias.name(), true)); }
private void createVLines() { // some basic stats: final int texWidth = _textureRenderer.getWidth(); final int texHeight = _textureRenderer.getHeight(); final FloatBuffer verts = BufferUtils.createVector3Buffer(((int) (texWidth / _vSpan) + 1) * 2); for (float x = _vSpan; x <= texWidth + _vSpan; x += _vSpan) { verts.put(x).put(0).put(0); verts.put(x).put(texHeight).put(0); } _verticals = new Line("vert", verts, null, null, null); _verticals.getMeshData().setIndexMode(IndexMode.Lines); _verticals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); _verticals.setDefaultColor(getColorConfig(TimedAreaGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA( ColorRGBA.RED))); _verticals.setLineWidth(getIntConfig(TimedAreaGrapher.Vertical, ConfigKeys.Width.name(), 1)); _verticals.setStipplePattern(getShortConfig(TimedAreaGrapher.Vertical, ConfigKeys.Stipple.name(), (short) 0xFF00)); _verticals.setAntialiased(getBooleanConfig(TimedAreaGrapher.Vertical, ConfigKeys.Antialias.name(), true)); }
/** * Makes a new line grapher and sets up a quad to display it. * * @param width * the width in pixels of the graph * @param height * the height in pixels of the graph * @param quad * the quad on whose surface we'll display our graph. * @return the new LineGrapher */ public static LineGrapher makeLineGraph(final int width, final int height, final Quad quad, final Renderer renderer, final ContextCapabilities caps) { final LineGrapher grapher = new LineGrapher(width, height, renderer, caps); grapher.setThreshold(1); StatCollector.addStatListener(grapher); final Texture2D graphTex = setupGraphTexture(grapher); final float dW = (float) width / grapher._textureRenderer.getWidth(); final float dH = (float) height / grapher._textureRenderer.getHeight(); setupGraphQuad(quad, graphTex, dW, dH); return grapher; }
private void createHLines() { // some basic stats: final int texWidth = _textureRenderer.getWidth(); final int texHeight = _textureRenderer.getHeight(); final FloatBuffer verts = BufferUtils.createVector3Buffer((100 / majorHBar) * 2); final float div = texHeight * majorHBar / 100f; for (int y = 0, i = 0; i < verts.capacity(); i += 6, y += div) { verts.put(0).put(y).put(0); verts.put(texWidth).put(y).put(0); } _horizontals = new Line("horiz", verts, null, null, null); _horizontals.getMeshData().setIndexMode(IndexMode.Lines); _horizontals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); _horizontals.setDefaultColor(getColorConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.BLUE))); _horizontals.setLineWidth(getIntConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Width.name(), 1)); _horizontals.setStipplePattern(getShortConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Stipple.name(), (short) 0xFF00)); _horizontals.setAntialiased(getBooleanConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Antialias.name(), true)); }
/** * Makes a new area grapher and sets up a quad to display it. * * @param width * the width in pixels of the graph * @param height * the height in pixels of the graph * @param quad * the quad on whose surface we'll display our graph. * @return the new TimedAreaGrapher */ public static TimedAreaGrapher makeTimedGraph(final int width, final int height, final Quad quad, final Renderer renderer, final ContextCapabilities caps) { final TimedAreaGrapher grapher = new TimedAreaGrapher(width, height, renderer, caps); grapher.setThreshold(1); StatCollector.addStatListener(grapher); final Texture2D graphTex = setupGraphTexture(grapher); final float dW = (float) width / grapher._textureRenderer.getWidth(); final float dH = (float) height / grapher._textureRenderer.getHeight(); setupGraphQuad(quad, graphTex, dW, dH); return grapher; }
/** * Makes a new label grapher and sets up a quad to display it. * * @param width * the width in pixels of the graph * @param height * the height in pixels of the graph * @param quad * the quad on whose surface we'll display our graph. * @return the new TabledLabelGrapher */ public static TabledLabelGrapher makeTabledLabelGraph(final int width, final int height, final Quad quad, final Renderer renderer, final ContextCapabilities caps) { final TabledLabelGrapher grapher = new TabledLabelGrapher(width, height, renderer, caps); grapher.setThreshold(1); StatCollector.addStatListener(grapher); final Texture2D graphTex = setupGraphTexture(grapher); final float dW = (float) width / grapher._textureRenderer.getWidth(); final float dH = (float) height / grapher._textureRenderer.getHeight(); setupGraphQuad(quad, graphTex, dW, dH); return grapher; }
dW = 1; float dH = newHeight / (float) UIContainer._textureRenderer.getHeight(); if (dH > 1) { dH = 1;
final double texelSizeH = (2 * radius) / _shadowMapRenderer.getHeight();