Package com.ardor3d.renderer.state

Examples of com.ardor3d.renderer.state.RenderState


        copy.getSceneHints().set(original.getSceneHints());
        copy.setTransform(original.getTransform());
        copy.setDefaultColor(original.getDefaultColor());

        for (final StateType type : StateType.values()) {
            final RenderState state = original.getLocalRenderState(type);
            if (state != null) {
                copy.setRenderState(state);
            }
        }
        return copy;
View Full Code Here


        copy.setName(original.getName() + "_copy");
        copy.getSceneHints().set(original.getSceneHints());
        copy.setTransform(original.getTransform());

        for (final StateType type : StateType.values()) {
            final RenderState state = original.getLocalRenderState(type);
            if (state != null) {
                copy.setRenderState(state);
            }
        }
        return copy;
View Full Code Here

        try {
            final List<RenderState> tmp = new ArrayList<RenderState>();
            _currentElem = findFirstChildElement(fromElement);
            while (_currentElem != null) {
                final Element el = _currentElem;
                RenderState rs = null;
                if (el.getNodeName().equals("com.ardor3d.scene.state.TextureState")) {
                    rs = readTextureStateFromCurrent();
                } else {
                    rs = (RenderState) (readSavableFromCurrentElem(null));
                }
View Full Code Here

    protected final EnumMap<RenderState.StateType, RenderState> defaultStateList = new EnumMap<RenderState.StateType, RenderState>(
            RenderState.StateType.class);

    public AbstractRenderer() {
        for (final RenderState.StateType type : RenderState.StateType.values()) {
            final RenderState state = RenderState.createState(type);
            state.setEnabled(false);
            defaultStateList.put(type, state);
        }
    }
View Full Code Here

    public void applyState(final StateType type, final RenderState state) {
        if (Constants.stats) {
            StatCollector.startStat(StatType.STAT_STATES_TIMER);
        }

        final RenderState tempState = getProperRenderState(type, state);
        final RenderContext context = ContextManager.getCurrentContext();
        if (!RenderState._quickCompare.contains(type) || tempState.needsRefresh()
                || tempState != context.getCurrentState(type)) {
            doApplyState(tempState);
            tempState.setNeedsRefresh(false);
        }

        if (Constants.stats) {
            StatCollector.endStat(StatType.STAT_STATES_TIMER);
        }
View Full Code Here

    public RenderState getProperRenderState(final StateType type, final RenderState current) {
        final RenderContext context = ContextManager.getCurrentContext();

        // first look up in enforced states
        final RenderState state = context.hasEnforcedStates() ? context.getEnforcedState(type) : null;

        // Not there? Use the state we received
        if (state == null) {
            if (current != null) {
                return current;
View Full Code Here

                    // get handle to Mesh
                    final Mesh mesh = (Mesh) spatial;

                    // check if we have a Cull state set or enforced. If one is explicitly set and is not Face.None,
                    // we'll not do two-pass transparency.
                    RenderState setState = context.hasEnforcedStates() ? context.getEnforcedState(StateType.Cull)
                            : null;
                    if (setState == null) {
                        setState = mesh.getWorldRenderState(RenderState.StateType.Cull);
                    }

                    // Do the described check.
                    if (setState == null || ((CullState) setState).getCullFace() == Face.None) {

                        // pull any currently enforced cull or zstate. We'll put them back afterwards
                        final RenderState oldCullState = context.getEnforcedState(StateType.Cull);
                        final RenderState oldZState = context.getEnforcedState(StateType.ZBuffer);

                        // enforce our cull and zstate. The zstate is setup to respect depth, but not write to it.
                        context.enforceState(_tranparentCull);
                        context.enforceState(_transparentZBuff);
View Full Code Here

        if (rs == null) {
            return null;
        }

        final RenderState.StateType type = rs.getType();
        final RenderState oldState = _renderStateList.get(type);
        _renderStateList.put(type, rs);

        markDirty(DirtyType.RenderState);

        return oldState;
View Full Code Here

        spat.getSceneHints().set(_sceneHints);
        spat.setTransform(_localTransform);

        // copy local render states
        for (final StateType type : _renderStateList.keySet()) {
            final RenderState state = _renderStateList.get(type);
            if (state != null) {
                spat.setRenderState(state);
            }
        }
View Full Code Here

        if (mesh.isDirty(DirtyType.RenderState)) {
            mesh.updateWorldRenderStates(false);
            mesh.clearDirty(DirtyType.RenderState);
        }

        final RenderState textureState = mesh.getWorldRenderState(StateType.Texture);
        if (textureState == null) {
            throw new Ardor3dException("No texture state found for mesh: " + mesh);
        }

        texture = ((TextureState) textureState).getTexture(textureIndex);
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.state.RenderState

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.