Package com.ardor3d.util.shader

Examples of com.ardor3d.util.shader.ShaderVariable


                    // set our current shader
                    LwjglShaderUtil.useShaderProgram(state._programID, record);

                    for (int i = state.getShaderAttributes().size(); --i >= 0;) {
                        final ShaderVariable shaderVariable = state.getShaderAttributes().get(i);
                        if (shaderVariable.needsRefresh) {
                            LwjglShaderUtil.updateAttributeLocation(shaderVariable, state._programID);
                            shaderVariable.needsRefresh = false;
                        }
                        LwjglShaderUtil.updateShaderAttribute(renderer, shaderVariable, state.isUseAttributeVBO());
                    }

                    for (int i = state.getShaderUniforms().size(); --i >= 0;) {
                        final ShaderVariable shaderVariable = state.getShaderUniforms().get(i);
                        if (shaderVariable.needsRefresh) {
                            LwjglShaderUtil.updateUniformLocation(shaderVariable, state._programID);
                            LwjglShaderUtil.updateShaderUniform(shaderVariable);
                            shaderVariable.needsRefresh = false;
                        }
View Full Code Here


    private static void clearEnabledAttributes(final ShaderObjectsStateRecord record) {
        // go through and disable any enabled attributes
        if (!record.enabledAttributes.isEmpty()) {
            for (int i = 0, maxI = record.enabledAttributes.size(); i < maxI; i++) {
                final ShaderVariable var = record.enabledAttributes.get(i);
                if (var.getSize() == 1) {
                    ARBVertexProgram.glDisableVertexAttribArrayARB(var.variableID);
                } else {
                    for (int j = 0, maxJ = var.getSize(); j < maxJ; j++) {
                        ARBVertexProgram.glDisableVertexAttribArrayARB(var.variableID + j);
                    }
                }
            }
            record.enabledAttributes.clear();
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    private <T extends ShaderVariable> T getShaderVariable(final String name, final Class<T> classz,
            final List<ShaderVariable> shaderVariableList) {
        for (int i = shaderVariableList.size(); --i >= 0;) {
            final ShaderVariable temp = shaderVariableList.get(i);
            if (name.equals(temp.name)) {
                temp.needsRefresh = true;
                return (T) temp;
            }
        }
View Full Code Here

                    // set our current shader
                    JoglShaderUtil.useShaderProgram(state._programID, record);

                    final List<ShaderVariable> attribs = state.getShaderAttributes();
                    for (int i = attribs.size(); --i >= 0;) {
                        final ShaderVariable shaderVariable = attribs.get(i);
                        if (shaderVariable.needsRefresh) {
                            JoglShaderUtil.updateAttributeLocation(shaderVariable, state._programID);
                            shaderVariable.needsRefresh = false;
                        }
                        JoglShaderUtil.updateShaderAttribute(renderer, shaderVariable, state.isUseAttributeVBO());
                    }

                    final List<ShaderVariable> uniforms = state.getShaderUniforms();
                    for (int i = uniforms.size(); --i >= 0;) {
                        final ShaderVariable shaderVariable = uniforms.get(i);
                        if (shaderVariable.needsRefresh) {
                            JoglShaderUtil.updateUniformLocation(shaderVariable, state._programID);
                            JoglShaderUtil.updateShaderUniform(shaderVariable);
                            shaderVariable.needsRefresh = false;
                        }
View Full Code Here

    private static void clearEnabledAttributes(final ShaderObjectsStateRecord record, final GL gl) {
        // go through and disable any enabled attributes
        if (!record.enabledAttributes.isEmpty()) {
            for (int i = 0, maxI = record.enabledAttributes.size(); i < maxI; i++) {
                final ShaderVariable var = record.enabledAttributes.get(i);
                if (var.getSize() == 1) {
                    if (gl.isGL2()) {
                        gl.getGL2().glDisableVertexAttribArrayARB(var.variableID);
                    } else {
                        if (gl.isGL2ES2()) {
                            gl.getGL2ES2().glDisableVertexAttribArray(var.variableID);
                        }
                    }
                } else {
                    for (int j = 0, maxJ = var.getSize(); j < maxJ; j++) {
                        if (gl.isGL2()) {
                            gl.getGL2().glDisableVertexAttribArrayARB(var.variableID + j);
                        } else {
                            if (gl.isGL2ES2()) {
                                gl.getGL2ES2().glDisableVertexAttribArray(var.variableID + j);
View Full Code Here

TOP

Related Classes of com.ardor3d.util.shader.ShaderVariable

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.