Examples of BlendState


Examples of com.ardor3d.renderer.state.BlendState

        final CullState cState = new CullState();
        cState.setEnabled(false);
        setRenderState(cState);

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        blend.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        blend.setTestEnabled(true);
        blend.setReference(0f);
        blend.setTestFunction(BlendState.TestFunction.GreaterThan);
        setRenderState(blend);

        getSceneHints().setLightCombineMode(LightCombineMode.Off);
        getSceneHints().setTextureCombineMode(TextureCombineMode.Replace);
        updateModelBound();
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

        RenderStateSetter(final Texture texture, final boolean useBlend) {
            textureState = new TextureState();
            textureState.setTexture(texture);

            blendState = new BlendState();
            blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
            blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
            blendState.setTestEnabled(true);
            blendState.setTestFunction(BlendState.TestFunction.GreaterThan);
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

        _noLights.setEnabled(true);

        _noTexture = new TextureState();
        _noTexture.setEnabled(true);

        _blendState = new BlendState();
        _blendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        _blendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        _blendState.setBlendEnabled(true);
        _blendState.setEnabled(true);
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

        ts.setTexture(_texture, 0);
        _imposterQuad.setRenderState(ts);

        // Add a blending mode... This is so the background of the texture is
        // transparent.
        final BlendState as1 = new BlendState();
        as1.setBlendEnabled(true);
        as1.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        as1.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        as1.setTestEnabled(true);
        as1.setTestFunction(BlendState.TestFunction.GreaterThan);
        as1.setEnabled(true);
        _imposterQuad.setRenderState(as1);
    }
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

        _standin.getSceneHints().setTextureCombineMode(TextureCombineMode.Replace);
        // immediate mode
        _standin.getSceneHints().setRenderBucketType(RenderBucketType.Skip);

        // Add an alpha blend state
        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(SourceFunction.SourceAlpha);
        blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
        // throw out fragments with alpha of 0.
        blend.setTestFunction(TestFunction.GreaterThan);
        blend.setReference(0.0f);
        blend.setTestEnabled(true);
        _standin.setRenderState(blend);

        // Update our standin's texture
        resetFakeTexture();
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

        final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(10, 7);
        indices.put(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1 });
        mesh.getMeshData().setIndices(indices);

        // set up alpha blending.
        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(SourceFunction.SourceAlpha);
        blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
        mesh.setRenderState(blend);

        // use flat shade so our borders will have a solid color.
        final ShadingState shading = new ShadingState();
        shading.setShadingMode(ShadingMode.Flat);
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

    /**
     * @return a blend state that does alpha blending and writes the max alpha value (source or destination) back to the
     *         color buffer.
     */
    private static BlendState createSrcRGBMaxAlphaBlend() {
        final BlendState state = new BlendState();
        state.setBlendEnabled(true);
        state.setSourceFunctionRGB(SourceFunction.SourceAlpha);
        state.setDestinationFunctionRGB(DestinationFunction.Zero);
        state.setBlendEquationRGB(BlendEquation.Add);
        state.setSourceFunctionAlpha(SourceFunction.SourceAlpha);
        state.setDestinationFunctionAlpha(DestinationFunction.DestinationAlpha);
        state.setBlendEquationAlpha(BlendEquation.Max);
        return state;
    }
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

    /**
     * @return a blend state that does alpha blending and writes the max alpha value (source or destination) back to the
     *         color buffer.
     */
    private static BlendState createBlendRGBMaxAlphaBlend() {
        final BlendState state = new BlendState();
        state.setBlendEnabled(true);
        state.setSourceFunctionRGB(SourceFunction.SourceAlpha);
        state.setDestinationFunctionRGB(DestinationFunction.OneMinusSourceAlpha);
        state.setBlendEquationRGB(BlendEquation.Add);
        state.setSourceFunctionAlpha(SourceFunction.SourceAlpha);
        state.setDestinationFunctionAlpha(DestinationFunction.DestinationAlpha);
        state.setBlendEquationAlpha(BlendEquation.Max);
        return state;
    }
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

    }

    private static UIQuad createStandinQuad() {
        final UIQuad quad = new UIQuad("standin", 1, 1);

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(SourceFunction.SourceAlpha);
        blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
        quad.setRenderState(blend);
        quad.updateWorldRenderStates(false);

        return quad;
    }
View Full Code Here

Examples of com.ardor3d.renderer.state.BlendState

        final Mesh mesh = new Mesh("selectionMesh");
        final MeshData mData = mesh.getMeshData();
        mData.setVertexBuffer(BufferUtils.createVector3Buffer(6));
        mData.setIndexMode(IndexMode.Triangles);

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(SourceFunction.SourceAlpha);
        blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
        mesh.setRenderState(blend);
        mesh.updateWorldRenderStates(false);
        mesh.setDefaultColor(ColorRGBA.LIGHT_GRAY);

        return mesh;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.