private void initComputeProgram(){
  IntBuffer workGroupSize=BufferUtils.createIntBuffer(3);
  glGetProgramiv(computeProgram,GL_COMPUTE_WORK_GROUP_SIZE,workGroupSize);
  workGroupSizeX=workGroupSize.get(0);
  workGroupSizeY=workGroupSize.get(1);
  int boxesResourceIndex=glGetProgramResourceIndex(computeProgram,GL_SHADER_STORAGE_BLOCK,"Boxes");
  IntBuffer props=BufferUtils.createIntBuffer(1);
  IntBuffer params=BufferUtils.createIntBuffer(1);
  props.put(0,GL_BUFFER_BINDING);
  glGetProgramResourceiv(computeProgram,GL_SHADER_STORAGE_BLOCK,boxesResourceIndex,props,null,params);
  boxesSsboBinding=params.get(0);
  int uniformsResourceIndex=glGetProgramResourceIndex(computeProgram,GL_UNIFORM_BLOCK,"Uniforms");
  glGetProgramResourceiv(computeProgram,GL_UNIFORM_BLOCK,uniformsResourceIndex,props,null,params);
  computeUboBinding=params.get(0);
  int loc=glGetUniformLocation(computeProgram,"framebufferImage");
  glGetUniformiv(computeProgram,loc,params);
  framebufferImageBinding=params.get(0);
  loc=glGetUniformLocation(computeProgram,"worldPositionImage");
  glGetUniformiv(computeProgram,loc,params);
  worldPositionImageBinding=params.get(0);
  loc=glGetUniformLocation(computeProgram,"worldNormalImage");
  glGetUniformiv(computeProgram,loc,params);
  worldNormalImageBinding=params.get(0);
}

private void initComputeProgram ( ) { IntBuffer workGroupSize = BufferUtils . createIntBuffer ( 3 ) ; glGetProgramiv ( computeProgram , GL_COMPUTE_WORK_GROUP_SIZE , workGroupSize ) ; workGroupSizeX = workGroupSize . get ( 0 ) ; workGroupSizeY = workGroupSize . get ( 1 ) ; int boxesResourceIndex = glGetProgramResourceIndex ( computeProgram , GL_SHADER_STORAGE_BLOCK , "Boxes" ) ; IntBuffer props = BufferUtils . createIntBuffer ( 1 ) ; IntBuffer params = BufferUtils . createIntBuffer ( 1 ) ; props . put ( 0 , GL_BUFFER_BINDING ) ; glGetProgramResourceiv ( computeProgram , GL_SHADER_STORAGE_BLOCK , boxesResourceIndex , props , null , params ) ; boxesSsboBinding = params . get ( 0 ) ; int uniformsResourceIndex = glGetProgramResourceIndex ( computeProgram , GL_UNIFORM_BLOCK , "Uniforms" ) ; glGetProgramResourceiv ( computeProgram , GL_UNIFORM_BLOCK , uniformsResourceIndex , props , null , params ) ; computeUboBinding = params . get ( 0 ) ; int loc = glGetUniformLocation ( computeProgram , "framebufferImage" ) ; glGetUniformiv ( computeProgram , loc , params ) ; framebufferImageBinding = params . get ( 0 ) ; loc = glGetUniformLocation ( computeProgram , "worldPositionImage" ) ; glGetUniformiv ( computeProgram , loc , params ) ; worldPositionImageBinding = params . get ( 0 ) ; loc = glGetUniformLocation ( computeProgram , "worldNormalImage" ) ; glGetUniformiv ( computeProgram , loc , params ) ; worldNormalImageBinding = params . get ( 0 ) ; }
initialize the compute shader .
