Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.FloatBufferData


                        // enable bit in tracking int
                        enabledTextures |= (2 << i);
                    }

                    final FloatBufferData textureBufferData = textureCoords.get(i);
                    final FloatBuffer textureBuffer = textureBufferData.getBuffer();

                    GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                    textureBuffer.rewind();
                    GL11.glTexCoordPointer(textureBufferData.getValuesPerTuple(), 0, textureBuffer);
                }
            }
        }

        rendRecord.setEnabledTextures(enabledTextures);
View Full Code Here


                    }
                } else {
                    checkAndSetTextureArrayUnit(i, rendRecord, caps);

                    // grab a vboID and make sure it exists and is up to date.
                    final FloatBufferData data = textureCoords.get(i);
                    final int vboID = setupVBO(data, context);

                    // Found good vbo
                    if (vboID != 0) {
                        if (!valid || !wasOn) {
                            // enable bit in tracking int
                            enabledTextures |= (2 << i);

                            // enable state
                            GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                        }

                        // set our active vbo
                        LwjglRendererUtil.setBoundVBO(rendRecord, vboID);

                        // send data
                        GL11.glTexCoordPointer(data.getValuesPerTuple(), GL11.GL_FLOAT, 0, 0);
                    }
                    // Not a good vbo, disable it.
                    else {
                        if (!valid || wasOn) {
                            // disable bit in tracking int
View Full Code Here

                    } else {
                        checkAndSetTextureArrayUnit(i, rendRecord, caps);

                        // grab a vboID and make sure it exists and is up to date.
                        final FloatBufferData textureBufferData = textureCoords.get(i);
                        updateVBO(textureBufferData, rendRecord, vboID, offsetBytes);

                        if (!valid || !wasOn) {
                            // enable bit in tracking int
                            enabledTextures |= (2 << i);

                            // enable state
                            GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                        }

                        // send data
                        GL11.glTexCoordPointer(textureBufferData.getValuesPerTuple(), GL11.GL_FLOAT, 0, offsetBytes);
                        offsetBytes += textureBufferData.getBufferLimit() * 4;
                    }
                }
            }

            rendRecord.setEnabledTextures(enabledTextures);
View Full Code Here

                for (int i = 0; i <= ts.getMaxTextureIndexUsed() && i < caps.getNumberOfFragmentTexCoordUnits(); i++) {
                    if (textureCoords == null || i >= textureCoords.size()) {
                        continue;
                    }

                    final FloatBufferData textureBufferData = textureCoords.get(i);
                    final FloatBuffer textureBuffer = textureBufferData != null ? textureBufferData.getBuffer() : null;
                    if (textureBuffer != null) {
                        textureBuffer.rewind();
                        ARBBufferObject.glBufferSubDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, offsetBytes,
                                textureBuffer);
                        offsetBytes += textureBufferData.getBufferLimit() * 4;
                    }
                }
            }
        }
        if (vertexCoords != null) {
View Full Code Here

        getMeshData().setIndexMode(IndexMode.TriangleStrip);

        // clipSideSize is the number of vertices per clipmapside, so number of all vertices is clipSideSize *
        // clipSideSize
        final FloatBuffer vertices = BufferUtils.createVector4Buffer(clipSideSize * clipSideSize);
        getMeshData().setVertexCoords(new FloatBufferData(vertices, 4));

        if (generateNormals) {
            final FloatBuffer normals = BufferUtils.createVector3Buffer(clipSideSize * clipSideSize);
            getMeshData().setNormalCoords(new FloatBufferData(normals, 3));
        }

        // final FloatBuffer textureCoords = BufferUtils.createVector2Buffer(N * N);
        // getMeshData().setTextureBuffer(textureCoords, 0);

View Full Code Here

                        // enable bit in tracking int
                        enabledTextures |= (2 << i);
                    }

                    final FloatBufferData textureBufferData = textureCoords.get(i);
                    final FloatBuffer textureBuffer = textureBufferData.getBuffer();

                    if (gl.isGL2GL3()) {
                        gl.getGL2GL3().glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
                    }
                    textureBuffer.rewind();
                    if (gl.isGL2ES1()) {
                        gl.getGL2ES1().glTexCoordPointer(textureBufferData.getValuesPerTuple(), GL.GL_FLOAT, 0,
                                textureBuffer);
                    }
                }
            }
        }
View Full Code Here

                    }
                } else {
                    checkAndSetTextureArrayUnit(i, gl, rendRecord, caps);

                    // grab a vboID and make sure it exists and is up to date.
                    final FloatBufferData data = textureCoords.get(i);
                    final int vboID = setupVBO(data, context);

                    // Found good vbo
                    if (vboID != 0) {
                        if (!valid || !wasOn) {
                            // enable bit in tracking int
                            enabledTextures |= (2 << i);

                            // enable state
                            if (gl.isGL2GL3()) {
                                gl.getGL2GL3().glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
                            }
                        }

                        // set our active vbo
                        JoglRendererUtil.setBoundVBO(rendRecord, vboID);

                        // send data
                        if (gl.isGL2ES1()) {
                            gl.getGL2ES1().glTexCoordPointer(data.getValuesPerTuple(), GL.GL_FLOAT, 0, 0);
                        }
                    }
                    // Not a good vbo, disable it.
                    else {
                        if (!valid || wasOn) {
View Full Code Here

                    } else {
                        checkAndSetTextureArrayUnit(i, gl, rendRecord, caps);

                        // grab a vboID and make sure it exists and is up to date.
                        final FloatBufferData textureBufferData = textureCoords.get(i);
                        updateVBO(textureBufferData, rendRecord, vboID, offsetBytes);

                        if (!valid || !wasOn) {
                            // enable bit in tracking int
                            enabledTextures |= (2 << i);

                            // enable state
                            if (gl.isGL2GL3()) {
                                gl.getGL2GL3().glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
                            }
                        }

                        // send data
                        if (gl.isGL2ES1()) {
                            gl.getGL2ES1().glTexCoordPointer(textureBufferData.getValuesPerTuple(), GL.GL_FLOAT, 0,
                                    offsetBytes);
                        }
                        offsetBytes += textureBufferData.getBufferLimit() * 4;
                    }
                }
            }

            rendRecord.setEnabledTextures(enabledTextures);
View Full Code Here

                for (int i = 0; i <= ts.getMaxTextureIndexUsed() && i < caps.getNumberOfFragmentTexCoordUnits(); i++) {
                    if (textureCoords == null || i >= textureCoords.size()) {
                        continue;
                    }

                    final FloatBufferData textureBufferData = textureCoords.get(i);
                    final FloatBuffer textureBuffer = textureBufferData != null ? textureBufferData.getBuffer() : null;
                    if (textureBuffer != null) {
                        textureBuffer.rewind();
                        gl.glBufferSubData(GL.GL_ARRAY_BUFFER, offset, textureBufferData.getBufferLimit() * 4,
                                textureBuffer);
                        offset += textureBufferData.getBufferLimit() * 4;
                    }
                }
            }
        }
        if (vertexCoords != null) {
View Full Code Here

            data = SkinUtils.reorderAndPad(SkinUtils.convertToFloat(_jointIndices), getWeightsPerVert(),
                    getGpuAttributeSize());
        } else {
            data = SkinUtils.pad(SkinUtils.convertToFloat(_jointIndices), getWeightsPerVert(), getGpuAttributeSize());
        }
        _jointIndicesBuf = new FloatBufferData(BufferUtils.createFloatBuffer(data), getGpuAttributeSize());
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.FloatBufferData

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.