private void trace(){
  glUseProgram(photonTraceProgram);
  long thisTime=System.nanoTime();
  float elapsedSeconds=(thisTime - firstTime) / 1E9f;
  glUniform1f(timeUniform,elapsedSeconds);
  glBindImageTexture(photonMapsBinding,photonMapTexture,0,true,0,GL_READ_WRITE,GL_RG16F);
  glBindBufferBase(GL_SHADER_STORAGE_BUFFER,boxesSsboBinding,ssbo);
  int invocationsPerDimension=photonsPerFrame;
  int worksizeX=mathRoundPoT(invocationsPerDimension);
  int worksizeY=mathRoundPoT(invocationsPerDimension);
  glDispatchCompute(worksizeX / workGroupSizeX,worksizeY / workGroupSizeY,1);
  glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
  glBindBufferBase(GL_SHADER_STORAGE_BUFFER,boxesSsboBinding,0);
  glBindImageTexture(photonMapsBinding,0,0,true,0,GL_READ_WRITE,GL_RG16F);
  glUseProgram(0);
}

private void trace ( ) { glUseProgram ( photonTraceProgram ) ; long thisTime = System . nanoTime ( ) ; float elapsedSeconds = ( thisTime - firstTime ) / 1E9f ; glUniform1f ( timeUniform , elapsedSeconds ) ; glBindImageTexture ( photonMapsBinding , photonMapTexture , 0 , true , 0 , GL_READ_WRITE , GL_RG16F ) ; glBindBufferBase ( GL_SHADER_STORAGE_BUFFER , boxesSsboBinding , ssbo ) ; int invocationsPerDimension = photonsPerFrame ; int worksizeX = mathRoundPoT ( invocationsPerDimension ) ; int worksizeY = mathRoundPoT ( invocationsPerDimension ) ; glDispatchCompute ( worksizeX / workGroupSizeX , worksizeY / workGroupSizeY , 1 ) ; glMemoryBarrier ( GL_SHADER_IMAGE_ACCESS_BARRIER_BIT ) ; glBindBufferBase ( GL_SHADER_STORAGE_BUFFER , boxesSsboBinding , 0 ) ; glBindImageTexture ( photonMapsBinding , 0 , 0 , true , 0 , GL_READ_WRITE , GL_RG16F ) ; glUseProgram ( 0 ) ; }
trace some rays from the light .
