Examples of BlendStateRecord


Examples of com.ardor3d.renderer.state.record.BlendStateRecord

public abstract class LwjglBlendStateUtil {

    public static void apply(final BlendState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final BlendStateRecord record = (BlendStateRecord) context.getStateRecord(StateType.Blend);
        final ContextCapabilities caps = context.getCapabilities();
        context.setCurrentState(StateType.Blend, state);

        if (state.isEnabled()) {
            applyBlendEquations(state.isBlendEnabled(), state, record, caps);
            applyBlendColor(state.isBlendEnabled(), state, record, caps);
            applyBlendFunctions(state.isBlendEnabled(), state, record, caps);

            applyTest(state.isTestEnabled(), state, record);

            if (caps.isMultisampleSupported()) {
                applyAlphaCoverage(state.isSampleAlphaToCoverageEnabled(), state.isSampleAlphaToOneEnabled(), record,
                        caps);
                applySampleCoverage(state.isSampleCoverageEnabled(), state, record, caps);
            }
        } else {
            // disable blend
            applyBlendEquations(false, state, record, caps);

            // disable alpha test
            applyTest(false, state, record);

            // disable sample coverage
            if (caps.isMultisampleSupported()) {
                applyAlphaCoverage(false, false, record, caps);
                applySampleCoverage(false, state, record, caps);
            }
        }

        if (!record.isValid()) {
            record.validate();
        }
    }
View Full Code Here

Examples of com.ardor3d.renderer.state.record.BlendStateRecord

        _constantColor = (ColorRGBA) capsule.readSavable("constantColor", null);
    }

    @Override
    public StateRecord createStateRecord(final ContextCapabilities caps) {
        return new BlendStateRecord();
    }
View Full Code Here

Examples of com.ardor3d.renderer.state.record.BlendStateRecord

public abstract class JoglBlendStateUtil {

    public static void apply(final JoglRenderer renderer, final BlendState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final BlendStateRecord record = (BlendStateRecord) context.getStateRecord(StateType.Blend);
        final ContextCapabilities caps = context.getCapabilities();
        context.setCurrentState(StateType.Blend, state);

        final GL gl = GLContext.getCurrentGL();

        if (state.isEnabled()) {
            applyBlendEquations(gl, state.isBlendEnabled(), state, record, caps);
            applyBlendColor(gl, state.isBlendEnabled(), state, record, caps);
            applyBlendFunctions(gl, state.isBlendEnabled(), state, record, caps);

            applyTest(gl, state.isTestEnabled(), state, record);

            if (caps.isMultisampleSupported()) {
                applyAlphaCoverage(gl, state.isSampleAlphaToCoverageEnabled(), state.isSampleAlphaToOneEnabled(),
                        record, caps);
                applySampleCoverage(gl, state.isSampleCoverageEnabled(), state, record, caps);
            }
        } else {
            // disable blend
            applyBlendEquations(gl, false, state, record, caps);

            // disable alpha test
            applyTest(gl, false, state, record);

            // disable sample coverage
            if (caps.isMultisampleSupported()) {
                applyAlphaCoverage(gl, false, false, record, caps);
                applySampleCoverage(gl, false, state, record, caps);
            }
        }

        if (!record.isValid()) {
            record.validate();
        }
    }
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.