Package com.ardor3d.extension.effect

Examples of com.ardor3d.extension.effect.ColorReplaceEffect


        // Add a sepia tone post effect
        final Texture sepiaTexture = TextureManager.load(
                new URLResourceSource(ResourceLocatorTool.getClassPathResource(ColorReplaceEffect.class,
                        "com/ardor3d/extension/effect/sepiatone.png")), Texture.MinificationFilter.Trilinear, true);
        final ColorReplaceEffect sepiaEffect = new ColorReplaceEffect(sepiaTexture);
        effectManager.addEffect(sepiaEffect);

        // Finally, add a step to draw the result to the framebuffer
        final FrameBufferOutputEffect out = new FrameBufferOutputEffect();
        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(SourceFunction.SourceAlpha);
        blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
        out.setBlend(blend);
        effectManager.addEffect(out);

        // setup effects
        effectManager.setupEffects();

        // add toggle for the effects
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.ONE), new TriggerAction() {
            @Override
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                bloomEffect.setEnabled(!bloomEffect.isEnabled());
                updateText();
            }
        }));
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.TWO), new TriggerAction() {
            @Override
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                sepiaEffect.setEnabled(!sepiaEffect.isEnabled());
                updateText();
            }
        }));

        // setup text labels
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.effect.ColorReplaceEffect

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.