Wow, if enabling CULL_FACE actually solves your problem instead of making it worse than something is really messed up there.
It would be a big help if you could post the latest version of your shaders so we can see what’s going on with them.
Is there any reason by the way why you’re not using VAOs? They would make your life so much easier, especially if you would like to use multiple VBOs at the same time.
Also you should comment out everything from your rendering method that isn’t related to the VBO cube to prevent accidents like rendering something in front of the cube.
Here’s a code sample from LWJGL on how to do rendering with VBOs and VAOs correctly, it should be easy to port to JOGL:
FloatBuffer yourVerticesInABuffer = BufferUtils.createFloatBuffer(50);
IntBuffer yourIndicesInABuffer = BufferUtils.createIntBuffer(50);
// Fill up the buffers with your vertices and indices...
// Flip the buffers when you're done
yourVerticesInABuffer.flip();
yourIndicesInABuffer.flip();
int vao = GL30.glGenVertexArrays();
int vbo = GL15.glGenBuffers();
int ibo = GL15.glGenBuffers();
GL30.glBindVertexArray(vao);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, yourVerticesInABuffer, GL15.GL_STATIC_DRAW);
GL20.glEnableVertexAttribArray(0);
GL20.glVertexAttribPointer(0, 3, GL11.GL_FLOAT, false, 0, 0L);
GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, ibo);
GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, yourIndicesInABuffer, GL15.GL_STATIC_DRAW);
GL30.glBindVertexArray(0);
^That was the code for setting up the VAO and VBOs. You should only do this once.
And here the code the you should run every frame in your render method:
GL30.glBindVertexArray(vao);
GL11.glDrawElements(GL11.GL_TRIANGLES, indexCount, GL11.GL_UNSIGNED_INT, 0L);
GL30.glBindVertexArray(0);
Your shader should look something like this (of course if you need something extra in there add it, this just the basics for rendering):
#version 330 core
uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
layout(location=0) in vec3 in_Position;
void main(){
gl_Position = projectionMatrix*modelViewMatrix*vec4(in_Position, 1.0);
}
Note: In the above example I’m using custom made matrices that are being sent to the shader as uniforms. You can also use the built-in matrices using older versions of GLSL or using it in compatibility mode instead of core, however the built-in matrices has been marked as deprecated in OGL3.0+.
Finally the fragment shader:
#version 330 core
layout(location=0) out vec4 out_Color;
void main(){
out_Color = vec4(1.0, 0.0, 0.0, 1.0);
}
Because I set the [icode]out_Color[/icode] to [icode]vec4(1.0, 0.0, 0.0, 1.0)[/icode] everything will be red but you can change that by sending your own color data to the fragment shader and using that.
Hopefully that cleared up a few things for you, or provided some sort of a help.