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");
  debugUniform=glGetUniformLocation(computeProgram,"debug");
  sceneMinUniform=glGetUniformLocation(computeProgram,"sceneMin");
  sceneMaxUniform=glGetUniformLocation(computeProgram,"sceneMax");
  IntBuffer props=BufferUtils.createIntBuffer(1);
  IntBuffer params=BufferUtils.createIntBuffer(1);
  props.put(0,GL_BUFFER_BINDING);
  int nodesResourceIndex=glGetProgramResourceIndex(computeProgram,GL_SHADER_STORAGE_BLOCK,"Nodes");
  glGetProgramResourceiv(computeProgram,GL_SHADER_STORAGE_BLOCK,nodesResourceIndex,props,null,params);
  nodesSsboBinding=params.get(0);
  int trianglesResourceIndex=glGetProgramResourceIndex(computeProgram,GL_SHADER_STORAGE_BLOCK,"Triangles");
  glGetProgramResourceiv(computeProgram,GL_SHADER_STORAGE_BLOCK,trianglesResourceIndex,props,null,params);
  trianglesSsboBinding=params.get(0);
  int loc=glGetUniformLocation(computeProgram,"framebufferImage");
  glGetUniformiv(computeProgram,loc,params);
  framebufferImageBinding=params.get(0);
  glUseProgram(0);
}

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" ) ; debugUniform = glGetUniformLocation ( computeProgram , "debug" ) ; sceneMinUniform = glGetUniformLocation ( computeProgram , "sceneMin" ) ; sceneMaxUniform = glGetUniformLocation ( computeProgram , "sceneMax" ) ; IntBuffer props = BufferUtils . createIntBuffer ( 1 ) ; IntBuffer params = BufferUtils . createIntBuffer ( 1 ) ; props . put ( 0 , GL_BUFFER_BINDING ) ; int nodesResourceIndex = glGetProgramResourceIndex ( computeProgram , GL_SHADER_STORAGE_BLOCK , "Nodes" ) ; glGetProgramResourceiv ( computeProgram , GL_SHADER_STORAGE_BLOCK , nodesResourceIndex , props , null , params ) ; nodesSsboBinding = params . get ( 0 ) ; int trianglesResourceIndex = glGetProgramResourceIndex ( computeProgram , GL_SHADER_STORAGE_BLOCK , "Triangles" ) ; glGetProgramResourceiv ( computeProgram , GL_SHADER_STORAGE_BLOCK , trianglesResourceIndex , props , null , params ) ; trianglesSsboBinding = params . get ( 0 ) ; int loc = glGetUniformLocation ( computeProgram , "framebufferImage" ) ; glGetUniformiv ( computeProgram , loc , params ) ; framebufferImageBinding = params . get ( 0 ) ; glUseProgram ( 0 ) ; }
initialize the compute shader .
