private Material createLumShader(int srcW, int srcH, int bufW, int bufH, int mode,
int iters, Texture tex){
Material mat = new Material(manager, "Common/MatDefs/Hdr/LogLum.j3md");
Vector2f blockSize = new Vector2f(1f / bufW, 1f / bufH);
Vector2f pixelSize = new Vector2f(1f / srcW, 1f / srcH);
Vector2f blocks = new Vector2f();
float numPixels = Float.POSITIVE_INFINITY;
if (iters != -1){
do {
pixelSize.multLocal(2);
blocks.set(blockSize.x / pixelSize.x,
blockSize.y / pixelSize.y);
numPixels = blocks.x * blocks.y;
} while (numPixels > iters);
}else{
blocks.set(blockSize.x / pixelSize.x,
blockSize.y / pixelSize.y);
numPixels = blocks.x * blocks.y;
}
mat.setBoolean("Blocks", true);