private void initComputeProgram(){
  glUseProgram(computeProgram);
  IntBuffer workGroupSize=BufferUtils.createIntBuffer(3);
  glGetProgramiv(computeProgram,GL_COMPUTE_WORK_GROUP_SIZE,workGroupSize);
  workGroupSizeX=workGroupSize.get(0);
  workGroupSizeY=workGroupSize.get(1);
  eyeUniform=glGetUniformLocation(computeProgram,"eye");
  ray00Uniform=glGetUniformLocation(computeProgram,"ray00");
  ray10Uniform=glGetUniformLocation(computeProgram,"ray10");
  ray01Uniform=glGetUniformLocation(computeProgram,"ray01");
  ray11Uniform=glGetUniformLocation(computeProgram,"ray11");
  sizeUniform=glGetUniformLocation(computeProgram,"size");
  timeUniform=glGetUniformLocation(computeProgram,"time");
  IntBuffer props=BufferUtils.createIntBuffer(1);
  IntBuffer params=BufferUtils.createIntBuffer(1);
  props.put(0,GL_BUFFER_BINDING);
  int boxesResourceIndex=glGetProgramResourceIndex(computeProgram,GL_SHADER_STORAGE_BLOCK,"Boxes");
  int outputImageResourceIndex=glGetProgramResourceIndex(computeProgram,GL_SHADER_STORAGE_BLOCK,"OutputImage");
  glGetProgramResourceiv(computeProgram,GL_SHADER_STORAGE_BLOCK,boxesResourceIndex,props,null,params);
  boxesSsboBinding=params.get(0);
  glGetProgramResourceiv(computeProgram,GL_SHADER_STORAGE_BLOCK,outputImageResourceIndex,props,null,params);
  outputImageBinding=params.get(0);
  glUseProgram(0);
}

private void initComputeProgram ( ) { glUseProgram ( computeProgram ) ; IntBuffer workGroupSize = BufferUtils . createIntBuffer ( 3 ) ; glGetProgramiv ( computeProgram , GL_COMPUTE_WORK_GROUP_SIZE , workGroupSize ) ; workGroupSizeX = workGroupSize . get ( 0 ) ; workGroupSizeY = workGroupSize . get ( 1 ) ; eyeUniform = glGetUniformLocation ( computeProgram , "eye" ) ; ray00Uniform = glGetUniformLocation ( computeProgram , "ray00" ) ; ray10Uniform = glGetUniformLocation ( computeProgram , "ray10" ) ; ray01Uniform = glGetUniformLocation ( computeProgram , "ray01" ) ; ray11Uniform = glGetUniformLocation ( computeProgram , "ray11" ) ; sizeUniform = glGetUniformLocation ( computeProgram , "size" ) ; timeUniform = glGetUniformLocation ( computeProgram , "time" ) ; IntBuffer props = BufferUtils . createIntBuffer ( 1 ) ; IntBuffer params = BufferUtils . createIntBuffer ( 1 ) ; props . put ( 0 , GL_BUFFER_BINDING ) ; int boxesResourceIndex = glGetProgramResourceIndex ( computeProgram , GL_SHADER_STORAGE_BLOCK , "Boxes" ) ; int outputImageResourceIndex = glGetProgramResourceIndex ( computeProgram , GL_SHADER_STORAGE_BLOCK , "OutputImage" ) ; glGetProgramResourceiv ( computeProgram , GL_SHADER_STORAGE_BLOCK , boxesResourceIndex , props , null , params ) ; boxesSsboBinding = params . get ( 0 ) ; glGetProgramResourceiv ( computeProgram , GL_SHADER_STORAGE_BLOCK , outputImageResourceIndex , props , null , params ) ; outputImageBinding = params . get ( 0 ) ; glUseProgram ( 0 ) ; }
initialize the compute shader .
