Blank screen when uisng shaders

I am currently trying to get a shder to create a brick like texture on a teapot.
I can render a teapot fine using the GLUnit tools but as soon as I add the shaders the teapot just disapears.
The frag and vertex shaders were a copy paste from the orange book so they should be fine and I dont get any errors in the shader log, so at the moment I hit a wall and not sure what I have done wrong.

public class SimpleJOGL implements GLEventListener {

    private int shaderprogram = 0;
    private GLUT glut;
    private String vertsrc = "VertexShader.vert";
    private String fragsrc = "FragmentShader.frag";
    

    public static void main(String[] args) {
        Frame frame = new Frame("Simple JOGL Application");
        GLCanvas canvas = new GLCanvas();
        
        [....]
                
        // Center frame
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
        animator.start();
    }

    public void init(GLAutoDrawable drawable) {
        // Use debug pipeline
         drawable.setGL(new DebugGL(drawable.getGL()));
        GL gl = drawable.getGL();
        glut = new GLUT();
        System.err.println("INIT GL IS: " + gl.getClass().getName());

        // Enable VSync
        gl.setSwapInterval(1);

        // Setup the drawing area and shading mode
        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        //gl.glShadeModel(GL.GL_SMOOTH); // try setting this to GL_FLAT and see what happens.
        
        gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glDepthFunc(GL.GL_LESS);
        gl.glEnable(GL.GL_TEXTURE_GEN_S);
        gl.glEnable(GL.GL_TEXTURE_1D);
        gl.glEnable(GL.GL_CULL_FACE);
        gl.glEnable(GL.GL_LIGHTING);
        gl.glEnable(GL.GL_LIGHT0);
        gl.glEnable(GL.GL_AUTO_NORMAL);
        gl.glEnable(GL.GL_NORMALIZE);
        gl.glFrontFace(GL.GL_CW);
        gl.glCullFace(GL.GL_BACK);
        gl.glMaterialf(GL.GL_FRONT, GL.GL_SHININESS, 64.0f);
        
        setupShaders(gl);// comment this out and u can see the teapot
    }

    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
        [.. usual ..]
    }

    public void display(GLAutoDrawable drawable) {
        GL gl = drawable.getGL();

        // Clear the drawing area
        //gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
        // Reset the current matrix to the "identity"
        //gl.glLoadIdentity();

        // Move the "drawing cursor" around
        gl.glTranslatef(-1.5f, 0.0f, -6.0f);
   
        //gl.glPushMatrix();
        glut.glutSolidTeapot(1.0f);

        // Flush all drawing operations to the graphics card
        gl.glFlush();
    }

    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
    }

    private void setupShaders(GL gl) {
        int v = gl.glCreateShader(GL.GL_VERTEX_SHADER);
        int f = gl.glCreateShader(GL.GL_FRAGMENT_SHADER);

        if (shaderprogram == 0) {
            System.out.println("initializing shaders");
            try {
                String[] vertexsource = {stringifyfile(vertsrc)};
                String[] fragmentsource = {stringifyfile(fragsrc)};
                
                gl.glShaderSource(v, 1, vertexsource, (int[]) null, 0);
                gl.glCompileShader(v);
                checkLogInfo(gl, v);

                gl.glShaderSource(f, 1, fragmentsource, (int[]) null, 0);
                gl.glCompileShader(f);
                checkLogInfo(gl, f);

                shaderprogram = gl.glCreateProgram();
                gl.glAttachShader(shaderprogram, v);
                gl.glAttachShader(shaderprogram, f);
                
                gl.glLinkProgram(shaderprogram);
                gl.glValidateProgram(shaderprogram);
                checkLogInfo(gl, shaderprogram);
            } catch (FileNotFoundException e) {
                System.err.println("Shader source file not found." + e);
            } catch (IOException e) {
                System.err.println("Could not read shader file.");
            }
        }
        gl.glUseProgram(shaderprogram);
        checkLogInfo(gl, shaderprogram);
        checkLogInfo(gl, v);
        checkLogInfo(gl, f);
    }

    private String stringifyfile(String filename) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader(filename));
        String res = "";
        String line;
        while ((line = br.readLine()) != null) {
            res += line + "\n";
        }
        return res;
    }

    private void checkLogInfo(GL gl, int obj) {
        IntBuffer iVal = BufferUtil.newIntBuffer(1);
        gl.glGetObjectParameterivARB(obj, GL.GL_OBJECT_INFO_LOG_LENGTH_ARB, iVal);

        int length = iVal.get();

        if (length <= 1) {
            return;
        }

        ByteBuffer infoLog = BufferUtil.newByteBuffer(length);

        iVal.flip();
        gl.glGetInfoLogARB(obj, length, iVal, infoLog);

        byte[] infoBytes = new byte[length];
        infoLog.get(infoBytes);
        System.out.println("GLSL Validation >> " + new String(infoBytes));
    }
}

My I ask why you’re enabling GL_TEXTURE_GEN_S and G_TEXTURE_1D if you never bind any textures? If the shader source is expecting a sampler in order to get the brick information (it might be useful to post the shader source code as well), then it can’t read anything because you have no real texture bound to a unit. Also, I believe that having GL_TEXTURE_GEN_S enabled will do nothing because a custom vertex shader disables the FF automatic tc generation. Similarly automatic normal generation is not computed with the vertex shader (or at least that is what the GL 2.1 specification says as I read it).

[quote]My I ask why you’re enabling GL_TEXTURE_GEN_S and G_TEXTURE_1D if you never bind any textures?
[/quote]
It appears I accidentally left the code there after I was learning how to get a teapot on the screen:
How to draw a texture mapped teapot with automatically generated texture coordinates
But it appears that all I forgot to do was to actually set up the uniform values.

// Set up initial uniform values
        gl.glUniform3f(gl.glGetUniformLocation(shaderprogram, "BrickColor"), 1.0f, 0.3f, 0.2f);
        gl.glUniform3f(gl.glGetUniformLocation(shaderprogram, "MortarColor"), 0.85f, 0.86f, 0.84f);
        gl.glUniform2f(gl.glGetUniformLocation(shaderprogram, "BrickSize"), 0.30f, 0.15f);
        gl.glUniform2f(gl.glGetUniformLocation(shaderprogram, "BrickPct"), 0.90f, 0.85f);
        gl.glUniform3f(gl.glGetUniformLocation(shaderprogram, "LightPosition"), 5.0f, 0.0f, 0.0f);

Otherwise it seems to working fine now and I have since removed those redundant enables and a bunch of other code.

Thanks for your help; I really do appreciate it especially through these really noobish times.