You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(116) |
May
(220) |
Jun
(52) |
Jul
(30) |
Aug
(35) |
Sep
(24) |
Oct
(49) |
Nov
(44) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(30) |
Mar
(9) |
Apr
(44) |
May
(2) |
Jun
|
Jul
(10) |
Aug
(20) |
Sep
(25) |
Oct
(12) |
Nov
(16) |
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(10) |
2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(33) |
2007 |
Jan
(4) |
Feb
(57) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ma...@us...> - 2003-12-30 23:42:04
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv23801/src/org/jrman/render Modified Files: Sample.java SamplePoint.java Sampler.java Log Message: Minor optimizations Index: Sample.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sample.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Sample.java 25 Nov 2003 06:01:02 -0000 1.6 --- Sample.java 30 Dec 2003 23:42:00 -0000 1.7 *************** *** 37,40 **** --- 37,42 ---- private float z; + + boolean opaque; public Sample(float cRed, float cGreen, float cBlue, *************** *** 47,50 **** --- 49,53 ---- opacityBlue = oBlue; this.z = z; + opaque = (opacityRed == 1f && opacityGreen == 1f && opacityBlue == 1f); } *************** *** 58,62 **** public boolean isOpaque() { ! return opacityRed== 1f && opacityGreen == 1f && opacityBlue == 1f; } --- 61,65 ---- public boolean isOpaque() { ! return opaque; } Index: SamplePoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SamplePoint.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SamplePoint.java 25 Nov 2003 06:01:03 -0000 1.17 --- SamplePoint.java 30 Dec 2003 23:42:00 -0000 1.18 *************** *** 38,44 **** private Sampler sampler; ! private int row; ! ! private int column; private boolean opaque; --- 38,42 ---- private Sampler sampler; ! private int offset; private boolean opaque; *************** *** 46,53 **** private float z; ! public SamplePoint(Sampler sampler, int column, int row) { this.sampler = sampler; ! this.column = column; ! this.row = row; } --- 44,50 ---- private float z; ! public SamplePoint(Sampler sampler, int offset) { this.sampler = sampler; ! this.offset = offset; } *************** *** 106,110 **** z = nz; opaque = true; ! sampler.updateDepth(column, row, z); } } --- 103,107 ---- z = nz; opaque = true; ! sampler.updateDepth(offset, z); } } Index: Sampler.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sampler.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Sampler.java 27 Nov 2003 15:50:34 -0000 1.16 --- Sampler.java 30 Dec 2003 23:42:00 -0000 1.17 *************** *** 58,61 **** --- 58,63 ---- private boolean modified; + private boolean hasSamples; + public static int rootCount; *************** *** 95,99 **** for (int column = 0; column < width; column++) samplePoints[row * width + column] = ! new SamplePoint(this, column / pixelWidth, row / pixelHeight); pixelsVisibility = new MaskElement[bucketWidth * bucketHeight]; for (int i = 0; i < pixelsVisibility.length; i++) --- 97,102 ---- for (int column = 0; column < width; column++) samplePoints[row * width + column] = ! new SamplePoint(this, ! column / pixelWidth + (row / pixelHeight) * bucketWidth); pixelsVisibility = new MaskElement[bucketWidth * bucketHeight]; for (int i = 0; i < pixelsVisibility.length; i++) *************** *** 119,122 **** --- 122,126 ---- for (int i = 0; i < pixelsVisibility.length; i++) pixelsVisibility[i].reset(); + hasSamples = false; } *************** *** 128,131 **** --- 132,137 ---- mp.sample(this); } + if (modified) + hasSamples = true; if (modified && hasMorePrimitives) { modifiedSampleBucketsCount++; *************** *** 205,220 **** int bands, int bandOffset) { - int srcOffset = 0; int destOffset = dstOffset + bandOffset; ! for (int row = 0; row < height; row++) { ! for (int col = 0; col < width; col++) { ! samplePoints[srcOffset + col].getColor(tmpColor); ! int offset = destOffset + col * bands; ! dst[offset++] = tmpColor.x; ! dst[offset++] = tmpColor.y; ! dst[offset] = tmpColor.z; } - srcOffset += width; - destOffset += rowLength * bands; } } --- 211,238 ---- int bands, int bandOffset) { int destOffset = dstOffset + bandOffset; ! rowLength *= bands; ! if (hasSamples) { ! int srcOffset = 0; ! for (int row = 0; row < height; row++) { ! for (int col = 0; col < width; col++) { ! samplePoints[srcOffset++].getColor(tmpColor); ! int offset = destOffset + col * bands; ! dst[offset++] = tmpColor.x; ! dst[offset++] = tmpColor.y; ! dst[offset] = tmpColor.z; ! } ! destOffset += rowLength; ! } ! } else { ! for (int row = 0; row < height; row++) { ! for (int col = 0; col < width; col++) { ! int offset = destOffset + col * bands; ! dst[offset++] = 0f; ! dst[offset++] = 0f; ! dst[offset] = 0f; ! } ! destOffset += rowLength; } } } *************** *** 272,277 **** } ! public void updateDepth(int column, int row, float z) { ! MaskElement me = pixelsVisibility[row * bucketWidth + column]; if (z < me.z) { me.modified = true; --- 290,295 ---- } ! public void updateDepth(int offset, float z) { ! MaskElement me = pixelsVisibility[offset]; if (z < me.z) { me.modified = true; |
From: <ma...@us...> - 2003-12-20 18:57:00
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv2875/src/org/jrman/render Modified Files: SimpleMicropolygon.java Log Message: Discar invisible (opacity == 0) micropolygons. Index: SimpleMicropolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SimpleMicropolygon.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SimpleMicropolygon.java 25 Nov 2003 06:01:04 -0000 1.15 --- SimpleMicropolygon.java 20 Dec 2003 18:56:56 -0000 1.16 *************** *** 155,158 **** --- 155,160 ---- float oGreen, float oBlue) { + if (oRed == 0f && oGreen == 0f && oBlue == 0f) + return false; count++; // Face forward |
From: <ma...@us...> - 2003-12-20 18:14:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1:/tmp/cvs-serv28925/src/org/jrman/parameters Modified Files: VaryingArrayFloat.java Log Message: Hack for "st" parameter on polygons. Index: VaryingArrayFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayFloat.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VaryingArrayFloat.java 14 Dec 2003 22:28:28 -0000 1.3 --- VaryingArrayFloat.java 20 Dec 2003 18:13:32 -0000 1.4 *************** *** 33,35 **** --- 33,39 ---- } + public void setValue(int index, int arrayIndex, float value) { + values[index * declaration.getCount() + arrayIndex] = value; + } + } |
From: <ma...@us...> - 2003-12-20 18:13:39
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv28925/src/org/jrman/parser Modified Files: Parser.java Log Message: Hack for "st" parameter on polygons. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** Parser.java 17 Dec 2003 01:21:20 -0000 1.73 --- Parser.java 20 Dec 2003 18:13:33 -0000 1.74 *************** *** 65,68 **** --- 65,69 ---- import org.jrman.parameters.UniformScalarInteger; import org.jrman.parameters.UniformScalarString; + import org.jrman.parameters.VaryingArrayFloat; import org.jrman.parameters.VaryingScalarFloat; import org.jrman.parameters.VaryingScalarTuple3f; *************** *** 1036,1039 **** --- 1037,1042 ---- VaryingScalarTuple3f pParam = (VaryingScalarTuple3f) parameters.getParameter("P"); + VaryingArrayFloat stParam = + (VaryingArrayFloat) parameters.getParameter("st"); int offset = 0; Point3f point = new Point3f(); *************** *** 1044,1050 **** --- 1047,1065 ---- pParam.getDeclaration(), new float[n * 3]); + VaryingArrayFloat nstParam = null; + if (stParam != null) + nstParam = new VaryingArrayFloat(stParam.getDeclaration(), + new float[n * 2]); for (int j = 0; j < n; j++) { pParam.getValue((int) vertices[offset], point); nParam.setValue(j, point); + if (stParam != null) { + nstParam.setValue(j, 0, + stParam.getValue((int) vertices[offset], + 0)); + nstParam.setValue(j, 1, + stParam.getValue((int) vertices[offset], + 1)); + } offset += 1; } *************** *** 1052,1055 **** --- 1067,1074 ---- newParameters.removeParameter(nParam.getDeclaration().getName()); newParameters.addParameter(nParam); + if (stParam != null) { + newParameters.removeParameter(stParam.getDeclaration().getName()); + newParameters.addParameter(nstParam); + } addPolygon(newParameters); } *************** *** 1059,1062 **** --- 1078,1083 ---- VaryingScalarTuple3f pParam = (VaryingScalarTuple3f) parameters.getParameter("P"); + VaryingArrayFloat stParam = + (VaryingArrayFloat) parameters.getParameter("st"); Point3f point = new Point3f(); for (int i = 1; i < pParam.getCount() - 1; i += 1) { *************** *** 1065,1068 **** --- 1086,1093 ---- pParam.getDeclaration(), new float[4 * 3]); + VaryingArrayFloat nstParam = null; + if (stParam != null) + nstParam = new VaryingArrayFloat(stParam.getDeclaration(), + new float[4 * 2]); ParameterList newParameters = new ParameterList(parameters); pParam.getValue(0, point); *************** *** 1074,1079 **** --- 1099,1118 ---- pParam.getValue(i + 1, point); nParam.setValue(3, point); + if (stParam != null) { + nstParam.setValue(0, 0, stParam.getValue(0, 0)); + nstParam.setValue(0, 1, stParam.getValue(0, 1)); + nstParam.setValue(1, 0, stParam.getValue(i, 0)); + nstParam.setValue(1, 1, stParam.getValue(i, 1)); + nstParam.setValue(2, 0, stParam.getValue(0, 0)); + nstParam.setValue(2, 1, stParam.getValue(0, 1)); + nstParam.setValue(3, 0, stParam.getValue(i + 1, 0)); + nstParam.setValue(3, 1, stParam.getValue(i + 1, 1)); + } newParameters.removeParameter(nParam.getDeclaration().getName()); newParameters.addParameter(nParam); + if (stParam != null) { + newParameters.removeParameter(stParam.getDeclaration().getName()); + newParameters.addParameter(nstParam); + } addBilinearPatch(newParameters); } |
From: <ma...@us...> - 2003-12-20 15:35:09
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs1:/tmp/cvs-serv4273/src Added Files: SurfaceAlphaplastic.java Log Message: Minor bug fix. New shader. --- NEW FILE: SurfaceAlphaplastic.java --- /* SurfaceAlphaplastic.java Copyright (C) 2003 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 Place - Suite 330, Boston, MA 02111-1307, USA. */ import javax.vecmath.Color3f; import org.jrman.grid.Color3fGrid; import org.jrman.grid.FloatGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.parameters.Declaration; import org.jrman.parameters.UniformScalarFloat; import org.jrman.parameters.UniformScalarString; import org.jrman.parameters.UniformScalarTuple3f; import org.jrman.render.ShaderVariables; import org.jrman.shaders.SurfaceShader; public class SurfaceAlphaplastic extends SurfaceShader { private static Vector3fGrid vg1 = new Vector3fGrid(); private static Vector3fGrid vg2 = new Vector3fGrid(); private static Color3fGrid cg1 = new Color3fGrid(); private static Color3fGrid cg2 = new Color3fGrid(); private static Color3fGrid cg3 = new Color3fGrid(); private static FloatGrid fg = new FloatGrid(); private static Color3f specularcolor = new Color3f(); protected void initDefaults() { defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Kd", "uniform float"), 1f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Ks", "uniform float"), 1f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("roughness", "uniform float"), .1f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("specularcolor", "uniform color"), 1f, 1f, 1f)); defaultParameters.addParameter( new UniformScalarString(new Declaration("texturename", "string"), "")); defaultParameters.addParameter( new UniformScalarString(new Declaration("alphatexturename", "string"), "")); } public void shade(ShaderVariables sv) { super.shade(sv); UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); UniformScalarFloat paramKs = (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = (UniformScalarTuple3f) getParameter(sv, "specularcolor"); paramSpecularcolor.getValue(specularcolor); UniformScalarString paramTexturename = (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); UniformScalarString paramAlphatexturename = (UniformScalarString) getParameter(sv, "alphatexturename"); final String alphatexturename = paramAlphatexturename.getValue(); vg1.normalize(sv.N); vg1.faceforward(vg1, sv.I); vg2.normalize(sv.I); vg2.negate(vg2); sv.Oi.set(sv.Os); ambient(sv, cg1); cg3.set(Ka); cg1.mul(cg1, cg3); diffuse(sv, vg1, cg2); cg3.set(Kd); cg2.mul(cg2, cg3); cg1.add(cg1, cg2); cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { cg2.texture(texturename, sv.s, sv.t); cg1.mul(cg1, cg2); } specular(sv, vg1, vg2, roughness, cg2); cg3.set(Ks); cg2.mul(cg2, cg3); cg3.set(specularcolor); cg2.mul(cg2, cg3); cg1.add(cg1, cg2); if (!alphatexturename.equals("")) { fg.texture(alphatexturename, sv.s, sv.t); sv.Oi.set(fg); } sv.Ci.mul(sv.Oi, cg1); } } |
From: <ma...@us...> - 2003-12-20 15:35:09
|
Update of /cvsroot/jrman/drafts/jrMan In directory sc8-pr-cvs1:/tmp/cvs-serv4273/jrMan Modified Files: README.TXT Log Message: Minor bug fix. New shader. Index: README.TXT =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/README.TXT,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** README.TXT 30 Sep 2003 23:38:59 -0000 1.9 --- README.TXT 20 Dec 2003 15:35:04 -0000 1.10 *************** *** 1,6 **** What is jrMan? (Java Renderman) -------------- ! jrMan is an open source implementation of the REYES (Render Everything You Ever ! Saw) algorithm used by Pixar's PhotoRealistic Renderman to render images. Although PhotoRealistic Renderman is used to generate most CGI (Computer --- 1,6 ---- What is jrMan? (Java Renderman) -------------- ! jrMan is an open source implementation of the REYES (Render Everything You ! Ever Saw) algorithm used by Pixar's PhotoRealistic Renderman to render images. Although PhotoRealistic Renderman is used to generate most CGI (Computer *************** *** 14,23 **** Setup: ------ ! To install jrMan you must first download and install the JDK 1.4.1 (or above) ! and the Java3D API (jrMan uses the javax.vecmath package from Java3D). You can ! find both of them at: http://java.sun.com ! Once Java is installed in your system you need to download the jrman-0_2.zip or ! jrman-0_2.tar.gz file an unzip (tar xfz) it. This will create a "jrman-0_2" directory with all the files you need. --- 14,22 ---- Setup: ------ ! To install jrMan you must first download and install the JDK 1.4.1 (or above). ! You can find it at: http://java.sun.com (jrMan doesn't require Java3D anymore) ! Once Java is installed in your system you need to download the jrman-0_3.zip or ! jrman-0_3.tar.gz file an unzip (tar xfz) it. This will create a "jrman-0_3" directory with all the files you need. *************** *** 25,30 **** you might need to type something like this at the command prompt: ! set PATH=%PATH%;C:\jrman-0_2\bin ! set JRMAN_HOME=C:\jrman-0_2 (assuming you unpacked the jrMan distribution in C:\) --- 24,29 ---- you might need to type something like this at the command prompt: ! set PATH=%PATH%;C:\jrman-0_3\bin ! set JRMAN_HOME=C:\jrman-0_3 (assuming you unpacked the jrMan distribution in C:\) *************** *** 32,37 **** If you are using Linux or Unix you might need to type something like: ! export PATH=$PATH:/usr/local/jrman-0_2/bin ! export JRMAN_HOME=/usr/local/jrman-0_2 (assuming you unzipped the jrMan distribution in /usr/local) --- 31,36 ---- If you are using Linux or Unix you might need to type something like: ! export PATH=$PATH:/usr/local/jrman-0_3/bin ! export JRMAN_HOME=/usr/local/jrman-0_3 (assuming you unzipped the jrMan distribution in /usr/local) *************** *** 43,47 **** command prompt: ! jrMan scene.rib The "model" subdirectory of the jrMan distribution contains some sample scenes --- 42,50 ---- command prompt: ! jrman scene.rib ! ! You can also type 'jrman' by itself and it will display a window where you can ! select the scenes you want to render. You can also use the '-h' option to ! see all available options. The "model" subdirectory of the jrMan distribution contains some sample scenes *************** *** 57,71 **** capsules.rib shadowTest.rib (all the other .rib files in the model directory are data files used by the above scenes). ! Note: shadowTest.rib might take a long time to render because all the ! parameters are set for a very high quality rendering. If you want it to render ! faster you might reduce the values for PixelSamples and "samples", and use a ! larger value for the ShadingRate. ! ! ! Renderman features implemented in jrMan 0.2: -------------------------------------------- * Shadows --- 60,69 ---- capsules.rib shadowTest.rib + noiseShadersTest.rib (all the other .rib files in the model directory are data files used by the above scenes). ! Renderman features implemented in jrMan 0.3: -------------------------------------------- * Shadows *************** *** 99,102 **** --- 97,104 ---- glow (from the Renderman Companion book) randomcolors (used for capsules.rib) + noisetest (for testing noise()) + turbulence (for testing noise()) + randomcheckers (for testing noise()) + confetti (for testing noise()) * Light shaders: *************** *** 115,118 **** --- 117,123 ---- bumpy bumptest (to test the implementation of displacements in jrMan) + noisetest (for testing noise()) + dented (for testing noise()) + turbulence (for testing noise()) * All pixel filters *************** *** 121,125 **** ! Renderman features not yet implemented in jrMan 0.2: ---------------------------------------------------- * Shading language compiler --- 126,130 ---- ! Renderman features not yet implemented in jrMan 0.3: ---------------------------------------------------- * Shading language compiler *************** *** 136,143 **** ! Comparing jrMan 0.2 to other Renderman renderers: ------------------------------------------------- We provided in the "model" directory the shading language source code for: glow, randomcolors and bumptest. --- 141,204 ---- ! Comparing jrMan 0.3 to other Renderman renderers: ------------------------------------------------- We provided in the "model" directory the shading language source code for: glow, randomcolors and bumptest. + + + Performance: + ------------ + We measured the performance relative to jrMan 0.2 and in some cases jrMan 0.3 + is over twice as fast! + + Here are the results of the benchmarks we did with the sample rib files from + the distribution: + + File jrMan 0.2 jrMan 0.3 Speed Improvement + ---- --------- --------- ----------------- + aphrodite.rib 24s 16s 1.50 + uteapot.rib 40s 29s 1.38 + bike.rib 47s 34s 1.38 + vehicles.rib 1m59s 1m21s 1.47 + capsules.rib 3m22s 3m10s 1.06 + elephant.rib 10m18s 3m39s 2.82 + shadowTest.rib 7m24s 2m57s 2.51 + DinningRoom.rib 5m43s 4m03s 1.41 + ManySpheres.rib 1m39s 1m20s 1.24 + + + How we ran these benchmarks: + We changed the standard jrman .bat script to assign 384 MB of RAM and to use + the Server Hotspot compiler, here is the modified script: + + @echo off + + set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar;%JRMAN_HOME%\jar\vecmath.jar;%JRMAN_HOME%\jar\commons-cli-1.0.jar + set MEMORY=384m + java -server -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.JRMan %* + + (we did the same thing for the jrMan 0.2 script) + + Then we rendered each image twice, like this: jrman aphrodite.rib aphrodite.rib + and we took the time for te second render. This is because the hotspot compiler + starts by intrepreting and profiling the java bytecodes and then uses the + profile information to select what methods should be translated into optimized + machine code. + After rendering the first image the hotspot compiler has already finished + translating all critical methods into machine code so we can measure + performance without interpretation or compilation side effects. + + We ran these tests with a lot fo RAM to avoid memory footprint side effects + (we wanted to test only the CPU optimizations by themselves), but jrMan 0.3 + also has memory optimizations to use a smaller amount of RAM when rendering + scenes with a large number of primitives. These memory optimizations can also + be reflected in smaller rendering times. Here are the result of some tests + using the default amount of RAM (160 MB): + + + File jrMan 0.2 jrMan 0.3 Speed Improvement + ---- --------- --------- ----------------- + vehicles.rib 3m09s 1m25s 2.22 + |
From: <ma...@us...> - 2003-12-20 15:35:09
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv4273/src/org/jrman/render Modified Files: ImageStore.java Log Message: Minor bug fix. New shader. Index: ImageStore.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/ImageStore.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ImageStore.java 17 Dec 2003 02:31:52 -0000 1.6 --- ImageStore.java 20 Dec 2003 15:35:05 -0000 1.7 *************** *** 55,59 **** continue; pixel[0] = pixels[row * rowLength + col]; ! // image.setRGB(x + col, y + row, pixel); raster.setDataElements(x + col, y + row, pixel); } --- 55,59 ---- continue; pixel[0] = pixels[row * rowLength + col]; ! /// image.setRGB(x + col, y + row, pixel); raster.setDataElements(x + col, y + row, pixel); } |
From: <ma...@us...> - 2003-12-20 15:35:09
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv4273/src/org/jrman/grid Modified Files: FloatGrid.java Log Message: Minor bug fix. New shader. Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FloatGrid.java 14 Dec 2003 22:28:29 -0000 1.20 --- FloatGrid.java 20 Dec 2003 15:35:05 -0000 1.21 *************** *** 1396,1401 **** v1 = v - 1; float area = ! Math.abs(s.get(u1, v) - s.get(u, v)) ! * Math.abs(t.get(u, v1) - t.get(u, v)); set(u, v, getFloat(texture, s.get(u, v), t.get(u, v), area)); } --- 1396,1401 ---- v1 = v - 1; float area = ! Math.abs(s.get(u1, v1) - s.get(u, v)) ! * Math.abs(t.get(u1, v1) - t.get(u, v)); set(u, v, getFloat(texture, s.get(u, v), t.get(u, v), area)); } |
From: <ma...@us...> - 2003-12-20 15:35:09
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv4273/sampleData Modified Files: noiseShadersTest.rib Log Message: Minor bug fix. New shader. Index: noiseShadersTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/noiseShadersTest.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** noiseShadersTest.rib 14 Dec 2003 17:49:28 -0000 1.4 --- noiseShadersTest.rib 20 Dec 2003 15:35:04 -0000 1.5 *************** *** 1,3 **** ! Format 512 512 1 Display "shaderTest" "framebuffer" "rgba" PixelSamples 4 4 --- 1,3 ---- ! Format 700 700 1 Display "shaderTest" "framebuffer" "rgba" PixelSamples 4 4 |
From: <ma...@us...> - 2003-12-20 15:35:08
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv4273/src/org/jrman/shaders Modified Files: SurfacePaintedplastic.java Log Message: Minor bug fix. New shader. Index: SurfacePaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfacePaintedplastic.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SurfacePaintedplastic.java 25 Nov 2003 16:34:08 -0000 1.4 --- SurfacePaintedplastic.java 20 Dec 2003 15:35:05 -0000 1.5 *************** *** 1,4 **** /* ! SurfacePaintedPlasticl.java Copyright (C) 2003 Gerardo Horvilleur Martinez --- 1,4 ---- /* ! SurfacePaintedplastic.java Copyright (C) 2003 Gerardo Horvilleur Martinez |
From: <ma...@us...> - 2003-12-20 15:35:08
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv4273/src/org/jrman/primitive Modified Files: Primitive.java Log Message: Minor bug fix. New shader. Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Primitive.java 13 Dec 2003 18:00:25 -0000 1.23 --- Primitive.java 20 Dec 2003 15:35:05 -0000 1.24 *************** *** 36,39 **** --- 36,40 ---- import org.jrman.parameters.Parameter; import org.jrman.parameters.ParameterList; + import org.jrman.parameters.VaryingArrayFloat; import org.jrman.parameters.VaryingScalarFloat; import org.jrman.parameters.VaryingScalarTuple3f; *************** *** 390,411 **** parameter = parameters.getParameter("s"); if (parameter == null) { ! float[] s = new float[4]; ! VaryingScalarFloat uParam = (VaryingScalarFloat) parameters.getParameter("u"); ! s[0] = uParam.getValue(0); ! s[1] = uParam.getValue(1); ! s[2] = uParam.getValue(2); ! s[3] = uParam.getValue(3); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("s"), s)); } parameter = parameters.getParameter("t"); if (parameter == null) { ! float[] t = new float[4]; ! VaryingScalarFloat vParam = (VaryingScalarFloat) parameters.getParameter("v"); ! t[0] = vParam.getValue(0); ! t[1] = vParam.getValue(1); ! t[2] = vParam.getValue(2); ! t[3] = vParam.getValue(3); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("t"), t)); } } --- 391,437 ---- parameter = parameters.getParameter("s"); if (parameter == null) { ! VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); ! if (stParam != null) { ! float[] s = new float[4]; ! s[0] = stParam.getValue(0, 0); ! s[1] = stParam.getValue(1, 0); ! s[2] = stParam.getValue(2, 0); ! s[3] = stParam.getValue(3, 0); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("s"), ! s)); ! } else { ! float[] s = new float[4]; ! VaryingScalarFloat uParam = (VaryingScalarFloat) parameters.getParameter("u"); ! s[0] = uParam.getValue(0); ! s[1] = uParam.getValue(1); ! s[2] = uParam.getValue(2); ! s[3] = uParam.getValue(3); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("s"), ! s)); ! } } parameter = parameters.getParameter("t"); if (parameter == null) { ! VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); ! if (stParam != null) { ! float[] t = new float[4]; ! t[0] = stParam.getValue(0, 1); ! t[1] = stParam.getValue(1, 1); ! t[2] = stParam.getValue(2, 1); ! t[3] = stParam.getValue(3, 1); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("t"), ! t)); ! } else { ! float[] t = new float[4]; ! VaryingScalarFloat vParam = (VaryingScalarFloat) parameters.getParameter("v"); ! t[0] = vParam.getValue(0); ! t[1] = vParam.getValue(1); ! t[2] = vParam.getValue(2); ! t[3] = vParam.getValue(3); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("t"), ! t)); ! } } + parameters.removeParameter("st"); } |
From: <ega...@us...> - 2003-12-20 02:47:52
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv31476 Added Files: leaf.jpg leaf.rib Log Message: Added tree test. --- NEW FILE: leaf.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: leaf.rib --- MakeTexture "leaf.jpg" "leaf.txr" "periodic" "periodic" "gaussian" 2 2 Format 400 400 1 Display "shaderTest" "framebuffer" "rgba" PixelSamples 2 2 PixelFilter "gaussian" 2 2 Exposure 1 2.2 Projection "perspective" "fov" 10 Translate -5 0 80 WorldBegin ShadingRate 1 LightSource "distantlight" 1 "from" [1 1 -1] "to" [0 0 0] "intensity" 1 LightSource "ambientlight" 2 "intensity" 0.05 AttributeBegin Rotate 45 1 1 1 Surface "matte" Color .4078 .2941 .0156 Cylinder .31 .1 9.9 360 Displacement "bumpy" "texturename" "leaf.txr" "Km" .9 Attribute "displacementbound" "sphere" .9 Color .2941 .4666 .1333 Cylinder .3 0 10 360 AttributeEnd WorldEnd |
From: <ma...@us...> - 2003-12-17 02:31:55
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv32493/src/org/jrman/render Modified Files: ImageStore.java Log Message: Small optimization. Index: ImageStore.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/ImageStore.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImageStore.java 17 Aug 2003 22:05:39 -0000 1.5 --- ImageStore.java 17 Dec 2003 02:31:52 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- import java.awt.image.BufferedImage; + import java.awt.image.WritableRaster; import org.jrman.options.Display; *************** *** 32,35 **** --- 33,40 ---- private BufferedImage image; + private WritableRaster raster; + + private int[] pixel = new int[1]; + public ImageStore(int hSize, int vSize, Display display) { this.hSize = hSize; *************** *** 39,42 **** --- 44,48 ---- else image = new BufferedImage(hSize, vSize, BufferedImage.TYPE_INT_ARGB); + raster = image.getRaster(); } *************** *** 48,53 **** if (x + col < 0 || x + col >= hSize) continue; ! int pixel = pixels[row * rowLength + col]; ! image.setRGB(x + col, y + row, pixel); } } --- 54,60 ---- if (x + col < 0 || x + col >= hSize) continue; ! pixel[0] = pixels[row * rowLength + col]; ! // image.setRGB(x + col, y + row, pixel); ! raster.setDataElements(x + col, y + row, pixel); } } |
From: <ega...@us...> - 2003-12-17 01:34:23
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs1:/tmp/cvs-serv23378 Modified Files: build.xml Log Message: Added noiseShadersTest.rib to distribution. Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** build.xml 11 Dec 2003 20:21:11 -0000 1.15 --- build.xml 17 Dec 2003 01:34:20 -0000 1.16 *************** *** 127,130 **** --- 127,131 ---- <include name="clay.gif"/> <include name="shadowTest.rib"/> + <include name="noiseShadersTest.rib"/> </fileset> </copy> |
From: <ma...@us...> - 2003-12-17 01:21:23
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv21391/src/org/jrman/parser Modified Files: Parser.java Log Message: Saved attributes between frames. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Parser.java 12 Dec 2003 23:50:19 -0000 1.72 --- Parser.java 17 Dec 2003 01:21:20 -0000 1.73 *************** *** 425,431 **** public void frameBegin(int n) { ! pushState(State.FRAME); frameStack.push(new Frame(frame)); worldStack.push(new World(world)); frame.setFrameNumber(n); } --- 425,432 ---- public void frameBegin(int n) { ! pushState(State.FRAME); frameStack.push(new Frame(frame)); worldStack.push(new World(world)); + pushAttributes(); frame.setFrameNumber(n); } *************** *** 441,444 **** --- 442,446 ---- public void frameEnd() { + popAttributes(); world = (World) worldStack.pop(); frame = (Frame) frameStack.pop(); |
From: <ma...@us...> - 2003-12-17 01:21:23
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv21391/sampleData Modified Files: mechtoy.rib Log Message: Saved attributes between frames. Index: mechtoy.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/mechtoy.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mechtoy.rib 11 Sep 2003 21:53:47 -0000 1.1 --- mechtoy.rib 17 Dec 2003 01:21:19 -0000 1.2 *************** *** 22,26 **** FrameBegin 1 ! Display "MechToy.01.tiff" "file" "rgb" WorldBegin --- 22,26 ---- FrameBegin 1 ! Display "MechToy.01.tiff" "framebuffer" "rgb" WorldBegin |
From: <ma...@us...> - 2003-12-16 00:06:44
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv32059/src/org/jrman/primitive Modified Files: BicubicPatch.java Log Message: Minor optimization Index: BicubicPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BicubicPatch.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** BicubicPatch.java 13 Dec 2003 18:00:25 -0000 1.6 --- BicubicPatch.java 16 Dec 2003 00:06:41 -0000 1.7 *************** *** 149,152 **** --- 149,154 ---- public Primitive[] split() { Primitive[] result = new Primitive[2]; + parameters.removeParameter("u"); + parameters.removeParameter("v"); extractPoints(); vtmp.sub(P30, P00); *************** *** 184,189 **** float uv11) { ParameterList result = linearInterpolateParameters(uv00, uv10, uv01, uv11); ! result.removeParameter("u"); ! result.removeParameter("v"); extractPoints(); VaryingScalarTuple3f sparam = --- 186,191 ---- float uv11) { ParameterList result = linearInterpolateParameters(uv00, uv10, uv01, uv11); ! // result.removeParameter("u"); ! // result.removeParameter("v"); extractPoints(); VaryingScalarTuple3f sparam = |
From: <ma...@us...> - 2003-12-15 06:21:36
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv16950/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Code layout Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** RendererHidden.java 13 Dec 2003 18:00:26 -0000 1.57 --- RendererHidden.java 15 Dec 2003 06:21:33 -0000 1.58 *************** *** 54,60 **** 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; --- 54,60 ---- 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; *************** *** 100,115 **** public void init(Frame frame, World world) { super.init(frame, world); ! worldToCamera= Global.getTransform("camera"); ! Transform cameraToScreen= Global.getTransform("screen"); ! Transform screenToRaster= Global.getTransform("raster"); if (cameraToScreen instanceof PerspectiveTransform) ! cameraToRaster= ((PerspectiveTransform)cameraToScreen).preConcat(screenToRaster); else ! cameraToRaster= screenToRaster.concat(cameraToScreen); ! eyePlane= Plane.createWithPointAndNormal(new Point3f(), new Vector3f(0f, 0f, -1f)); createClippingVolume(); createBuckets(); ! samplesFilter= frame.getFilter().getSamplesFilter(); ! worldParseStart= System.currentTimeMillis(); } --- 100,115 ---- public void init(Frame frame, World world) { super.init(frame, world); ! worldToCamera = Global.getTransform("camera"); ! Transform cameraToScreen = Global.getTransform("screen"); ! Transform screenToRaster = Global.getTransform("raster"); if (cameraToScreen instanceof PerspectiveTransform) ! cameraToRaster = ((PerspectiveTransform) cameraToScreen).preConcat(screenToRaster); else ! cameraToRaster = screenToRaster.concat(cameraToScreen); ! eyePlane = Plane.createWithPointAndNormal(new Point3f(), new Vector3f(0f, 0f, -1f)); createClippingVolume(); createBuckets(); ! samplesFilter = frame.getFilter().getSamplesFilter(); ! worldParseStart = System.currentTimeMillis(); } *************** *** 118,126 **** } ! private void internalAddPrimitive(Primitive primitive, int curColumn, int curRow, boolean check) { ! Transform objectToCamera= primitive.getObjectToCamera(); if (objectToCamera == null) { ! Transform objectToWorld= primitive.getAttributes().getTransform(); ! objectToCamera= worldToCamera.concat(objectToWorld); primitive.setObjectToCamera(objectToCamera); } --- 118,130 ---- } ! private void internalAddPrimitive( ! Primitive primitive, ! int curColumn, ! int curRow, ! boolean check) { ! Transform objectToCamera = primitive.getObjectToCamera(); if (objectToCamera == null) { ! Transform objectToWorld = primitive.getAttributes().getTransform(); ! objectToCamera = worldToCamera.concat(objectToWorld); primitive.setObjectToCamera(objectToCamera); } *************** *** 129,142 **** } ! private boolean addPrimitive(Primitive primitive, int recursionLevel, Transform objectToCamera, int curColumn, int curRow, boolean check) { ! BoundingVolume bv= primitive.getBoundingVolume(); ! float db= primitive.getAttributes().getDisplacementBound(); BoundingVolume bve; if (db != 0f) { ! bve= bv.enlarge(db); ! bve= bve.transform(objectToCamera); ! bv= bv.transform(objectToCamera); ! } ! else { bv = bv.transform(objectToCamera); bve = bv; --- 133,151 ---- } ! private boolean addPrimitive( ! Primitive primitive, ! int recursionLevel, ! Transform objectToCamera, ! int curColumn, ! int curRow, ! boolean check) { ! BoundingVolume bv = primitive.getBoundingVolume(); ! float db = primitive.getAttributes().getDisplacementBound(); BoundingVolume bve; if (db != 0f) { ! bve = bv.enlarge(db); ! bve = bve.transform(objectToCamera); ! bv = bv.transform(objectToCamera); ! } else { bv = bv.transform(objectToCamera); bve = bv; *************** *** 144,148 **** if (clippingVolume.whereIs(bve) == Plane.Side.OUTSIDE) return true; ! Plane.Side side= bv.whichSideOf(eyePlane); if (side == Plane.Side.INSIDE) { placeInBucket(primitive, bve, bv, curColumn, curRow, check); --- 153,157 ---- if (clippingVolume.whereIs(bve) == Plane.Side.OUTSIDE) return true; ! Plane.Side side = bv.whichSideOf(eyePlane); if (side == Plane.Side.INSIDE) { placeInBucket(primitive, bve, bv, curColumn, curRow, check); *************** *** 152,173 **** if (recursionLevel == MAX_EYE_SPLITS) return false; ! Primitive[] sub= primitive.split(); ! boolean result= true; ! for (int i= 0; i < sub.length; i++) ! if (!addPrimitive(sub[i], recursionLevel + 1, objectToCamera, curColumn, curRow, check)) ! result= false; return result; } ! private void placeInBucket(Primitive primitive, BoundingVolume bve, BoundingVolume bv, int column, int row, boolean check) { ! bve= bve.transform(cameraToRaster); primitive.setDistance(bve.getMinZ()); ! Bounds2f bounds= bve.toBounds2f(); ! float db= primitive.getAttributes().getDisplacementBound(); if (db != 0f) { ! bv= bv.transform(cameraToRaster); ! Bounds2f bnd= bv.toBounds2f(); ! float dw= bounds.getWidth() - bnd.getWidth(); ! float dh= bounds.getHeight() - bnd.getHeight(); primitive.setScreenDisplacementWidth(dw); primitive.setScreenDisplacementHeight(dh); --- 161,193 ---- if (recursionLevel == MAX_EYE_SPLITS) return false; ! Primitive[] sub = primitive.split(); ! boolean result = true; ! for (int i = 0; i < sub.length; i++) ! if (!addPrimitive(sub[i], ! recursionLevel + 1, ! objectToCamera, ! curColumn, ! curRow, ! check)) ! result = false; return result; } ! private void placeInBucket( ! Primitive primitive, ! BoundingVolume bve, ! BoundingVolume bv, ! int column, ! int row, ! boolean check) { ! bve = bve.transform(cameraToRaster); primitive.setDistance(bve.getMinZ()); ! Bounds2f bounds = bve.toBounds2f(); ! float db = primitive.getAttributes().getDisplacementBound(); if (db != 0f) { ! bv = bv.transform(cameraToRaster); ! Bounds2f bnd = bv.toBounds2f(); ! float dw = bounds.getWidth() - bnd.getWidth(); ! float dh = bounds.getHeight() - bnd.getHeight(); primitive.setScreenDisplacementWidth(dw); primitive.setScreenDisplacementHeight(dh); *************** *** 177,196 **** } ! private void doPlaceInBucket(Primitive primitive, int curColumn, int curRow, boolean check) { ! Bounds2f bounds= primitive.getRasterBounds(); if (!bounds.intersects(rasterWindow)) return; ! float minX= bounds.getMinX() - rasterWindow.getMinX(); ! float minY= bounds.getMinY() - rasterWindow.getMinY(); ! int column= Calc.clamp((int) (minX / bucketWidth), 0, bucketColumns - 1); ! int row= Calc.clamp((int) (minY / bucketHeight), 0, bucketRows - 1); if (check && row <= curRow) { ! float maxY= bounds.getMaxY() - rasterWindow.getMinY(); ! int maxRow= Calc.clamp((int)Math.ceil(maxY / bucketHeight), 0, bucketRows - 1); if (maxRow < curRow) return; ! row= curRow; ! 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); --- 197,221 ---- } ! private void doPlaceInBucket( ! Primitive primitive, ! int curColumn, ! int curRow, ! boolean check) { ! Bounds2f bounds = primitive.getRasterBounds(); if (!bounds.intersects(rasterWindow)) return; ! float minX = bounds.getMinX() - rasterWindow.getMinX(); ! float minY = bounds.getMinY() - rasterWindow.getMinY(); ! int column = Calc.clamp((int) (minX / bucketWidth), 0, bucketColumns - 1); ! int row = Calc.clamp((int) (minY / bucketHeight), 0, bucketRows - 1); if (check && row <= curRow) { ! float maxY = bounds.getMaxY() - rasterWindow.getMinY(); ! int maxRow = Calc.clamp((int) Math.ceil(maxY / bucketHeight), 0, bucketRows - 1); if (maxRow < curRow) return; ! row = curRow; ! 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); *************** *** 211,224 **** if (mp.getMaxX() < rasterWindowMin.x || mp.getMaxY() < rasterWindowMin.y) return; ! float mpMinX= mp.getMinX() - rasterWindowMin.x; ! float mpMinY= mp.getMinY() - rasterWindowMin.y; ! float mpMaxX= mp.getMaxX() - rasterWindowMin.x; ! float mpMaxY= mp.getMaxY() - rasterWindowMin.y; ! int minColumn= (int) (mpMinX / bucketWidth); ! int minRow= (int) (mpMinY / bucketHeight); ! int maxColumn= (int) (mpMaxX / bucketWidth); ! int maxRow= (int) (mpMaxY / bucketHeight); ! for (int col= minColumn; col <= maxColumn; col++) ! for (int row= minRow; row <= maxRow; row++) if (col >= 0 && col < bucketColumns && row >= 0 && row < bucketRows) getBucket(col, row).addMicropolygon(mp); --- 236,249 ---- if (mp.getMaxX() < rasterWindowMin.x || mp.getMaxY() < rasterWindowMin.y) return; ! float mpMinX = mp.getMinX() - rasterWindowMin.x; ! float mpMinY = mp.getMinY() - rasterWindowMin.y; ! float mpMaxX = mp.getMaxX() - rasterWindowMin.x; ! float mpMaxY = mp.getMaxY() - rasterWindowMin.y; ! int minColumn = (int) (mpMinX / bucketWidth); ! int minRow = (int) (mpMinY / bucketHeight); ! int maxColumn = (int) (mpMaxX / bucketWidth); ! int maxRow = (int) (mpMaxY / bucketHeight); ! for (int col = minColumn; col <= maxColumn; col++) ! for (int row = minRow; row <= maxRow; row++) if (col >= 0 && col < bucketColumns && row >= 0 && row < bucketRows) getBucket(col, row).addMicropolygon(mp); *************** *** 230,277 **** public void render() { ! worldParseEnd= System.currentTimeMillis(); ! Display.Mode displayMode= frame.getDisplay().getMode(); ! Display.Type displayType= frame.getDisplay().getType(); ! ImageStore imageStore= new ImageStore(frame.getHorizontalResolution(), frame.getVerticalResolution(), frame.getDisplay()); ! ZStore zStore= null; if (displayMode == Display.Mode.Z) { ! zStore= new ZStore(frame.getHorizontalResolution(), frame.getVerticalResolution()); ShadowMap.flushShadowMap(frame.getDisplay().getName()); } ! Framebuffer fb= null; if (displayType == Display.Type.FRAMEBUFFER || frame.isFramebufferAlways()) { ! fb= new Framebuffer(frame.getDisplay().getName(), imageStore.getImage()); fb.setVisible(true); } ! int gridSize= frame.getGridSize(); ! ShaderVariables shaderVariables= new ShaderVariables(worldToCamera.getInverse()); ! int gridCount= 0; ! Sampler sampler= new Sampler(bucketWidth, bucketHeight, frame.getHorizontalSamplingRate(), frame.getVerticalSamplingRate()); ! 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()) * 3]; ! float[] filteredSamples= new float[bucketWidth * bucketHeight * 3]; ! int[] pixels= new int[bucketWidth * bucketHeight]; ! float[] depths= new float[bucketWidth * bucketHeight]; ! long start= System.currentTimeMillis(); ! Point2f rmin= rasterWindow.getMin(); ! int percentComplete= -1; ! for (int row= 0; row < bucketRows; row++) { ! for (int column= 0; column < bucketColumns; column++) { ! Bucket bucket= getBucket(column, row); prefetchNextBucket(column, row); ! float samplerX= rmin.x + bucketWidth * column; ! float samplerY= rmin.y + bucketHeight * row; sampler.init(samplerX, samplerY); while (bucket.hasMorePrimitives()) { primitivePatchCount++; ! Primitive p= bucket.getNextPrimitive(); if (isPrimitiveVisible(p, sampler)) { if (p.isReadyToBeDiced(gridSize)) { gridCount++; p.dice(shaderVariables); ! Attributes attr= p.getAttributes(); ! DisplacementShader ds= attr.getDisplacement(); if (ds != null) ds.shade(shaderVariables); --- 255,320 ---- public void render() { ! worldParseEnd = System.currentTimeMillis(); ! Display.Mode displayMode = frame.getDisplay().getMode(); ! Display.Type displayType = frame.getDisplay().getType(); ! ImageStore imageStore = ! new ImageStore( ! frame.getHorizontalResolution(), ! frame.getVerticalResolution(), ! frame.getDisplay()); ! ZStore zStore = null; if (displayMode == Display.Mode.Z) { ! zStore = ! new ZStore(frame.getHorizontalResolution(), frame.getVerticalResolution()); ShadowMap.flushShadowMap(frame.getDisplay().getName()); } ! Framebuffer fb = null; if (displayType == Display.Type.FRAMEBUFFER || frame.isFramebufferAlways()) { ! fb = new Framebuffer(frame.getDisplay().getName(), imageStore.getImage()); fb.setVisible(true); } ! int gridSize = frame.getGridSize(); ! ShaderVariables shaderVariables = new ShaderVariables(worldToCamera.getInverse()); ! int gridCount = 0; ! Sampler sampler = ! new Sampler( ! bucketWidth, ! bucketHeight, ! frame.getHorizontalSamplingRate(), ! frame.getVerticalSamplingRate()); ! 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()) ! * 3]; ! float[] filteredSamples = new float[bucketWidth * bucketHeight * 3]; ! int[] pixels = new int[bucketWidth * bucketHeight]; ! float[] depths = new float[bucketWidth * bucketHeight]; ! long start = System.currentTimeMillis(); ! Point2f rmin = rasterWindow.getMin(); ! int percentComplete = -1; ! for (int row = 0; row < bucketRows; row++) { ! for (int column = 0; column < bucketColumns; column++) { ! Bucket bucket = getBucket(column, row); prefetchNextBucket(column, row); ! float samplerX = rmin.x + bucketWidth * column; ! float samplerY = rmin.y + bucketHeight * row; sampler.init(samplerX, samplerY); while (bucket.hasMorePrimitives()) { primitivePatchCount++; ! Primitive p = bucket.getNextPrimitive(); if (isPrimitiveVisible(p, sampler)) { if (p.isReadyToBeDiced(gridSize)) { gridCount++; p.dice(shaderVariables); ! Attributes attr = p.getAttributes(); ! DisplacementShader ds = attr.getDisplacement(); if (ds != null) ds.shade(shaderVariables); *************** *** 280,301 **** else shaderVariables.I.set(ORTHO_I); ! SurfaceShader surface= attr.getSurface(); if (surface == null) ! surface= SurfaceShader.createShader("fakedlight", new ParameterList(), attr); surface.shade(shaderVariables); ! VolumeShader vs= attr.getAtmosphere(); if (vs != null) ! vs.shade(shaderVariables, frame.getNearClipping(), frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); sampler.sampleBucket(bucket, bucket.hasMorePrimitives()); ! } ! else { ! Primitive[] sub= p.split(); ! for (int i= 0; i < sub.length; i++) internalAddPrimitive(sub[i], column, row, true); } ! } ! else { placeInNextBucket(p, column, row); invisiblePatchCount++; --- 323,349 ---- else shaderVariables.I.set(ORTHO_I); ! SurfaceShader surface = attr.getSurface(); if (surface == null) ! surface = ! SurfaceShader.createShader( ! "fakedlight", ! new ParameterList(), ! attr); surface.shade(shaderVariables); ! VolumeShader vs = attr.getAtmosphere(); if (vs != null) ! vs.shade( ! shaderVariables, ! frame.getNearClipping(), ! frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); sampler.sampleBucket(bucket, bucket.hasMorePrimitives()); ! } else { ! Primitive[] sub = p.split(); ! for (int i = 0; i < sub.length; i++) internalAddPrimitive(sub[i], column, row, true); } ! } else { placeInNextBucket(p, column, row); invisiblePatchCount++; *************** *** 306,330 **** bucket.flush(); 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()) * 3, bucketColumns * sampler.getWidth(), 3, 0); ! samplesFilter.doFilter(samples, (column * sampler.getWidth() - (column == 0 ? 0 : (hFilterExtra + hPixelLess * sampler.getPixelWidth()))) * 3, bucketColumns * sampler.getWidth(), filteredSamples, 0, bucketWidth, bucketWidth - (column == 0 ? hPixelLess : 0), bucketHeight - (row == 0 ? vPixelLess : 0), sampler.getPixelWidth(), sampler.getPixelHeight(), 3); 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), bucketHeight - (row == 0 ? vPixelLess : 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()) { ! int percent= (row * bucketColumns + column + 1) * 100 / buckets.length; if (percent > percentComplete) { ! percentComplete= percent; ! System.out.print("\r" + frame.getDisplay().getName() + " (frame " + frame.getFrameNumber() + "): " + percentComplete + "% complete"); } } } ! System.arraycopy(samples, (bucketHeight * sampler.getPixelHeight() - (row == 0 ? (vFilterExtra + vPixelLess * sampler.getPixelHeight()) : 0)) * bucketColumns * sampler.getWidth() * 3, samples, 0, (vFilterExtra + vPixelLess * sampler.getPixelHeight()) * bucketColumns * sampler.getWidth() * 3); } if (frame.isShowProgressEnabled()) --- 354,439 ---- bucket.flush(); 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()) ! * 3, ! bucketColumns * sampler.getWidth(), ! 3, ! 0); ! samplesFilter.doFilter( ! samples, ! (column * sampler.getWidth() ! - (column == 0 ! ? 0 ! : (hFilterExtra + hPixelLess * sampler.getPixelWidth()))) ! * 3, ! bucketColumns * sampler.getWidth(), ! filteredSamples, ! 0, ! bucketWidth, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0), ! sampler.getPixelWidth(), ! sampler.getPixelHeight(), ! 3); 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), ! bucketHeight - (row == 0 ? vPixelLess : 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()) { ! int percent = (row * bucketColumns + column + 1) * 100 / buckets.length; if (percent > percentComplete) { ! percentComplete = percent; ! System.out.print( ! "\r" ! + frame.getDisplay().getName() ! + " (frame " ! + frame.getFrameNumber() ! + "): " ! + percentComplete ! + "% complete"); } } } ! System.arraycopy( ! samples, ! (bucketHeight * sampler.getPixelHeight() ! - (row == 0 ? (vFilterExtra + vPixelLess * sampler.getPixelHeight()) : 0)) ! * bucketColumns ! * sampler.getWidth() ! * 3, ! samples, ! 0, ! (vFilterExtra + vPixelLess * sampler.getPixelHeight()) ! * bucketColumns ! * sampler.getWidth() ! * 3); } if (frame.isShowProgressEnabled()) *************** *** 335,378 **** try { if (displayMode == Display.Mode.RGB || displayMode == Display.Mode.RGBA) { ! String name= frame.getDisplay().getName(); ! String ext= name.substring(name.lastIndexOf('.') + 1); ! File file= new File(frame.getDisplay().getName()); ImageIO.write(imageStore.getImage(), ext, file); ! } ! 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); } ! for (int i= 0; i < buckets.length; i++) { if (buckets[i].hasMorePrimitives()) System.out.println("More primitives: " + i); } ! long end= System.currentTimeMillis(); ! float time= (end - start) / 1000f; if (frame.endOfFrameStatisticsEnabled()) { System.out.println("*** Frame Statistics ***"); ! System.out.println("World parse time: " + Format.time(worldParseEnd - worldParseStart)); System.out.println("Total patches: " + primitivePatchCount); System.out.println("Patches/second: " + primitivePatchCount / time); System.out.println("Invisible patches: " + invisiblePatchCount); ! System.out.println("Patches culled: " + invisiblePatchCount * 100f / primitivePatchCount + "%"); System.out.println("Root count: " + Sampler.rootCount); System.out.println("Pixel count: " + Sampler.pixelCount); ! System.out.println("gridCount = " + gridCount + " in " + time + " seconds\n" + gridCount / time + "grids/second"); System.out.println("Total micropolygons: " + Micropolygon.count); System.out.println("Micropolygons/second: " + Micropolygon.count / time); System.out.println("Bucket samples: " + Sampler.bucketSamplesCount); ! System.out.println("Modified bucket samples: " + Sampler.modifiedSampleBucketsCount); System.out.println("---------------------------------------------------"); ! primitivePatchCount= 0; ! invisiblePatchCount= 0; ! Sampler.rootCount= 0; ! Sampler.pixelCount= 0; ! gridCount= 0; ! Micropolygon.count= 0; ! Sampler.bucketSamplesCount= 0; ! Sampler.modifiedSampleBucketsCount= 0; } } --- 444,501 ---- try { if (displayMode == Display.Mode.RGB || displayMode == Display.Mode.RGBA) { ! String name = frame.getDisplay().getName(); ! String ext = name.substring(name.lastIndexOf('.') + 1); ! File file = new File(frame.getDisplay().getName()); ImageIO.write(imageStore.getImage(), ext, file); ! } 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); } ! for (int i = 0; i < buckets.length; i++) { if (buckets[i].hasMorePrimitives()) System.out.println("More primitives: " + i); } ! long end = System.currentTimeMillis(); ! float time = (end - start) / 1000f; if (frame.endOfFrameStatisticsEnabled()) { System.out.println("*** Frame Statistics ***"); ! System.out.println( ! "World parse time: " + Format.time(worldParseEnd - worldParseStart)); System.out.println("Total patches: " + primitivePatchCount); System.out.println("Patches/second: " + primitivePatchCount / time); System.out.println("Invisible patches: " + invisiblePatchCount); ! System.out.println( ! "Patches culled: " + invisiblePatchCount * 100f / primitivePatchCount + "%"); System.out.println("Root count: " + Sampler.rootCount); System.out.println("Pixel count: " + Sampler.pixelCount); ! System.out.println( ! "gridCount = " ! + gridCount ! + " in " ! + time ! + " seconds\n" ! + gridCount / time ! + "grids/second"); System.out.println("Total micropolygons: " + Micropolygon.count); System.out.println("Micropolygons/second: " + Micropolygon.count / time); System.out.println("Bucket samples: " + Sampler.bucketSamplesCount); ! System.out.println( ! "Modified bucket samples: " + Sampler.modifiedSampleBucketsCount); System.out.println("---------------------------------------------------"); ! primitivePatchCount = 0; ! invisiblePatchCount = 0; ! Sampler.rootCount = 0; ! Sampler.pixelCount = 0; ! gridCount = 0; ! Micropolygon.count = 0; ! Sampler.bucketSamplesCount = 0; ! Sampler.modifiedSampleBucketsCount = 0; } } *************** *** 397,496 **** 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) * 3; ! tmp.x= colors[offset++]; ! tmp.y= colors[offset++]; ! tmp.z= 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); ! offset= row * bucketWidth + col; ! result[offset]= ((255 << 24) | (red << 16) | (green << 8) | blue); } } private void createClippingVolume() { ! rasterWindow= createRasterWindow(); ! rasterWindowMin= rasterWindow.getMin(); ! Transform rasterToScreen= Global.getTransform("raster").getInverse(); ! Bounds2f renderingScreenWindow= rasterWindow.transform(rasterToScreen); ! Point2f min= renderingScreenWindow.getMin(); ! Point2f max= renderingScreenWindow.getMax(); ! clippingVolume= new ClippingVolume(); if (frame.getCameraProjection() == CameraProjection.PERSPECTIVE) { ! Point3f origin= new Point3f(); ! Point3f upperLeft= new Point3f(min.x, max.y, 1f); ! Point3f upperRight= new Point3f(max.x, max.y, 1f); ! Point3f lowerLeft= new Point3f(min.x, min.y, 1f); ! Point3f lowerRight= new Point3f(max.x, min.y, 1f); ! 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 { ! Point3f upperLeft= new Point3f(min.x, max.y, 1f); ! Point3f upperRight= new Point3f(max.x, max.y, 1f); ! Point3f lowerLeft= new Point3f(min.x, min.y, 1f); ! Point3f lowerRight= new Point3f(max.x, min.y, 1f); ! Point3f originUpperLeft= new Point3f(min.x, max.y, 0f); ! Point3f originUpperRight= new Point3f(max.x, max.y, 0f); ! Point3f originLowerLeft= new Point3f(min.x, min.y, 0f); ! 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(); ! Point2f min= cropWindow.getMin(); ! Point2f max= cropWindow.getMax(); ! int xResolution= frame.getHorizontalResolution(); ! int yResolution= frame.getVerticalResolution(); ! 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; ! hFilterExtra= (int)Math.ceil(xw * frame.getHorizontalSamplingRate()); ! hPixelLess= (int)Math.ceil((float)hFilterExtra / frame.getHorizontalSamplingRate()); ! float yw= (filter.getVerticalWidth() - 1) / 2f; ! vFilterExtra= (int)Math.ceil(yw * frame.getVerticalSamplingRate()); ! vPixelLess= (int)Math.ceil((float)vFilterExtra / frame.getVerticalSamplingRate()); ! rxmin= (float)Math.floor(rxmin - xw); ! rxmax= (float)Math.ceil(rxmax + xw); ! rymin= (float)Math.floor(rymin - yw); ! rymax= (float)Math.ceil(rymax + yw); return new Bounds2f(rxmin, rxmax, rymin, rymax); } private void createBuckets() { ! Point2f min= rasterWindow.getMin(); ! Point2f max= rasterWindow.getMax(); ! float width= max.x - min.x + 1; ! float height= max.y - min.y + 1; ! bucketWidth= frame.getBucketSizeX(); ! bucketHeight= frame.getBucketSizeY(); ! bucketColumns= (int)Math.ceil(width / bucketWidth); ! bucketRows= (int)Math.ceil(height / bucketHeight); ! buckets= new Bucket[bucketColumns * bucketRows]; if (frame.fileBucketsEnabled()) ! for (int i= 0; i < buckets.length; i++) ! buckets[i]= new FileBucket(i); else { ! for (int i= 0; i < buckets.length; i++) ! buckets[i]= new MemoryBucket(); } } --- 520,633 ---- 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) * 3; ! tmp.x = colors[offset++]; ! tmp.y = colors[offset++]; ! tmp.z = 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); ! offset = row * bucketWidth + col; ! result[offset] = ((255 << 24) | (red << 16) | (green << 8) | blue); } } private void createClippingVolume() { ! rasterWindow = createRasterWindow(); ! rasterWindowMin = rasterWindow.getMin(); ! Transform rasterToScreen = Global.getTransform("raster").getInverse(); ! Bounds2f renderingScreenWindow = rasterWindow.transform(rasterToScreen); ! Point2f min = renderingScreenWindow.getMin(); ! Point2f max = renderingScreenWindow.getMax(); ! clippingVolume = new ClippingVolume(); if (frame.getCameraProjection() == CameraProjection.PERSPECTIVE) { ! Point3f origin = new Point3f(); ! Point3f upperLeft = new Point3f(min.x, max.y, 1f); ! Point3f upperRight = new Point3f(max.x, max.y, 1f); ! Point3f lowerLeft = new Point3f(min.x, min.y, 1f); ! Point3f lowerRight = new Point3f(max.x, min.y, 1f); ! 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 { + Point3f upperLeft = new Point3f(min.x, max.y, 1f); + Point3f upperRight = new Point3f(max.x, max.y, 1f); + Point3f lowerLeft = new Point3f(min.x, min.y, 1f); + Point3f lowerRight = new Point3f(max.x, min.y, 1f); + Point3f originUpperLeft = new Point3f(min.x, max.y, 0f); + Point3f originUpperRight = new Point3f(max.x, max.y, 0f); + Point3f originLowerLeft = new Point3f(min.x, min.y, 0f); + 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(); ! Point2f min = cropWindow.getMin(); ! Point2f max = cropWindow.getMax(); ! int xResolution = frame.getHorizontalResolution(); ! int yResolution = frame.getVerticalResolution(); ! 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; ! hFilterExtra = (int) Math.ceil(xw * frame.getHorizontalSamplingRate()); ! hPixelLess = (int) Math.ceil((float) hFilterExtra / frame.getHorizontalSamplingRate()); ! float yw = (filter.getVerticalWidth() - 1) / 2f; ! vFilterExtra = (int) Math.ceil(yw * frame.getVerticalSamplingRate()); ! vPixelLess = (int) Math.ceil((float) vFilterExtra / frame.getVerticalSamplingRate()); ! rxmin = (float) Math.floor(rxmin - xw); ! rxmax = (float) Math.ceil(rxmax + xw); ! rymin = (float) Math.floor(rymin - yw); ! rymax = (float) Math.ceil(rymax + yw); return new Bounds2f(rxmin, rxmax, rymin, rymax); } private void createBuckets() { ! Point2f min = rasterWindow.getMin(); ! Point2f max = rasterWindow.getMax(); ! float width = max.x - min.x + 1; ! float height = max.y - min.y + 1; ! bucketWidth = frame.getBucketSizeX(); ! bucketHeight = frame.getBucketSizeY(); ! bucketColumns = (int) Math.ceil(width / bucketWidth); ! bucketRows = (int) Math.ceil(height / bucketHeight); ! buckets = new Bucket[bucketColumns * bucketRows]; if (frame.fileBucketsEnabled()) ! for (int i = 0; i < buckets.length; i++) ! buckets[i] = new FileBucket(i); else { ! for (int i = 0; i < buckets.length; i++) ! buckets[i] = new MemoryBucket(); } } |
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1:/tmp/cvs-serv5887/src/org/jrman/parameters Modified Files: VaryingArrayFloat.java UniformArrayHPoint.java UniformArrayTuple3f.java VaryingArrayHPoint.java VaryingScalarTuple3f.java Declaration.java UniformArrayString.java VaryingArrayTuple3f.java VaryingScalarHPoint.java VaryingScalarFloat.java UniformArrayFloat.java UniformArrayInteger.java Log Message: More performance optimizations. Index: VaryingArrayFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayFloat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VaryingArrayFloat.java 9 Dec 2003 04:51:52 -0000 1.2 --- VaryingArrayFloat.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 1,4 **** /* ! UniformScalarFloat.java Copyright (C) 2003 Gerardo Horvilleur Martinez --- 1,4 ---- /* ! VaryingFloat.java Copyright (C) 2003 Gerardo Horvilleur Martinez *************** *** 26,31 **** public VaryingArrayFloat(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 26,30 ---- public VaryingArrayFloat(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: UniformArrayHPoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayHPoint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniformArrayHPoint.java 9 Dec 2003 04:51:52 -0000 1.2 --- UniformArrayHPoint.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 28,33 **** public UniformArrayHPoint(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 28,32 ---- public UniformArrayHPoint(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: UniformArrayTuple3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayTuple3f.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniformArrayTuple3f.java 9 Dec 2003 04:51:52 -0000 1.2 --- UniformArrayTuple3f.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 28,33 **** public UniformArrayTuple3f(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 28,32 ---- public UniformArrayTuple3f(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: VaryingArrayHPoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayHPoint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VaryingArrayHPoint.java 9 Dec 2003 04:51:52 -0000 1.2 --- VaryingArrayHPoint.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 1,4 **** /* ! UniformScalarHPoint.java Copyright (C) 2003 Gerardo Horvilleur Martinez --- 1,4 ---- /* ! VaryingArrayHPoint.java Copyright (C) 2003 Gerardo Horvilleur Martinez *************** *** 28,33 **** public VaryingArrayHPoint(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 28,32 ---- public VaryingArrayHPoint(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: VaryingScalarTuple3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarTuple3f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VaryingScalarTuple3f.java 9 Dec 2003 04:51:52 -0000 1.3 --- VaryingScalarTuple3f.java 14 Dec 2003 22:28:28 -0000 1.4 *************** *** 28,33 **** public VaryingScalarTuple3f(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 28,32 ---- public VaryingScalarTuple3f(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: Declaration.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/Declaration.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Declaration.java 9 Dec 2003 04:51:52 -0000 1.3 --- Declaration.java 14 Dec 2003 22:28:28 -0000 1.4 *************** *** 23,35 **** import java.io.StringReader; import java.util.HashMap; - import java.util.List; import java.util.Map; - import javax.vecmath.Color3f; - import javax.vecmath.Matrix4f; - import javax.vecmath.Point3f; - import javax.vecmath.Point4f; - import javax.vecmath.Vector3f; - public class Declaration { --- 23,28 ---- *************** *** 302,458 **** } throw new IllegalArgumentException("Unknown type"); - } - - public Object translateArray(List array) { - Object result = null; - if (type == Type.FLOAT) - result = toFloatArray(array); - else if (type == Type.INTEGER) - result = toIntegerArray(array); - else if (type == Type.STRING) - result = toStringArray(array); - else if (type == Type.COLOR) - result = toColorArray(array); - else if (type == Type.POINT) - result = toPointArray(array); - else if (type == Type.VECTOR) - result = toVectorArray(array); - else if (type == Type.NORMAL) - result = toVectorArray(array); - else if (type == Type.MATRIX) - result = toMatrixArray(array); - else if (type == Type.HPOINT) - result = toHPointArray(array); - return result; - } - - private Object toFloatArray(List array) { - float[][] result = new float[array.size() / count][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - float[] element = new float[count]; - for (int j = 0; j < count; j++) - element[j] = ((Float) array.get(ptr++)).floatValue(); - result[i] = element; - } - return result; - } - - private Object toIntegerArray(List array) { - int[][] result = new int[array.size() / count][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - int[] element = new int[count]; - for (int j = 0; j < count; j++) - element[j] = ((Float) array.get(ptr++)).intValue(); - result[i] = element; - } - return result; - } - - private Object toStringArray(List array) { - String[][] result = new String[array.size() / count][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - String[] element = new String[count]; - for (int j = 0; j < count; j++) - element[j] = (String) array.get(ptr++); - result[i] = element; - } - return result; - } - - private Object toColorArray(List array) { - Color3f[][] result = new Color3f[array.size() / (count * 3)][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - Color3f[] element = new Color3f[count]; - for (int j = 0; j < count; j++) { - float red = ((Float) array.get(ptr++)).floatValue(); - float green = ((Float) array.get(ptr++)).floatValue(); - float blue = ((Float) array.get(ptr++)).floatValue(); - element[j] = new Color3f(red, green, blue); - } - result[i] = element; - } - return result; - } - - private Object toPointArray(List array) { - Point3f[][] result = new Point3f[array.size() / (count * 3)][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - Point3f[] element = new Point3f[count]; - for (int j = 0; j < count; j++) { - float x = ((Float) array.get(ptr++)).floatValue(); - float y = ((Float) array.get(ptr++)).floatValue(); - float z = ((Float) array.get(ptr++)).floatValue(); - element[j] = new Point3f(x, y, z); - } - result[i] = element; - } - return result; - } - - private Object toVectorArray(List array) { - Vector3f[][] result = new Vector3f[array.size() / (count * 3)][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - Vector3f[] element = new Vector3f[count]; - for (int j = 0; j < count; j++) { - float x = ((Float) array.get(ptr++)).floatValue(); - float y = ((Float) array.get(ptr++)).floatValue(); - float z = ((Float) array.get(ptr++)).floatValue(); - element[j] = new Vector3f(x, y, z); - } - result[i] = element; - } - return result; - } - - private Object toMatrixArray(List array) { - Matrix4f[][] result = new Matrix4f[array.size() / (count * 16)][]; - int ptr = 0; - for (int ii = 0; ii < result.length; ii++) { - Matrix4f[] element = new Matrix4f[count]; - for (int jj = 0; jj < count; jj++) { - float a = ((Float) array.get(ptr++)).floatValue(); - float b = ((Float) array.get(ptr++)).floatValue(); - float c = ((Float) array.get(ptr++)).floatValue(); - float d = ((Float) array.get(ptr++)).floatValue(); - float e = ((Float) array.get(ptr++)).floatValue(); - float f = ((Float) array.get(ptr++)).floatValue(); - float g = ((Float) array.get(ptr++)).floatValue(); - float h = ((Float) array.get(ptr++)).floatValue(); - float i = ((Float) array.get(ptr++)).floatValue(); - float j = ((Float) array.get(ptr++)).floatValue(); - float k = ((Float) array.get(ptr++)).floatValue(); - float l = ((Float) array.get(ptr++)).floatValue(); - float m = ((Float) array.get(ptr++)).floatValue(); - float n = ((Float) array.get(ptr++)).floatValue(); - float o = ((Float) array.get(ptr++)).floatValue(); - float p = ((Float) array.get(ptr++)).floatValue(); - element[jj] = new Matrix4f(a, e, i, m, b, f, j, n, c, g, k, o, d, h, l, p); - } - result[ii] = element; - } - return result; - } - - private Object toHPointArray(List array) { - Point4f[][] result = new Point4f[array.size() / (count * 4)][]; - int ptr = 0; - for (int i = 0; i < result.length; i++) { - Point4f[] element = new Point4f[count]; - for (int j = 0; j < count; j++) { - float x = ((Float) array.get(ptr++)).floatValue(); - float y = ((Float) array.get(ptr++)).floatValue(); - float z = ((Float) array.get(ptr++)).floatValue(); - float w = ((Float) array.get(ptr++)).floatValue(); - element[j] = new Point4f(x, y, z, w); - } - result[i] = element; - } - return result; } --- 295,298 ---- Index: UniformArrayString.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayString.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniformArrayString.java 9 Dec 2003 04:51:52 -0000 1.2 --- UniformArrayString.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 26,31 **** public UniformArrayString(Declaration declaration, String[] values) { super(declaration); ! this.values = new String[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 26,30 ---- public UniformArrayString(Declaration declaration, String[] values) { super(declaration); ! this.values = values; } Index: VaryingArrayTuple3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayTuple3f.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VaryingArrayTuple3f.java 9 Dec 2003 04:51:52 -0000 1.2 --- VaryingArrayTuple3f.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 1,4 **** /* ! UniformScalarTuple3f.java Copyright (C) 2003 Gerardo Horvilleur Martinez --- 1,4 ---- /* ! VaryingArrayTuple3f.java Copyright (C) 2003 Gerardo Horvilleur Martinez *************** *** 28,33 **** public VaryingArrayTuple3f(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 28,32 ---- public VaryingArrayTuple3f(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: VaryingScalarHPoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarHPoint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VaryingScalarHPoint.java 9 Dec 2003 04:51:52 -0000 1.2 --- VaryingScalarHPoint.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 28,33 **** public VaryingScalarHPoint(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 28,32 ---- public VaryingScalarHPoint(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: VaryingScalarFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarFloat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VaryingScalarFloat.java 9 Dec 2003 04:51:52 -0000 1.2 --- VaryingScalarFloat.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 26,31 **** public VaryingScalarFloat(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 26,30 ---- public VaryingScalarFloat(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: UniformArrayFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayFloat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniformArrayFloat.java 9 Dec 2003 04:51:52 -0000 1.2 --- UniformArrayFloat.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 26,31 **** public UniformArrayFloat(Declaration declaration, float[] values) { super(declaration); ! this.values = new float[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 26,30 ---- public UniformArrayFloat(Declaration declaration, float[] values) { super(declaration); ! this.values = values; } Index: UniformArrayInteger.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayInteger.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniformArrayInteger.java 9 Dec 2003 04:51:52 -0000 1.2 --- UniformArrayInteger.java 14 Dec 2003 22:28:28 -0000 1.3 *************** *** 26,31 **** public UniformArrayInteger(Declaration declaration, int[] values) { super(declaration); ! this.values = new int[values.length]; ! System.arraycopy(values, 0, this.values, 0, values.length); } --- 26,30 ---- public UniformArrayInteger(Declaration declaration, int[] values) { super(declaration); ! this.values = values; } |
From: <ma...@us...> - 2003-12-14 22:28:32
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv5887/src/org/jrman/grid Modified Files: FloatGrid.java Log Message: More performance optimizations. Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** FloatGrid.java 11 Dec 2003 15:08:06 -0000 1.19 --- FloatGrid.java 14 Dec 2003 22:28:29 -0000 1.20 *************** *** 729,733 **** public void floor(FloatGrid f) { for (int i = 0; i < size; i++) ! data[i] = (float) Math.floor(f.data[i]); } --- 729,733 ---- public void floor(FloatGrid f) { for (int i = 0; i < size; i++) ! data[i] = (float) Calc.floor(f.data[i]); } *************** *** 735,739 **** for (int i = 0; i < size; i++) if (cond.data[i]) ! data[i] = (float) Math.floor(f.data[i]); } --- 735,739 ---- for (int i = 0; i < size; i++) if (cond.data[i]) ! data[i] = (float) Calc.floor(f.data[i]); } *************** *** 744,748 **** public void ceil(FloatGrid f) { for (int i = 0; i < size; i++) ! data[i] = (float) Math.ceil(f.data[i]); } --- 744,748 ---- public void ceil(FloatGrid f) { for (int i = 0; i < size; i++) ! data[i] = (float) Calc.ceil(f.data[i]); } *************** *** 750,754 **** for (int i = 0; i < size; i++) if (cond.data[i]) ! data[i] = (float) Math.ceil(f.data[i]); } --- 750,754 ---- for (int i = 0; i < size; i++) if (cond.data[i]) ! data[i] = (float) Calc.ceil(f.data[i]); } |
From: <ma...@us...> - 2003-12-14 22:28:32
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv5887/src/org/jrman/geom Modified Files: Bounds3f.java Log Message: More performance optimizations. Index: Bounds3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds3f.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Bounds3f.java 30 Nov 2003 03:23:16 -0000 1.14 --- Bounds3f.java 14 Dec 2003 22:28:29 -0000 1.15 *************** *** 118,121 **** --- 118,122 ---- public BoundingVolume transform(Transform transform) { + /* MutableBounds3f mb = new MutableBounds3f(); p.set(minX, minY, minZ); *************** *** 144,148 **** mb.addPoint(p); return mb; ! /* ConvexHull3f c = new ConvexHull3f(); c.addPoint(minX, minY, minZ); --- 145,149 ---- mb.addPoint(p); return mb; ! */ ConvexHull3f c = new ConvexHull3f(); c.addPoint(minX, minY, minZ); *************** *** 155,159 **** c.addPoint(maxX, maxY, maxZ); return c.transform(transform); - */ } --- 156,159 ---- |
From: <ma...@us...> - 2003-12-14 22:28:32
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv5887/sampleData Modified Files: TextureTest.rib Log Message: More performance optimizations. Index: TextureTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/TextureTest.rib,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TextureTest.rib 25 Jul 2003 07:56:33 -0000 1.8 --- TextureTest.rib 14 Dec 2003 22:28:28 -0000 1.9 *************** *** 14,18 **** MakeTexture "checkerboard.png" "checkerboard.txr" "periodic" "periodic" "gaussian" 2 2 MakeTexture "mandrill.jpg" "mandrill.txr" "periodic" "periodic" "gaussian" 2 2 ! Format 2000 1500 1 Display "TextureTest" "framebuffer" "rgba" PixelSamples 4 4 --- 14,18 ---- MakeTexture "checkerboard.png" "checkerboard.txr" "periodic" "periodic" "gaussian" 2 2 MakeTexture "mandrill.jpg" "mandrill.txr" "periodic" "periodic" "gaussian" 2 2 ! Format 512 384 1 Display "TextureTest" "framebuffer" "rgba" PixelSamples 4 4 |
From: <ma...@us...> - 2003-12-14 22:28:32
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv5887/src/org/jrman/util Modified Files: Calc.java PerlinNoise.java Log Message: More performance optimizations. Index: Calc.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Calc.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Calc.java 30 Nov 2003 03:23:16 -0000 1.12 --- Calc.java 14 Dec 2003 22:28:28 -0000 1.13 *************** *** 55,58 **** --- 55,66 ---- return (float) (Math.log(x) / Math.log(base)); } + + public static int floor(float x) { + return (int) x - ((x < 0 && x != (int) x) ? 1 : 0); + } + + public static int ceil(float x) { + return (int) x + ((x > 0 && x != (int) x) ? 1 : 0); + } public static float sign(float x) { Index: PerlinNoise.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/PerlinNoise.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PerlinNoise.java 11 Dec 2003 15:25:24 -0000 1.1 --- PerlinNoise.java 14 Dec 2003 22:28:28 -0000 1.2 *************** *** 1,547 **** ! /* ! PerlinNoise.java Copyright (C) 2003 Alessandro Falappa ! ! 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 [...1065 lines suppressed...] ! // //s=PerlinNoise.noise2d(x+s,y+s); ! // //s=PerlinNoise.noise1d(s); ! // //s=PerlinNoise.noise1d(x+s); ! // if (s < min) ! // min= s; ! // else if (s > max) ! // max= s; ! // int col= Color.getHSBColor(0.f, 0.f, 0.5f*s+0.5f).getRGB(); ! // image.setRGB(i, j, col); ! // } ! // System.out.println("millis " + (System.currentTimeMillis() - time)); ! // System.out.println("min=" + min + " max=" + max); ! // JFrame frame= new JFrame("noise"); ! // JLabel label= new JLabel(new ImageIcon(image)); ! // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ! // frame.getContentPane().add(label); ! // frame.pack(); ! // frame.setVisible(true); ! // } ! } |
From: <ma...@us...> - 2003-12-14 22:28:31
|
Update of /cvsroot/jrman/drafts/src/org/jrman/maps In directory sc8-pr-cvs1:/tmp/cvs-serv5887/src/org/jrman/maps Modified Files: MipMap.java Log Message: More performance optimizations. Index: MipMap.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/maps/MipMap.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MipMap.java 31 Oct 2003 03:03:15 -0000 1.4 --- MipMap.java 14 Dec 2003 22:28:28 -0000 1.5 *************** *** 179,184 **** } SamplesFilter samplesFilter = filter.getSamplesFilter(); ! int width = (int) Math.ceil(filter.getHorizontalWidth() * 2); ! int height = (int) Math.ceil(filter.getVerticalWidth() * 2); samplesFilter.init( width, --- 179,184 ---- } SamplesFilter samplesFilter = filter.getSamplesFilter(); ! int width = Calc.ceil(filter.getHorizontalWidth() * 2); ! int height = Calc.ceil(filter.getVerticalWidth() * 2); samplesFilter.init( width, *************** *** 294,301 **** int levelSize = levelSizes[level]; float rs = s * levelSize; ! int is = (int) Math.floor(rs); rs -= is; float rt = t * levelSize; ! int it = (int) Math.floor(rt); rt -= it; getData(is, it, level, levelSize, d00); --- 294,301 ---- int levelSize = levelSizes[level]; float rs = s * levelSize; ! int is = Calc.floor(rs); rs -= is; float rt = t * levelSize; ! int it = Calc.floor(rt); rt -= it; getData(is, it, level, levelSize, d00); *************** *** 321,325 **** float d = (float) Math.sqrt(area); d = Math.min(d, 1f); ! int id = (int) Math.floor(size * d); boolean singleLevel = (id == 0 || id == size); int level = 0; --- 321,325 ---- float d = (float) Math.sqrt(area); d = Math.min(d, 1f); ! int id = Calc.floor(size * d); boolean singleLevel = (id == 0 || id == size); int level = 0; |
From: <ma...@us...> - 2003-12-14 17:49:31
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv15688/sampleData Modified Files: noiseShadersTest.rib Log Message: Fixed. Index: noiseShadersTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/noiseShadersTest.rib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** noiseShadersTest.rib 12 Dec 2003 23:50:19 -0000 1.3 --- noiseShadersTest.rib 14 Dec 2003 17:49:28 -0000 1.4 *************** *** 1,79 **** ! Format 512 512 1 ! Display "shaderTest" "framebuffer" "rgba" ! PixelSamples 4 4 ! PixelFilter "gaussian" 2 2 ! Exposure 1 2.2 ! Projection "perspective" "fov" 10 ! Translate 0 0 40 ! WorldBegin ! LightSource "distantlight" 1 "from" [1 1 -1] "to" [0 0 0] "intensity" 1 ! LightSource "ambientlight" 2 "intensity" 0.05 ! AttributeBegin ! Translate -2.2 2.2 0 ! Surface "noisetest" "uniform float noisescale" 4 "uniform integer noiseoctaves" 1 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 0 2.2 0 ! Surface "noisetest" "uniform float noisescale" 2 "uniform integer noiseoctaves" 5 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 2.2 2.2 0 ! Surface "turbulence" "uniform float noisescale" 2 "uniform integer noiseoctaves" 5 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate -2.2 0 0 ! Surface "matte" ! Displacement "noisetest" "uniform float noisescale" 2 "uniform integer noiseoctaves" 4 "uniform float Km" 0.3 ! Attribute "displacementbound" "sphere" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Surface "matte" ! Displacement "dented" "uniform float noisescale" 2 "uniform integer noiseoctaves" 6 "uniform float Km" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 2.2 0 0 ! Surface "matte" ! Displacement "turbulence" "uniform float noisescale" 2 "uniform integer noiseoctaves" 4 "uniform float Km" 0.3 ! Attribute "displacementbound" "sphere" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate -2.2 -2.2 0 ! Surface "randomcheckers" "uniform float noisescale" 10 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 0 -2.2 0 ! Surface "confetti" "uniform float noisescale" 4 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 2.2 -2.2 0 ! Surface "confetti" "uniform float noisescale" 4 ! Displacement "dented" "uniform float noisescale" 3 "uniform integer noiseoctaves" 4 "uniform float Km" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! WorldEnd --- 1,79 ---- ! Format 512 512 1 ! Display "shaderTest" "framebuffer" "rgba" ! PixelSamples 4 4 ! PixelFilter "gaussian" 2 2 ! Exposure 1 2.2 ! Projection "perspective" "fov" 10 ! Translate 0 0 40 ! WorldBegin ! LightSource "distantlight" 1 "from" [1 1 -1] "to" [0 0 0] "intensity" 1 ! LightSource "ambientlight" 2 "intensity" 0.05 ! AttributeBegin ! Translate -2.2 2.2 0 ! Surface "noisetest" "uniform float noisescale" 4 "uniform integer noiseoctaves" 1 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 0 2.2 0 ! Surface "noisetest" "uniform float noisescale" 2 "uniform integer noiseoctaves" 5 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 2.2 2.2 0 ! Surface "turbulence" "uniform float noisescale" 2 "uniform integer noiseoctaves" 5 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate -2.2 0 0 ! Surface "matte" ! Displacement "noisetest" "uniform float noisescale" 2 "uniform integer noiseoctaves" 4 "uniform float Km" 0.3 ! Attribute "displacementbound" "sphere" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Surface "matte" ! Displacement "dented" "uniform float noisescale" 2 "uniform integer noiseoctaves" 6 "uniform float Km" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 2.2 0 0 ! Surface "matte" ! Displacement "turbulence" "uniform float noisescale" 2 "uniform integer noiseoctaves" 4 "uniform float Km" 0.3 ! Attribute "displacementbound" "sphere" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate -2.2 -2.2 0 ! Surface "randomcheckers" "uniform float noisescale" 10 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 0 -2.2 0 ! Surface "confetti" "uniform float noisescale" 4 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! AttributeBegin ! Translate 2.2 -2.2 0 ! Surface "confetti" "uniform float noisescale" 4 ! Displacement "dented" "uniform float noisescale" 3 "uniform integer noiseoctaves" 4 "uniform float Km" 0.3 ! Color 1 1 1 ! Sphere 1 -1 1 360 ! AttributeEnd ! ! WorldEnd |