From: Gerardo H. <ma...@us...> - 2007-01-30 05:09:36
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20042/src/org/jrman/render Modified Files: RendererHidden.java Log Message: First test as a NetBeans project. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** RendererHidden.java 24 Dec 2006 05:25:57 -0000 1.75 --- RendererHidden.java 30 Jan 2007 05:09:32 -0000 1.76 *************** *** 1,15 **** /* * RendererHidden.java Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. ! * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. ! * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple --- 1,15 ---- /* * RendererHidden.java Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. ! * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. ! * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple *************** *** 55,111 **** public class RendererHidden extends Renderer { ! private final static int MAX_EYE_SPLITS = 20; ! private final static Vector3f ORTHO_I = new Vector3f(0f, 0f, 1f); ! private ClippingVolume clippingVolume; ! private Plane eyePlane; ! private Transform worldToCamera; ! private Transform cameraToRaster; ! private Bounds2f rasterWindow; ! private Point2f rasterWindowMin; ! private Bucket[] buckets; ! private int bucketColumns; ! private int bucketRows; ! private int bucketWidth; ! private int bucketHeight; ! private int primitivePatchCount; ! private int invisiblePatchCount; private int clippedPrimitivesCount; ! private long worldParseStart; ! private long worldParseEnd; ! private int hFilterExtra; ! private int vFilterExtra; ! private int hPixelLess; ! private int vPixelLess; ! private SamplesFilter samplesFilter; ! private int hExtra; ! private int wExtra; ! private Transform oldObjectToWorld; ! private Transform oldObjectToCamera; --- 55,111 ---- public class RendererHidden extends Renderer { ! private final static int MAX_EYE_SPLITS = 20; ! private final static Vector3f ORTHO_I = new Vector3f(0f, 0f, 1f); ! private ClippingVolume clippingVolume; ! private Plane eyePlane; ! private Transform worldToCamera; ! private Transform cameraToRaster; ! private Bounds2f rasterWindow; ! private Point2f rasterWindowMin; ! private Bucket[] buckets; ! private int bucketColumns; ! private int bucketRows; ! private int bucketWidth; ! private int bucketHeight; ! private int primitivePatchCount; ! private int invisiblePatchCount; private int clippedPrimitivesCount; ! private long worldParseStart; ! private long worldParseEnd; ! private int hFilterExtra; ! private int vFilterExtra; ! private int hPixelLess; ! private int vPixelLess; ! private SamplesFilter samplesFilter; ! private int hExtra; ! private int wExtra; ! private Transform oldObjectToWorld; ! private Transform oldObjectToCamera; *************** *** 115,121 **** private boolean rendering; ! private Point3fGrid pointsTmp; ! public void init(Frame frame, World world, Parser parser) { super.init(frame, world, parser); --- 115,121 ---- private boolean rendering; ! private Point3fGrid pointsTmp; ! public void init(Frame frame, World world, Parser parser) { super.init(frame, world, parser); *************** *** 134,147 **** worldParseStart = System.currentTimeMillis(); } ! public void addPrimitive(Primitive primitive) { internalAddPrimitive(primitive, column, row, rendering); } ! private void internalAddPrimitive( ! Primitive primitive, ! int curColumn, ! int curRow, ! boolean check) { Transform objectToCamera = primitive.getObjectToCamera(); if (objectToCamera == null) { --- 134,147 ---- worldParseStart = System.currentTimeMillis(); } ! public void addPrimitive(Primitive primitive) { internalAddPrimitive(primitive, column, row, rendering); } ! private void internalAddPrimitive( ! Primitive primitive, ! int curColumn, ! int curRow, ! boolean check) { Transform objectToCamera = primitive.getObjectToCamera(); if (objectToCamera == null) { *************** *** 159,170 **** System.err.println("Can't split primitive at eye plane: " + primitive); } ! private boolean addPrimitive( ! Primitive primitive, ! int recursionLevel, ! Transform objectToCamera, ! int curColumn, ! int curRow, ! boolean check) { BoundingVolume bv = primitive.getBoundingVolume(); float db = primitive.getAttributes().getDisplacementBound(); --- 159,170 ---- System.err.println("Can't split primitive at eye plane: " + primitive); } ! private boolean addPrimitive( ! Primitive primitive, ! int recursionLevel, ! Transform objectToCamera, ! int curColumn, ! int curRow, ! boolean check) { BoundingVolume bv = primitive.getBoundingVolume(); float db = primitive.getAttributes().getDisplacementBound(); *************** *** 202,213 **** return result; } ! private void placeInBucket( ! Primitive primitive, ! BoundingVolume bve, ! BoundingVolume bv, ! int column, ! int row, ! boolean check) { primitive.setDistance(bve.getMinZ()); bve = bve.transform(cameraToRaster); --- 202,213 ---- return result; } ! private void placeInBucket( ! Primitive primitive, ! BoundingVolume bve, ! BoundingVolume bv, ! int column, ! int row, ! boolean check) { primitive.setDistance(bve.getMinZ()); bve = bve.transform(cameraToRaster); *************** *** 225,234 **** doPlaceInBucket(primitive, column, row, check); } ! private void doPlaceInBucket( ! Primitive primitive, ! int curColumn, ! int curRow, ! boolean check) { Bounds2f bounds = primitive.getRasterBounds(); if (!bounds.intersects(rasterWindow)) --- 225,234 ---- doPlaceInBucket(primitive, column, row, check); } ! private void doPlaceInBucket( ! Primitive primitive, ! int curColumn, ! int curRow, ! boolean check) { Bounds2f bounds = primitive.getRasterBounds(); if (!bounds.intersects(rasterWindow)) *************** *** 246,250 **** float maxX = bounds.getMaxX() - rasterWindow.getMinX(); int maxColumn = ! Calc.clamp((int) Math.ceil(maxX / bucketWidth), 0, bucketColumns - 1); if (column <= curColumn && curColumn <= maxColumn) { getBucket(curColumn, curRow).addPrimitive(primitive); --- 246,250 ---- float maxX = bounds.getMaxX() - rasterWindow.getMinX(); int maxColumn = ! Calc.clamp((int) Math.ceil(maxX / bucketWidth), 0, bucketColumns - 1); if (column <= curColumn && curColumn <= maxColumn) { getBucket(curColumn, curRow).addPrimitive(primitive); *************** *** 261,265 **** getBucket(column, row).addPrimitive(primitive); } ! public void addToBuckets(Micropolygon mp) { if (mp.getMaxX() < rasterWindowMin.x || mp.getMaxY() < rasterWindowMin.y) --- 261,265 ---- getBucket(column, row).addPrimitive(primitive); } ! public void addToBuckets(Micropolygon mp) { if (mp.getMaxX() < rasterWindowMin.x || mp.getMaxY() < rasterWindowMin.y) *************** *** 278,286 **** getBucket(col, row).addMicropolygon(mp); } ! private Bucket getBucket(int column, int row) { return buckets[row * bucketColumns + column]; } ! public void render() { rendering = true; --- 278,286 ---- getBucket(col, row).addMicropolygon(mp); } ! private Bucket getBucket(int column, int row) { return buckets[row * bucketColumns + column]; } ! public void render() { rendering = true; *************** *** 289,293 **** Display.Type displayType = frame.getDisplay().getType(); ImageStore imageStore = ! new ImageStore( frame.getHorizontalResolution(), frame.getVerticalResolution(), --- 289,293 ---- Display.Type displayType = frame.getDisplay().getType(); ImageStore imageStore = ! new ImageStore( frame.getHorizontalResolution(), frame.getVerticalResolution(), *************** *** 296,300 **** if (displayMode == Display.Mode.Z) { zStore = ! new ZStore(frame.getHorizontalResolution(), frame.getVerticalResolution()); ShadowMap.flushShadowMap(frame.getDisplay().getName()); } --- 296,300 ---- if (displayMode == Display.Mode.Z) { zStore = ! new ZStore(frame.getHorizontalResolution(), frame.getVerticalResolution()); ShadowMap.flushShadowMap(frame.getDisplay().getName()); } *************** *** 304,313 **** fb.setVisible(true); } ! int gridSize = frame.getGridSize(); ShaderVariables shaderVariables = new ShaderVariables(worldToCamera.getInverse()); int gridCount = 0; Sampler sampler = ! new Sampler( bucketWidth, bucketHeight, --- 304,313 ---- fb.setVisible(true); } ! int gridSize = frame.getGridSize(); ShaderVariables shaderVariables = new ShaderVariables(worldToCamera.getInverse()); int gridCount = 0; Sampler sampler = ! new Sampler( bucketWidth, bucketHeight, *************** *** 316,325 **** Filter filter = frame.getFilter(); samplesFilter.init( ! (int) Math.ceil(filter.getHorizontalWidth() * sampler.getPixelWidth()), ! (int) Math.ceil(filter.getVerticalWidth() * sampler.getPixelHeight()), ! filter.getHorizontalWidth(), ! filter.getVerticalWidth()); float[] samples = ! new float[sampler.getWidth() * bucketColumns * (sampler.getHeight() + vFilterExtra + vPixelLess * sampler.getPixelHeight()) --- 316,325 ---- Filter filter = frame.getFilter(); samplesFilter.init( ! (int) Math.ceil(filter.getHorizontalWidth() * sampler.getPixelWidth()), ! (int) Math.ceil(filter.getVerticalWidth() * sampler.getPixelHeight()), ! filter.getHorizontalWidth(), ! filter.getVerticalWidth()); float[] samples = ! new float[sampler.getWidth() * bucketColumns * (sampler.getHeight() + vFilterExtra + vPixelLess * sampler.getPixelHeight()) *************** *** 363,367 **** if (surface == null) surface = ! SurfaceShader.createShader( "fakedlight", new ParameterList(), --- 363,367 ---- if (surface == null) surface = ! SurfaceShader.createShader( "fakedlight", new ParameterList(), *************** *** 371,377 **** if (vs != null) vs.shade( ! shaderVariables, ! frame.getNearClipping(), ! frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); --- 371,377 ---- if (vs != null) vs.shade( ! shaderVariables, ! frame.getNearClipping(), ! frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); *************** *** 397,455 **** if (displayMode == Display.Mode.RGB || displayMode == Display.Mode.RGBA) { sampler.getColors( ! samples, ! (column * sampler.getWidth() + (row == 0 ? 0 : 1) ! * (vFilterExtra + vPixelLess * sampler.getPixelHeight()) ! * bucketColumns ! * sampler.getWidth()) * 4, ! bucketColumns * sampler.getWidth(), ! 4, ! 0); samplesFilter.doFilter( ! samples, ! (column * sampler.getWidth() - (column == 0 ! ? 0 ! : (hFilterExtra + hPixelLess * sampler.getPixelWidth()))) * 4, ! bucketColumns * sampler.getWidth(), ! filteredSamples, ! 0, ! bucketWidth, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0), ! sampler.getPixelWidth(), ! sampler.getPixelHeight(), ! 4); colorsToPixels(filteredSamples, pixels); imageStore.setPixels( ! pixels, ! column * bucketWidth - (column == 0 ? 0 : hPixelLess) + (int) rmin.x, ! row * bucketHeight - (row == 0 ? 0 : vPixelLess) + (int) rmin.y, ! bucketWidth - (column == 0 ? hPixelLess : 0) - (column == bucketColumns - 1 ? wExtra : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0) - (row == bucketRows - 1 ? hExtra : 0), ! bucketWidth); if (fb != null) fb.refresh( ! column * bucketWidth - (column == 0 ? 0 : hPixelLess) + (int) rmin.x, ! row * bucketHeight - (row == 0 ? 0 : vPixelLess) + (int) rmin.y, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0)); } else if (displayMode == Display.Mode.Z) { sampler.getDepths(depths); zStore.setDepths( ! depths, ! column * bucketWidth + (int) rmin.x, ! row * bucketHeight + (int) rmin.y, ! bucketWidth, ! bucketHeight, ! bucketWidth); } if (frame.isShowProgressEnabled()) { --- 397,455 ---- if (displayMode == Display.Mode.RGB || displayMode == Display.Mode.RGBA) { sampler.getColors( ! samples, ! (column * sampler.getWidth() + (row == 0 ? 0 : 1) ! * (vFilterExtra + vPixelLess * sampler.getPixelHeight()) ! * bucketColumns ! * sampler.getWidth()) * 4, ! bucketColumns * sampler.getWidth(), ! 4, ! 0); samplesFilter.doFilter( ! samples, ! (column * sampler.getWidth() - (column == 0 ! ? 0 ! : (hFilterExtra + hPixelLess * sampler.getPixelWidth()))) * 4, ! bucketColumns * sampler.getWidth(), ! filteredSamples, ! 0, ! bucketWidth, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0), ! sampler.getPixelWidth(), ! sampler.getPixelHeight(), ! 4); colorsToPixels(filteredSamples, pixels); imageStore.setPixels( ! pixels, ! column * bucketWidth - (column == 0 ? 0 : hPixelLess) + (int) rmin.x, ! row * bucketHeight - (row == 0 ? 0 : vPixelLess) + (int) rmin.y, ! bucketWidth - (column == 0 ? hPixelLess : 0) - (column == bucketColumns - 1 ? wExtra : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0) - (row == bucketRows - 1 ? hExtra : 0), ! bucketWidth); if (fb != null) fb.refresh( ! column * bucketWidth - (column == 0 ? 0 : hPixelLess) + (int) rmin.x, ! row * bucketHeight - (row == 0 ? 0 : vPixelLess) + (int) rmin.y, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0)); } else if (displayMode == Display.Mode.Z) { sampler.getDepths(depths); zStore.setDepths( ! depths, ! column * bucketWidth + (int) rmin.x, ! row * bucketHeight + (int) rmin.y, ! bucketWidth, ! bucketHeight, ! bucketWidth); } if (frame.isShowProgressEnabled()) { *************** *** 458,462 **** percentComplete = percent; System.out.print( ! "\r" + frame.getDisplay().getName() + " (frame " --- 458,462 ---- percentComplete = percent; System.out.print( ! "\r" + frame.getDisplay().getName() + " (frame " *************** *** 466,482 **** + "% complete"); } ! } } System.arraycopy( ! samples, ! (bucketHeight * sampler.getPixelHeight() - (row == 0 ? (vFilterExtra + vPixelLess * sampler.getPixelHeight()) : 0)) * bucketColumns * sampler.getWidth() * 4, ! samples, ! 0, ! (vFilterExtra + vPixelLess * sampler.getPixelHeight()) * bucketColumns * sampler.getWidth() --- 466,482 ---- + "% complete"); } ! } } System.arraycopy( ! samples, ! (bucketHeight * sampler.getPixelHeight() - (row == 0 ? (vFilterExtra + vPixelLess * sampler.getPixelHeight()) : 0)) * bucketColumns * sampler.getWidth() * 4, ! samples, ! 0, ! (vFilterExtra + vPixelLess * sampler.getPixelHeight()) * bucketColumns * sampler.getWidth() *************** *** 499,508 **** } else if (displayMode == Display.Mode.Z) ShadowMap.writeShadowMap( ! frame.getDisplay().getName(), ! worldToCamera, ! cameraToRaster, ! frame.getHorizontalResolution(), ! frame.getVerticalResolution(), ! zStore.getDepths()); } catch (Exception e) { System.err.println("Error writing image file: " + e); --- 499,508 ---- } else if (displayMode == Display.Mode.Z) ShadowMap.writeShadowMap( ! frame.getDisplay().getName(), ! worldToCamera, ! cameraToRaster, ! frame.getHorizontalResolution(), ! frame.getVerticalResolution(), ! zStore.getDepths()); } catch (Exception e) { System.err.println("Error writing image file: " + e); *************** *** 517,526 **** rendering = false; } ! private void displayStats(int gridCount, Sampler sampler, float time) { if (frame.endOfFrameStatisticsEnabled()) { System.out.println("*** Frame Statistics ***"); System.out.println( ! "World parse time: " + Format.time(worldParseEnd - worldParseStart)); display("spheres", parser.getSphereCount()); display("cylinders", parser.getCylinderCount()); --- 517,526 ---- rendering = false; } ! private void displayStats(int gridCount, Sampler sampler, float time) { if (frame.endOfFrameStatisticsEnabled()) { System.out.println("*** Frame Statistics ***"); System.out.println( ! "World parse time: " + Format.time(worldParseEnd - worldParseStart)); display("spheres", parser.getSphereCount()); display("cylinders", parser.getCylinderCount()); *************** *** 541,550 **** System.out.println("Invisible patches: " + invisiblePatchCount); System.out.println( ! "Patches culled: " + invisiblePatchCount * 100f / primitivePatchCount + "%"); System.out.println("Root count: " + sampler.getRootCount()); System.out.println("Pixel count: " + sampler.getPixelCount()); System.out.println("MP Root count: " + sampler.getMPRootCount()); System.out.println( ! "gridCount = " + gridCount + " in " --- 541,550 ---- System.out.println("Invisible patches: " + invisiblePatchCount); System.out.println( ! "Patches culled: " + invisiblePatchCount * 100f / primitivePatchCount + "%"); System.out.println("Root count: " + sampler.getRootCount()); System.out.println("Pixel count: " + sampler.getPixelCount()); System.out.println("MP Root count: " + sampler.getMPRootCount()); System.out.println( ! "gridCount = " + gridCount + " in " *************** *** 569,577 **** System.out.println("Total " + primitiveName + ": " + count); } ! private boolean isPrimitiveVisible(Primitive p, Sampler sampler) { return sampler.isVisible(p.getRasterBounds(), p.getDistance()); } ! private void placeInNextBucket(Primitive p, int column, int row) { if (column < bucketColumns - 1) --- 569,577 ---- System.out.println("Total " + primitiveName + ": " + count); } ! private boolean isPrimitiveVisible(Primitive p, Sampler sampler) { return sampler.isVisible(p.getRasterBounds(), p.getDistance()); } ! private void placeInNextBucket(Primitive p, int column, int row) { if (column < bucketColumns - 1) *************** *** 580,604 **** doPlaceInBucket(p, 0, row + 1, true); } ! private void colorsToPixels(float[] colors, int[] result) { Color3f tmp = new Color3f(); for (int row = 0; row < bucketHeight; row++) for (int col = 0; col < bucketWidth; col++) { ! int offset = (row * bucketWidth + col) * 4; ! tmp.x = colors[offset++]; ! tmp.y = colors[offset++]; ! tmp.z = colors[offset++]; ! float alphaFloat = colors[offset]; ! frame.getExposure().expose(tmp, tmp); ! Quantizer qt = frame.getColorQuantizer(); ! int red = qt.quantize(tmp.x); ! int green = qt.quantize(tmp.y); ! int blue = qt.quantize(tmp.z); ! int alpha = qt.quantize(alphaFloat); ! offset = row * bucketWidth + col; ! result[offset] = ((alpha << 24) | (red << 16) | (green << 8) | blue); } } ! private void createClippingVolume() { rasterWindow = createRasterWindow(); --- 580,604 ---- doPlaceInBucket(p, 0, row + 1, true); } ! private void colorsToPixels(float[] colors, int[] result) { Color3f tmp = new Color3f(); for (int row = 0; row < bucketHeight; row++) for (int col = 0; col < bucketWidth; col++) { ! int offset = (row * bucketWidth + col) * 4; ! tmp.x = colors[offset++]; ! tmp.y = colors[offset++]; ! tmp.z = colors[offset++]; ! float alphaFloat = colors[offset]; ! frame.getExposure().expose(tmp, tmp); ! Quantizer qt = frame.getColorQuantizer(); ! int red = qt.quantize(tmp.x); ! int green = qt.quantize(tmp.y); ! int blue = qt.quantize(tmp.z); ! int alpha = qt.quantize(alphaFloat); ! offset = row * bucketWidth + col; ! result[offset] = ((alpha << 24) | (red << 16) | (green << 8) | blue); } } ! private void createClippingVolume() { rasterWindow = createRasterWindow(); *************** *** 617,625 **** Point3f lowerRight = new Point3f(max.x, min.y, focalLength); clippingVolume.addPlane( ! Plane.createWithThreePoints(origin, upperLeft, upperRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(origin, upperRight, lowerRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(origin, lowerRight, lowerLeft)); clippingVolume.addPlane(Plane.createWithThreePoints(origin, lowerLeft, upperLeft)); } else { --- 617,625 ---- Point3f lowerRight = new Point3f(max.x, min.y, focalLength); clippingVolume.addPlane( ! Plane.createWithThreePoints(origin, upperLeft, upperRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(origin, upperRight, lowerRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(origin, lowerRight, lowerLeft)); clippingVolume.addPlane(Plane.createWithThreePoints(origin, lowerLeft, upperLeft)); } else { *************** *** 633,656 **** Point3f originLowerRight = new Point3f(max.x, min.y, 0f); clippingVolume.addPlane( ! Plane.createWithThreePoints(originUpperLeft, upperLeft, upperRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(originUpperRight, upperRight, lowerRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(originLowerRight, lowerRight, lowerLeft)); clippingVolume.addPlane( ! Plane.createWithThreePoints(originLowerLeft, lowerLeft, upperLeft)); } float near = frame.getNearClipping(); clippingVolume.addPlane( ! Plane.createWithPointAndNormal( new Point3f(0f, 0f, near), new Vector3f(0f, 0f, -1f))); float far = frame.getFarClipping(); clippingVolume.addPlane( ! Plane.createWithPointAndNormal( new Point3f(0f, 0f, far), new Vector3f(0f, 0f, 1f))); } ! private Bounds2f createRasterWindow() { Bounds2f cropWindow = frame.getCropWindow(); --- 633,656 ---- Point3f originLowerRight = new Point3f(max.x, min.y, 0f); clippingVolume.addPlane( ! Plane.createWithThreePoints(originUpperLeft, upperLeft, upperRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(originUpperRight, upperRight, lowerRight)); clippingVolume.addPlane( ! Plane.createWithThreePoints(originLowerRight, lowerRight, lowerLeft)); clippingVolume.addPlane( ! Plane.createWithThreePoints(originLowerLeft, lowerLeft, upperLeft)); } float near = frame.getNearClipping(); clippingVolume.addPlane( ! Plane.createWithPointAndNormal( new Point3f(0f, 0f, near), new Vector3f(0f, 0f, -1f))); float far = frame.getFarClipping(); clippingVolume.addPlane( ! Plane.createWithPointAndNormal( new Point3f(0f, 0f, far), new Vector3f(0f, 0f, 1f))); } ! private Bounds2f createRasterWindow() { Bounds2f cropWindow = frame.getCropWindow(); *************** *** 661,668 **** float rxmin = Calc.clamp((float) Math.ceil(xResolution * min.x), 0f, xResolution - 1); float rxmax = ! Calc.clamp((float) Math.ceil(xResolution * max.x - 1f), 0f, xResolution - 1); float rymin = Calc.clamp((float) Math.ceil(yResolution * min.y), 0f, yResolution - 1); float rymax = ! Calc.clamp((float) Math.ceil(yResolution * max.y - 1f), 0f, yResolution - 1); Filter filter = frame.getFilter(); float xw = (filter.getHorizontalWidth() - 1) / 2f; --- 661,668 ---- float rxmin = Calc.clamp((float) Math.ceil(xResolution * min.x), 0f, xResolution - 1); float rxmax = ! Calc.clamp((float) Math.ceil(xResolution * max.x - 1f), 0f, xResolution - 1); float rymin = Calc.clamp((float) Math.ceil(yResolution * min.y), 0f, yResolution - 1); float rymax = ! Calc.clamp((float) Math.ceil(yResolution * max.y - 1f), 0f, yResolution - 1); Filter filter = frame.getFilter(); float xw = (filter.getHorizontalWidth() - 1) / 2f; *************** *** 678,682 **** return new Bounds2f(rxmin, rxmax, rymin, rymax); } ! private void createBuckets() { Point2f min = rasterWindow.getMin(); --- 678,682 ---- return new Bounds2f(rxmin, rxmax, rymin, rymax); } ! private void createBuckets() { Point2f min = rasterWindow.getMin(); *************** *** 700,703 **** buckets[i] = new MemoryBucket(); } ! } --- 700,703 ---- buckets[i] = new MemoryBucket(); } ! } |