/** * Must be constructed in the GL thread. * * @param factory */ public AbstractStatGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) { _gWidth = width; _gHeight = height; // prepare our TextureRenderer _textureRenderer = TextureRendererFactory.INSTANCE.createTextureRenderer(width, height, renderer, caps); if (_textureRenderer != null) { _textureRenderer.setBackgroundColor(new ColorRGBA(ColorRGBA.BLACK)); } }
private void init(final Renderer renderer) { _tRenderer = TextureRendererFactory.INSTANCE.createTextureRenderer(_twidth, _theight, _depth, _samples, renderer, ContextManager.getCurrentContext().getCapabilities()); _tRenderer.setBackgroundColor(new ColorRGBA(0, 0, 0, 0)); resetTexture(); }
if (_minimalBackground) { bgColor.setAlpha(0); _textureRenderer.setBackgroundColor(bgColor); } else { bgColor.setAlpha(1); _textureRenderer.setBackgroundColor(bgColor);
protected void render(final Renderer renderer, final Camera camera, final List<Spatial> spatials, final Spatial spatial, final EnumMap<StateType, RenderState> enforcedStates) { final TextureRenderer texRend = TextureRendererPool.fetch(_width, _height, renderer); if (!_texSetup) { texRend.setupTexture(_texture); _texSetup = true; } // set desired bg color texRend.setBackgroundColor(_backgroundColor); // setup camera if (camera != null) { texRend.getCamera().setFrame(camera); texRend.getCamera().setFrustum(camera); texRend.getCamera().setProjectionMode(camera.getProjectionMode()); } texRend.enforceStates(enforcedStates); // draw to texture if (spatial != null) { texRend.render(spatial, _texture, Renderer.BUFFER_COLOR_AND_DEPTH); } else { texRend.render(spatials, _texture, Renderer.BUFFER_COLOR_AND_DEPTH); } texRend.clearEnforcedStates(); TextureRendererPool.release(texRend); }
tRenderer.setBackgroundColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)); tRenderer.getCamera().setFrustum(cam.getFrustumNear(), cam.getFrustumFar(), cam.getFrustumLeft(), cam.getFrustumRight(), cam.getFrustumTop(), cam.getFrustumBottom());
.getHeight(), renderer, ContextManager.getCurrentContext().getCapabilities()); if (UIContainer._textureRenderer != null) { UIContainer._textureRenderer.setBackgroundColor(new ColorRGBA(0f, 1f, 0f, 0f)); UIContainer._textureRenderer.setMultipleTargets(true); } else {
tRenderer.setBackgroundColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)); tRenderer.getCamera().setFrustum(cam.getFrustumNear(), cam.getFrustumFar(), cam.getFrustumLeft(), cam.getFrustumRight(), cam.getFrustumTop(), cam.getFrustumBottom());