Package com.ardor3d.renderer

Examples of com.ardor3d.renderer.TextureRenderer


        render(effectManager.getCurrentRenderer(), camera, null, spatial, enforcedStates);
    }

    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);
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.TextureRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.