Package com.ardor3d.renderer.state

Examples of com.ardor3d.renderer.state.LightState


        light.setDiffuse(ColorRGBA.WHITE);
        //light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setEnabled(true);

        /** Attach the light to a lightState and the lightState to rootNode. */
        _lightState = new LightState();
        _lightState.setEnabled(true);
        _lightState.attach(light);
        nodes.getRootNode().setRenderState(_lightState);

        final CullState cs = new CullState();
View Full Code Here


        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("OBJ/Branch_Summer.png", Texture.MinificationFilter.Trilinear,
                TextureStoreFormat.GuessCompressedFormat, true));
        setRenderState(ts);

        final LightState lightState = new LightState();
        lightState.setEnabled(false);
        setRenderState(lightState);

        final BlendState blendState = new BlendState();
        blendState.setBlendEnabled(true);
        blendState.setReference(0.5f);
View Full Code Here

        _backCull = new CullState();
        _backCull.setCullFace(Face.Back);

        _wireframeState.setAntialiased(antialiased);

        _noLights = new LightState();
        _noLights.setGlobalAmbient(DEFAULT_OUTLINE_COLOR);
        _noLights.setEnabled(true);

        _noTexture = new TextureState();
        _noTexture.setEnabled(true);
View Full Code Here

        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(100, 100, 100));
        light.setEnabled(true);

        // Attach the light to a lightState and the lightState to rootNode.
        final LightState lightState = new LightState();
        lightState.setEnabled(true);
        lightState.attach(light);
        _root.setRenderState(lightState);

    }
View Full Code Here

        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(100, 100, 100));
        light.setEnabled(true);

        /** Attach the light to a lightState and the lightState to rootNode. */
        _lightState = new LightState();
        _lightState.setEnabled(true);
        _lightState.attach(light);
        _root.setRenderState(_lightState);

        _wireframeState = new WireframeState();
View Full Code Here

        light.setDiffuse(new ColorRGBA(r, g, b, a));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(MOVE_SPEED, MOVE_SPEED, MOVE_SPEED));
        light.setEnabled(true);

        /** Attach the light to a lightState and the lightState to rootNode. */
        final LightState lightState = new LightState();
        lightState.setEnabled(true);
        lightState.attach(light);
        scene.getRoot().setRenderState(lightState);

        scene.getRoot().attachChild(box);

        registerInputTriggers();
View Full Code Here

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", MinificationFilter.Trilinear, true));
        opaques.setRenderState(ts);

        final LightState ls = new LightState();
        ls.setEnabled(true);
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        dLight.setDirection(new Vector3(1, 1, 1));
        ls.attach(dLight);
        final DirectionalLight dLight2 = new DirectionalLight();
        dLight2.setEnabled(true);
        dLight2.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        dLight2.setDirection(new Vector3(-1, -1, -1));
        ls.attach(dLight2);
        ls.setTwoSidedLighting(false);
        transps.setRenderState(ls);
        transps.getSceneHints().setLightCombineMode(LightCombineMode.Replace);

        final Box tb1 = new Box("TBox Blue", min, max);
        tb1.setModelBound(new BoundingBox());
        tb1.setTranslation(new Vector3(0, 15, 15));
        transps.attachChild(tb1);
        final MaterialState ms1 = new MaterialState();
        ms1.setEnabled(true);
        ms1.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(0, 0, 1, .75f));
        ms1.setShininess(MaterialFace.FrontAndBack, 128);
        tb1.setRenderState(ms1);

        final Torus tb2 = new Torus("TBox Green", 20, 20, 3, 6);
        tb2.setModelBound(new BoundingBox());
        tb2.setTranslation(new Vector3(0, 0, 30));
        transps.attachChild(tb2);
        final MaterialState ms2 = new MaterialState();
        ms2.setEnabled(true);
        ms2.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(0, 1, 0, .5f));
        ms2.setShininess(MaterialFace.FrontAndBack, 128);
        tb2.setRenderState(ms2);

        final Box tb3 = new Box("TBox Red", min, max);
        tb3.setModelBound(new BoundingBox());
        tb3.setTranslation(new Vector3(0, 0, 15));
        transps.attachChild(tb3);
        final MaterialState ms3 = new MaterialState();
        ms3.setEnabled(true);
        ms3.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(1, 0, 0, .5f));
        ms3.setShininess(MaterialFace.FrontAndBack, 128);
        tb3.setRenderState(ms3);

        final BlendState as = new BlendState();
        as.setEnabled(true);
        as.setBlendEnabled(true);
        as.setSourceFunction(SourceFunction.SourceAlpha);
        as.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
        transps.setRenderState(as);

        final Vector2 center = new Vector2(_canvas.getCanvasRenderer().getCamera().getWidth() >> 1, _canvas
                .getCanvasRenderer().getCamera().getWidth() >> 1);

        final Quad q1 = new Quad("Ortho Q1", 40, 40);
        q1.setTranslation(new Vector3(100 + center.getX(), 100 + center.getY(), 0));
        q1.getSceneHints().setOrthoOrder(1);
        q1.setDefaultColor(ColorRGBA.WHITE);
        q1.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        orthos.attachChild(q1);

        final Quad q2 = new Quad("Ortho Q2", 100, 100);
        q2.setTranslation(new Vector3(60 + center.getX(), 60 + center.getY(), 0));
        q2.getSceneHints().setOrthoOrder(5);
        q2.setDefaultColor(ColorRGBA.RED);
        q2.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        orthos.attachChild(q2);

        final Quad q3 = new Quad("Ortho Q3", 120, 60);
        q3.setTranslation(new Vector3(-20 + center.getX(), -150 + center.getY(), 0));
        q3.getSceneHints().setOrthoOrder(2);
        q3.setDefaultColor(ColorRGBA.BLUE);
        q3.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        orthos.attachChild(q3);

        final ZBufferState zstate = new ZBufferState();
        zstate.setWritable(false);
        zstate.setEnabled(false);
        orthos.setRenderState(zstate);

        orthos.setRenderState(new LightState());

        _root.getSceneHints().setCullHint(CullHint.Always);
        opaques.getSceneHints().setCullHint(CullHint.Dynamic);
        transps.getSceneHints().setCullHint(CullHint.Dynamic);
        orthos.getSceneHints().setCullHint(CullHint.Never);
View Full Code Here

        _colorDisabled = new ColorMaskState();
        _colorDisabled.setAll(false);
        _cullFrontFace = new CullState();
        _cullFrontFace.setEnabled(true);
        _cullFrontFace.setCullFace(CullState.Face.Front);
        _noLights = new LightState();
        _noLights.setEnabled(false);

        _shadowOffsetState = new OffsetState();
        _shadowOffsetState.setEnabled(true);
        _shadowOffsetState.setTypeEnabled(OffsetType.Fill, true);
View Full Code Here

TOP

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

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.