Package com.jme.scene.state

Examples of com.jme.scene.state.BlendState


                        if (node instanceof AttachPointNode) {
                            return false;
                        }

                        // load the blend state (if any)
                        BlendState as = (BlendState) node.getRenderState(RenderState.StateType.Blend);
                        if (as != null) {
                            // unapply the old state (getting us back to base state)
                            oldTrans.unapply(node, as);

                            // apply the new state
View Full Code Here


            ts.setTexture(tex);
            ts.setEnabled(true);
            ret.setRenderState(ts);

            BlendState as = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
            as.setBlendEnabled(false);
            as.setReference(0.5f);
            as.setTestFunction(BlendState.TestFunction.GreaterThan);
            as.setTestEnabled(true);
            ret.setRenderState(as);

            ret.setLightCombineMode(LightCombineMode.Off);
            ret.updateRenderState();
            this.quad = ret;
View Full Code Here

        //ms.setSpecular(new ColorRGBA(1f, 1, 1f, 1f));
       
        ms.setEnabled(true);
        rootNode.setRenderState(ms);
       
        BlendState bs = (BlendState)rm.createRendererState(StateType.Blend);
        bs.setEnabled(true);
        bs.setBlendEnabled(true);
        bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        bs.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        bs.setTestEnabled(true);
        bs.setTestFunction(BlendState.TestFunction.GreaterThan);
        rootNode.setRenderState(bs);

        CellTransform transform = cell.getWorldTransform();
        // Draw an arrow that mimics the light position --direction still under
        //construction.
View Full Code Here

        matState.setAmbient(new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f));
        matState.setShininess(128.0f);
        matState.setEmissive(new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f));
        matState.setEnabled(true);

        BlendState alphaState = (BlendState)rm.createRendererState(StateType.Blend);
        alphaState.setBlendEnabled(true);
        alphaState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        alphaState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        alphaState.setTestEnabled(true);
        alphaState.setTestFunction(BlendState.TestFunction.GreaterThan);
        alphaState.setEnabled(true);
        sphere.setRenderState(alphaState);

        // Remove the back faces of the object so transparency works properly
        CullState cullState = (CullState)rm.createRendererState(StateType.Cull);
        cullState.setCullFace(CullState.Face.Back);
View Full Code Here

        final WorldManager wm = ClientContextJME.getWorldManager();
        wm.addRenderUpdater(new RenderUpdater() {
            public void update(Object arg0) {

                BlendState as = (BlendState)
                    wm.getRenderManager().createRendererState(RenderState.StateType.Blend);

                // activate blending
                as.setBlendEnabled(true);
                // set the source function
                as.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
                // set the destination function
                as.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
                // disable test
                as.setTestEnabled(false);
                // activate the blend state
                as.setEnabled(true);

                // assign the blender state to the node
                quad.setRenderState(as);
                quad.updateRenderState();
View Full Code Here

        ColorRGBA orbColour = new ColorRGBA(0f, 0f, 1f, 0.2f);
        MaterialState matState = (MaterialState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Material);
        matState.setDiffuse(orbColour);
        outerOrb.setRenderState(matState);

        BlendState bs = (BlendState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Blend);
        bs.setEnabled(true);
        bs.setBlendEnabled(true);
        bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        bs.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        outerOrb.setRenderState(bs);

        CullState cs = (CullState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Cull);
        cs.setEnabled(true);
        cs.setCullFace(CullState.Face.Back);
View Full Code Here

        node.setRenderState(cs);
        if (useTransparency) {
            ZBufferState zs = renderer.createZBufferState();
            zs.setEnabled(false);
            node.setRenderState(zs);
            BlendState bs = renderer.createBlendState();
            bs.setBlendEnabled(true);
            node.setRenderState(bs);
            node.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
        }
        node.updateRenderState();
        Random r = new Random();
View Full Code Here

        }
        return ts;
    }

    public static BlendState createUsualBS() {
        BlendState bs = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
        bs.setBlendEnabled(true);
        bs.setTestEnabled(false);
        bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        bs.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        return bs;
    }
View Full Code Here

        cs.setCullFace(com.jme.scene.state.CullState.Face.Back);
        box.setRenderState(cs);
        box.updateRenderState();

        // pruhlednosti. Naprosto magicka vec s milionem moznych kombinaci, pricemz pouzitelnych je asi tak deset. :-(
        BlendState bs = display.getRenderer().createBlendState();
        bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        bs.setDestinationFunction(BlendState.DestinationFunction.DestinationAlpha);
        bs.setBlendEquation(BlendState.BlendEquation.Add);
        bs.setBlendEnabled(true);
        bs.setEnabled(true);
        box.setRenderState(bs);
        box.updateRenderState();

        // engine potrebuje vedet ze jde o pruhledne teleso a zohledni to u Z-bufferu a mozna jeste jinde
        box.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
View Full Code Here

        cs.setCullFace(com.jme.scene.state.CullState.Face.Back);
        box.setRenderState(cs);
        box.updateRenderState();

        // pruhlednosti. Naprosto magicka vec s milionem moznych kombinaci, pricemz pouzitelnych je asi tak deset. :-(
        BlendState bs = display.getRenderer().createBlendState();
        bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        bs.setDestinationFunction(BlendState.DestinationFunction.DestinationAlpha);
        bs.setBlendEquation(BlendState.BlendEquation.Add);
        bs.setBlendEnabled(true);
        bs.setEnabled(true);
        box.setRenderState(bs);
        box.updateRenderState();

        // engine potrebuje vedet ze jde o pruhledne teleso a zohledni to u Z-bufferu a mozna jeste jinde
        box.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
View Full Code Here

TOP

Related Classes of com.jme.scene.state.BlendState

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.