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: <edi...@us...> - 2003-09-11 21:53:51
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv10106/src/org/jrman/parser/keywords Modified Files: KeywordPointsPolygons.java KeywordPolygon.java Log Message: First implementation PointsPoligons, test tetra.rib Index: KeywordPointsPolygons.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPointsPolygons.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordPointsPolygons.java 7 Apr 2003 08:24:23 -0000 1.2 --- KeywordPointsPolygons.java 11 Sep 2003 21:53:47 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- package org.jrman.parser.keywords; + import java.util.List; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 25,36 **** public void parse(Tokenizer st) throws Exception { ! // Expect array ! parseArray(st); ! // Expect array ! parseArray(st); // Expect parameter list ! parseParameterList(st); } --- 28,40 ---- public void parse(Tokenizer st) throws Exception { ! // Expect array nVertices ! List nVertices = parseArray(st); ! // Expect array vertices ! List vertices = parseArray(st); // Expect parameter list ! Map parameterList = parseParameterList(st); ! parser.addPointsPolygon(nVertices, vertices, parameterList); } Index: KeywordPolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPolygon.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** KeywordPolygon.java 30 Aug 2003 07:29:54 -0000 1.4 --- KeywordPolygon.java 11 Sep 2003 21:53:47 -0000 1.5 *************** *** 20,25 **** package org.jrman.parser.keywords; - import java.util.Map; - import org.jrman.parser.Tokenizer; --- 20,23 ---- *************** *** 28,33 **** public void parse(Tokenizer st) throws Exception { // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.addPolygon(parameters); } --- 26,30 ---- public void parse(Tokenizer st) throws Exception { // Expect parameter list ! parser.addPolygon(parseParameterList(st)); } |
From: <edi...@us...> - 2003-09-11 21:53:51
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv10106/sampleData Modified Files: polygon.rib Added Files: tetra.rib mechtoy.rib pointspolygons.rib gears.rib Log Message: First implementation PointsPoligons, test tetra.rib --- NEW FILE: tetra.rib --- # tetra.rib # Author: Scott Iverson <si@SpamSucks_sitexgraphics.com> # Date: 7/19/95 # Display "tetra" "framebuffer" "rgb" Format 380 380 -1 Projection "perspective" "fov" 31 Rotate 0 0 0 1 Rotate -1.6 1 0 0 Rotate 41.6 0 1 0 Translate -24 -7 27 WorldBegin LightSource "ambientlight" 1 "intensity" .3 LightSource "pointlight" 2 "intensity" 700 "from" [15 17 -20] Scale 20 20 20 [...1598 lines suppressed...] TransformEnd TransformBegin Translate 0 0 .433 Scale .5 .5 .5 PointsPolygons [3 3 3 3] [0 1 3 0 2 1 0 3 2 1 2 3] "P" [0 .75 0 .5 0 -.289 0 0 .866 -.5 0 -.289] TransformEnd TransformBegin Translate .25 0 -.1445 Scale .5 .5 .5 PointsPolygons [3 3 3 3] [0 1 3 0 2 1 0 3 2 1 2 3] "P" [0 .75 0 .5 0 -.289 0 0 .866 -.5 0 -.289] TransformEnd TransformBegin Translate -.25 0 -.1445 Scale .5 .5 .5 PointsPolygons [3 3 3 3] [0 1 3 0 2 1 0 3 2 1 2 3] "P" [0 .75 0 .5 0 -.289 0 0 .866 -.5 0 -.289] TransformEnd TransformEnd TransformEnd TransformEnd WorldEnd --- NEW FILE: mechtoy.rib --- # MechToy..rib # Author: Scott Iverson <si@SpamSucks_sitexgraphics.com> # Date: 7/19/95 # # Fixed the sphere calls for the RMR (talrmr@SpamSucks_pacbell.net) # # Animated mechanical toy Declare "u" "float" Declare "v" "float" Projection "perspective" "fov" 26 Format 380 380 -1 PixelSamples 2 2 Rotate 0 0 0 1 Rotate -6.4 1 0 0 Rotate 47 0 1 0 Translate -7 -3 6 [...4641 lines suppressed...] Scale 0.1 1.3200 0.1 PointsPolygons [4 4 4 4 4 4] [0 1 5 4 1 2 6 5 2 3 7 6 3 0 4 7 4 5 6 7 3 2 1 0] "P" [ 1 0 0 0 0 -1 -1 0 0 0 0 1 1 1 0 0 1 -1 -1 1 0 0 1 1 ] TransformEnd ShadingInterpolation "smooth" TransformBegin Translate 0 0.6600 0 Rotate -90 1 0 0 #Attribute "divide" "u" 12 "v" 6 Sphere .18 -.18 .18 360 TransformEnd TransformBegin Translate 0 -0.6600 0 Rotate -90 1 0 0 #Attribute "divide" "u" 12 "v" 6 Sphere .18 -.18 .18 360 TransformEnd TransformEnd AttributeEnd WorldEnd FrameEnd --- NEW FILE: pointspolygons.rib --- Display "PointsPolygon" "framebuffer" "rgba" Format 400 300 1 PixelSamples 4 4 ShadingRate 0.25 Exposure 1 2.5 Projection "perspective" "fov" 65 Translate 0 0 40 WorldBegin LightSource "ambientlight" 1 "intensity" 2 AttributeBegin Color 1 1 1 Patch "bilinear" "P" [-40 -30 0 40 -30 0 -40 30 0 40 30 0] AttributeEnd AttributeBegin Color 0 0 1 Translate 0 -15 0 Polygon "P" [0 0 -5 5 0 -5 0 5 -5] AttributeEnd AttributeBegin Color 0 1 0 Translate -30 -30 0 Polygon "P" [10 10 -2 20 10 -2 10 20 -2] AttributeEnd AttributeBegin Color 0 1 1 Translate 10 -15 0 Polygon "P" [0 0 -2 10 0 -2 10 10 -2 0 10 -2] AttributeEnd AttributeBegin Color 1 0 0 Translate 10 0 0 Polygon "P" [0 0 -2 10 0 -2 15 10 -2 5 20 -2 -5 10 -2] AttributeEnd AttributeBegin Color 1 1 0 Translate -25 8 0 Polygon "P" [0 0 -2 10 0 -2 15 7.5 -2 10 15 -2 0 15 -2 -5 7.5 -2] AttributeEnd AttributeBegin Color 0.3 0.3 0.3 Translate -10 -5 0 PointsPolygons [3 4] [0 1 2 0 2 4 3] "P" [0 0 -1 10 0 -1 0 10 -1 -10 0 -1 -10 10 -1] AttributeEnd WorldEnd --- NEW FILE: gears.rib --- # Gears.rib # Author: Scott Iverson <si@SpamSucks_sitexgraphics.com> # Date: 6/28/95 # # 5-frame animation of four gears # Projection "perspective" "fov" 25 Format 380 380 -1 Identity Rotate 0 0 0 1 Rotate -64.6196526 1 0 0 Rotate -33.6900675 0 1 0 Translate 10 -38 15 FrameBegin 1 Display "Gears1.png" "file" "rgba" [...1766 lines suppressed...] Rotate 288 0 0 1 PointsPolygons [4 4 4 4 4] [0 1 2 3 7 6 5 4 0 4 5 1 1 5 6 2 2 6 7 3] "P" [ 4.75 0.497418417 0 5.53404582 0.348192892 0.620702944 5.53404582 -0.348192892 0.620702944 4.75 -0.497418417 0 2.88789117 0.302419001 2.35213747 3.36457307 0.211693301 2.72951064 3.36457307 -0.211693301 2.72951064 2.88789117 -0.302419001 2.35213747 ] TransformEnd TransformBegin Rotate 312 0 0 1 PointsPolygons [4 4 4 4 4] [0 1 2 3 7 6 5 4 0 4 5 1 1 5 6 2 2 6 7 3] "P" [ 4.75 0.497418417 0 5.53404582 0.348192892 0.620702944 5.53404582 -0.348192892 0.620702944 4.75 -0.497418417 0 2.88789117 0.302419001 2.35213747 3.36457307 0.211693301 2.72951064 3.36457307 -0.211693301 2.72951064 2.88789117 -0.302419001 2.35213747 ] TransformEnd TransformBegin Rotate 336 0 0 1 PointsPolygons [4 4 4 4 4] [0 1 2 3 7 6 5 4 0 4 5 1 1 5 6 2 2 6 7 3] "P" [ 4.75 0.497418417 0 5.53404582 0.348192892 0.620702944 5.53404582 -0.348192892 0.620702944 4.75 -0.497418417 0 2.88789117 0.302419001 2.35213747 3.36457307 0.211693301 2.72951064 3.36457307 -0.211693301 2.72951064 2.88789117 -0.302419001 2.35213747 ] TransformEnd TransformBegin Rotate 360 0 0 1 PointsPolygons [4 4 4 4 4] [0 1 2 3 7 6 5 4 0 4 5 1 1 5 6 2 2 6 7 3] "P" [ 4.75 0.497418417 0 5.53404582 0.348192892 0.620702944 5.53404582 -0.348192892 0.620702944 4.75 -0.497418417 0 2.88789117 0.302419001 2.35213747 3.36457307 0.211693301 2.72951064 3.36457307 -0.211693301 2.72951064 2.88789117 -0.302419001 2.35213747 ] TransformEnd AttributeEnd TransformEnd AttributeEnd WorldEnd FrameEnd Index: polygon.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/polygon.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** polygon.rib 30 Aug 2003 07:29:54 -0000 1.2 --- polygon.rib 11 Sep 2003 21:53:47 -0000 1.3 *************** *** 1,6 **** Display "polygon" "framebuffer" "rgba" Format 400 300 1 ! PixelSamples 2 2 ! ShadingRate 2 Exposure 1 2.5 Projection "perspective" "fov" 60 --- 1,6 ---- Display "polygon" "framebuffer" "rgba" Format 400 300 1 ! PixelSamples 1 1 ! ShadingRate 4 Exposure 1 2.5 Projection "perspective" "fov" 60 *************** *** 12,16 **** AttributeBegin Color 1 1 1 ! Patch "bilinear" "P" [-30 -30 0 30 -30 0 -30 30 0 30 30 0] AttributeEnd --- 12,16 ---- AttributeBegin Color 1 1 1 ! #Patch "bilinear" "P" [-30 -30 0 30 -30 0 -30 30 0 30 30 0] AttributeEnd |
From: <ma...@us...> - 2003-09-09 03:01:15
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv5646/src/org/jrman/parser Modified Files: Parser.java Global.java Parameter.java Removed Files: Declaration.java Log Message: Started new implementation for parameter lists. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Parser.java 30 Aug 2003 07:29:54 -0000 1.60 --- Parser.java 9 Sep 2003 03:01:05 -0000 1.61 *************** *** 58,61 **** --- 58,62 ---- import org.jrman.options.Hider; import org.jrman.options.Quantizer; + import org.jrman.parameters.*; import org.jrman.parser.keywords.KeywordParser; import org.jrman.primitive.BicubicPatch; Index: Global.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Global.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Global.java 10 Jul 2003 14:48:26 -0000 1.7 --- Global.java 9 Sep 2003 03:01:05 -0000 1.8 *************** *** 24,27 **** --- 24,28 ---- import org.jrman.geom.Transform; + import org.jrman.parameters.*; public class Global { Index: Parameter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parameter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Parameter.java 16 Apr 2003 09:19:34 -0000 1.1 --- Parameter.java 9 Sep 2003 03:01:05 -0000 1.2 *************** *** 1,4 **** /* ! Parameter.java Copyright (C) 2003 Gerardo Horvilleur Martinez --- 1,4 ---- /* ! NParameter.java Copyright (C) 2003 Gerardo Horvilleur Martinez *************** *** 19,22 **** --- 19,25 ---- package org.jrman.parser; + + import org.jrman.parameters.*; + import org.jrman.parameters.*; public class Parameter { --- Declaration.java DELETED --- |
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1:/tmp/cvs-serv5646/src/org/jrman/parameters Added Files: VaryingArrayFloat.java VaryingArrayHPoint.java NParameter.java UniformScalarString.java Declaration.java VaryingScalarTuple3f.java ParameterList.java UniformScalarTuple3f.java VaryingScalarFloat.java UniformArrayFloat.java UniformArrayInteger.java UniformArrayHPoint.java UniformScalarFloat.java UniformArrayTuple3f.java UniformScalarHPoint.java UniformScalarInteger.java UniformArrayString.java VaryingArrayTuple3f.java VaryingScalarHPoint.java Log Message: Started new implementation for parameter lists. --- NEW FILE: VaryingArrayFloat.java --- /* UniformScalarFloat.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. */ package org.jrman.parameters; public class VaryingArrayFloat extends NParameter { final private float[] values; public VaryingArrayFloat(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public float getValue(int index, int arrayIndex) { return values[index * declaration.getCount() + arrayIndex]; } } --- NEW FILE: VaryingArrayHPoint.java --- /* UniformScalarHPoint.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. */ package org.jrman.parameters; import javax.vecmath.Tuple4f; public class VaryingArrayHPoint extends NParameter { final private float[] values; public VaryingArrayHPoint(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public void getValue(int index, int arrayIndex, Tuple4f out) { int offset = (index * declaration.getCount() + arrayIndex) * 4; out.x = values[offset++]; out.y = values[offset++]; out.z = values[offset++]; out.w = values[offset]; } } --- NEW FILE: NParameter.java --- /* NParameter.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. */ package org.jrman.parameters; public class NParameter { final protected Declaration declaration; public NParameter(Declaration declaration) { this.declaration = declaration; } public Declaration getDeclaration() { return declaration; } } --- NEW FILE: UniformScalarString.java --- /* UniformScalarString.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. */ package org.jrman.parameters; public class UniformScalarString extends NParameter { final private String value; public UniformScalarString(Declaration declaration, String value) { super(declaration); this.value = value; } public String getValue() { return value; } } --- NEW FILE: Declaration.java --- /* Declaration.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. */ package org.jrman.parameters; import java.io.StreamTokenizer; 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 { private String name; private StorageClass storageClass; private Type type; private int count; public static class StorageClass { public static final StorageClass CONSTANT = new StorageClass("constant"); public static final StorageClass UNIFORM = new StorageClass("uniform"); public static final StorageClass VARYING = new StorageClass("varying"); public static final StorageClass VERTEX = new StorageClass("vertex"); private final static Map map = new HashMap(); static { map.put("constant", CONSTANT); map.put("uniform", UNIFORM); map.put("varying", VARYING); map.put("vertex", VERTEX); } private String name; private StorageClass(String name) { this.name = name; } public static StorageClass getNamed(String name) { StorageClass result = (StorageClass) map.get(name); if (result == null) throw new IllegalArgumentException("No such storage class: " + name); return result; } public static boolean isStorageClassName(String name) { return map.containsKey(name); } public String toString() { return name; } } public static class Type { public static final Type FLOAT = new Type("float"); public static final Type INTEGER = new Type("integer"); public static final Type STRING = new Type("string"); public static final Type COLOR = new Type("color"); public static final Type POINT = new Type("point"); public static final Type VECTOR = new Type("vector"); public static final Type NORMAL = new Type("normal"); public static final Type MATRIX = new Type("matrix"); public static final Type HPOINT = new Type("hpoint"); private final static Map map = new HashMap(); static { map.put("float", FLOAT); map.put("integer", INTEGER); map.put("string", STRING); map.put("color", COLOR); map.put("point", POINT); map.put("vector", VECTOR); map.put("normal", NORMAL); map.put("matrix", MATRIX); map.put("hpoint", HPOINT); } private String name; private Type(String name) { this.name = name; } public static Type getNamed(String name) { Type result = (Type) map.get(name); if (result == null) throw new IllegalArgumentException("No such data type: " + name); return result; } public String toString() { return name; } } public Declaration(String name, StorageClass storageClass, Type type, int count) { this.name = name; this.storageClass = storageClass; this.type = type; this.count = count; } public Declaration(String name, String decl) { this.name = name; count = 1; try { StreamTokenizer st = new StreamTokenizer(new StringReader(decl)); if (st.nextToken() != StreamTokenizer.TT_WORD) throw new Exception("expected storage class"); if (StorageClass.isStorageClassName(st.sval)) storageClass = StorageClass.getNamed(st.sval); else { st.pushBack(); storageClass = StorageClass.UNIFORM; } if (st.nextToken() != StreamTokenizer.TT_WORD) throw new Exception("Expected type"); type = Type.getNamed(st.sval); int token = st.nextToken(); if (token == '[') { if (st.nextToken() != StreamTokenizer.TT_NUMBER) throw new Exception("Expected array size"); count = (int) st.nval; token = st.nextToken(); if (token != ']') throw new Exception("expected ]"); token = st.nextToken(); } if (token != StreamTokenizer.TT_EOF) throw new Exception("Extra data at end of declaration"); } catch (Exception e) { throw new IllegalArgumentException(e.toString()); } } public String getName() { return name; } public StorageClass getStorageClass() { return storageClass; } public Type getType() { return type; } public int getCount() { return count; } public boolean equals(Object other) { if (other == null) return false; if (!(other instanceof Declaration)) return false; Declaration d = (Declaration) other; return ( d.name.equals(name) && d.storageClass == storageClass && d.type == type && d.count == count); } public String toString() { StringBuffer sb = new StringBuffer(); sb.append(name).append(" "); sb.append(storageClass).append(" "); sb.append(type); if (count > 1) sb.append(" [").append(count).append("]"); return sb.toString(); } 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; } } --- NEW FILE: VaryingScalarTuple3f.java --- /* VaryingScalarTuple3f.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. */ package org.jrman.parameters; import javax.vecmath.Tuple3f; public class VaryingScalarTuple3f extends NParameter { final private float[] values; public VaryingScalarTuple3f(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public void getValue(int index, Tuple3f out) { out.x = values[index * 3]; out.y = values[index * 3 + 1]; out.z = values[index * 3 + 2]; } } --- NEW FILE: ParameterList.java --- /* ParameterList.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. */ package org.jrman.parameters; import java.util.ArrayList; import java.util.List; public class ParameterList { final private List list = new ArrayList(); public void addParameter(NParameter parameter) { list.add(parameter); } public NParameter getParameter(String name) { NParameter result = null; for (int i = 0; i < list.size(); i++) { NParameter parameter = (NParameter) list.get(i); if (parameter.getDeclaration().getName().equals(name)) { result = parameter; break; } } return result; } } --- NEW FILE: UniformScalarTuple3f.java --- /* UniformScalarTuple3f.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. */ package org.jrman.parameters; import javax.vecmath.Tuple3f; public class UniformScalarTuple3f extends NParameter { final private float x; final private float y; final private float z; public UniformScalarTuple3f(Declaration declaration, float x, float y, float z) { super(declaration); this.x = x; this.y = y; this.z = z; } public void getValue(Tuple3f out) { out.x = x; out.y = y; out.z = z; } } --- NEW FILE: VaryingScalarFloat.java --- /* VaryingScalarFloat.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. */ package org.jrman.parameters; public class VaryingScalarFloat extends NParameter { final private float[] values; public VaryingScalarFloat(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public float getValue(int index) { return values[index]; } } --- NEW FILE: UniformArrayFloat.java --- /* UniformArrayFloat.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. */ package org.jrman.parameters; public class UniformArrayFloat extends NParameter { final private float[] values; public UniformArrayFloat(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public float getValue(int index) { return values[index]; } } --- NEW FILE: UniformArrayInteger.java --- /* UniformArrayInteger.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. */ package org.jrman.parameters; public class UniformArrayInteger extends NParameter { final private int[] values; public UniformArrayInteger(Declaration declaration, int[] values) { super(declaration); this.values = new int[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public int getValue(int index) { return values[index]; } } --- NEW FILE: UniformArrayHPoint.java --- /* UniformArrayHPoint.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. */ package org.jrman.parameters; import javax.vecmath.Tuple4f; public class UniformArrayHPoint extends NParameter { final private float[] values; public UniformArrayHPoint(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public void getValue(int index, Tuple4f out) { out.x = values[index * 4]; out.y = values[index * 4 + 1]; out.z = values[index * 4 + 2]; out.w = values[index * 4 + 3]; } } --- NEW FILE: UniformScalarFloat.java --- /* UniformScalarFloat.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. */ package org.jrman.parameters; public class UniformScalarFloat extends NParameter { final private float value; public UniformScalarFloat(Declaration declaration, float value) { super(declaration); this.value = value; } public float getValue() { return value; } } --- NEW FILE: UniformArrayTuple3f.java --- /* UniformArrayTuple3f.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. */ package org.jrman.parameters; import javax.vecmath.Tuple3f; public class UniformArrayTuple3f extends NParameter { final private float[] values; public UniformArrayTuple3f(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public void getValue(int index, Tuple3f out) { out.x = values[index * 3]; out.y = values[index * 3 + 1]; out.z = values[index * 3 + 2]; } } --- NEW FILE: UniformScalarHPoint.java --- /* UniformScalarHPoint.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. */ package org.jrman.parameters; import javax.vecmath.Tuple4f; public class UniformScalarHPoint extends NParameter { final private float x; final private float y; final private float z; final private float w; public UniformScalarHPoint(Declaration declaration, float x, float y, float z, float w) { super(declaration); this.x = x; this.y = y; this.z = z; this.w = w; } public void getValue(Tuple4f out) { out.x = x; out.y = y; out.z = z; out.w = w; } } --- NEW FILE: UniformScalarInteger.java --- /* UniformScalarInteger.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. */ package org.jrman.parameters; public class UniformScalarInteger extends NParameter { final private int value; public UniformScalarInteger(Declaration declaration, int value) { super(declaration); this.value = value; } public int getValue() { return value; } } --- NEW FILE: UniformArrayString.java --- /* UniformArrayString.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. */ package org.jrman.parameters; public class UniformArrayString extends NParameter { final private String[] values; public UniformArrayString(Declaration declaration, String[] values) { super(declaration); this.values = new String[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public String getValue(int index) { return values[index]; } } --- NEW FILE: VaryingArrayTuple3f.java --- /* UniformScalarTuple3f.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. */ package org.jrman.parameters; import javax.vecmath.Tuple3f; public class VaryingArrayTuple3f extends NParameter { final private float[] values; public VaryingArrayTuple3f(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public void getValue(int index, int arrayIndex, Tuple3f out) { int offset = (index * declaration.getCount() + arrayIndex) * 3; out.x = values[offset++]; out.y = values[offset++]; out.z = values[offset]; } } --- NEW FILE: VaryingScalarHPoint.java --- /* VaryingScalarHPoint.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. */ package org.jrman.parameters; import javax.vecmath.Tuple4f; public class VaryingScalarHPoint extends NParameter { final private float[] values; public VaryingScalarHPoint(Declaration declaration, float[] values) { super(declaration); this.values = new float[values.length]; System.arraycopy(values, 0, this.values, 0, values.length); } public void getValue(int index, Tuple4f out) { out.x = values[index * 4]; out.y = values[index * 4 + 1]; out.z = values[index * 4 + 2]; out.w = values[index * 4 + 3]; } } |
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv5646/src/org/jrman/shaders Modified Files: LightPointlight.java VolumeDepthcue.java LightDistantlight.java LightShadowspotlight.java SurfaceMatte.java SurfaceMetal.java SurfacePaintedplastic.java LightShadowdistantlight.java SurfacePlastic.java LightSpotlight.java Shader.java SurfaceReflectivepaintedplastic.java LightAmbientlight.java VolumeFog.java DisplacementBumpy.java Log Message: Started new implementation for parameter lists. Index: LightPointlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightPointlight.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LightPointlight.java 19 May 2003 18:47:18 -0000 1.2 --- LightPointlight.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 29,33 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 29,33 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; Index: VolumeDepthcue.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/VolumeDepthcue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VolumeDepthcue.java 23 May 2003 06:47:01 -0000 1.1 --- VolumeDepthcue.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 23,27 **** import org.jrman.grid.FloatGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 23,27 ---- import org.jrman.grid.FloatGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: LightDistantlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightDistantlight.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LightDistantlight.java 19 May 2003 18:47:18 -0000 1.2 --- LightDistantlight.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 28,32 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 28,32 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; Index: LightShadowspotlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightShadowspotlight.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LightShadowspotlight.java 23 Aug 2003 21:22:46 -0000 1.1 --- LightShadowspotlight.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 30,34 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 30,34 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; Index: SurfaceMatte.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceMatte.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceMatte.java 19 May 2003 08:15:28 -0000 1.1 --- SurfaceMatte.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 22,26 **** import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 22,26 ---- import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: SurfaceMetal.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceMetal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceMetal.java 19 May 2003 08:15:28 -0000 1.1 --- SurfaceMetal.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 22,26 **** import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 22,26 ---- import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: SurfacePaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfacePaintedplastic.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfacePaintedplastic.java 20 Aug 2003 20:41:21 -0000 1.2 --- SurfacePaintedplastic.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 24,28 **** import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 24,28 ---- import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: LightShadowdistantlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightShadowdistantlight.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LightShadowdistantlight.java 21 Aug 2003 22:53:47 -0000 1.2 --- LightShadowdistantlight.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 30,34 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 30,34 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; Index: SurfacePlastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfacePlastic.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfacePlastic.java 23 May 2003 06:47:01 -0000 1.1 --- SurfacePlastic.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 24,28 **** import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 24,28 ---- import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: LightSpotlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightSpotlight.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LightSpotlight.java 21 May 2003 04:58:40 -0000 1.1 --- LightSpotlight.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 30,34 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 30,34 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; Index: Shader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/Shader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Shader.java 19 May 2003 08:15:28 -0000 1.2 --- Shader.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 25,29 **** import org.jrman.attributes.Attributes; import org.jrman.grid.FloatGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 25,29 ---- import org.jrman.attributes.Attributes; import org.jrman.grid.FloatGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: SurfaceReflectivepaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceReflectivepaintedplastic.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceReflectivepaintedplastic.java 4 Jun 2003 14:54:56 -0000 1.1 --- SurfaceReflectivepaintedplastic.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 28,32 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 28,32 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; Index: LightAmbientlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightAmbientlight.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LightAmbientlight.java 19 May 2003 08:15:28 -0000 1.1 --- LightAmbientlight.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 25,29 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 25,29 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: VolumeFog.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/VolumeFog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VolumeFog.java 23 May 2003 06:47:01 -0000 1.1 --- VolumeFog.java 9 Sep 2003 03:01:04 -0000 1.2 *************** *** 23,27 **** import org.jrman.grid.FloatGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 23,27 ---- import org.jrman.grid.FloatGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: DisplacementBumpy.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/DisplacementBumpy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DisplacementBumpy.java 13 Aug 2003 03:59:39 -0000 1.2 --- DisplacementBumpy.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 21,25 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 21,25 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; |
From: <ma...@us...> - 2003-09-09 03:01:15
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv5646/src/org/jrman/primitive Modified Files: BicubicPatch.java Primitive.java Log Message: Started new implementation for parameter lists. Index: BicubicPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BicubicPatch.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BicubicPatch.java 22 May 2003 22:17:44 -0000 1.2 --- BicubicPatch.java 9 Sep 2003 03:01:04 -0000 1.3 *************** *** 29,33 **** import org.jrman.geom.ConvexHull3f; import org.jrman.grid.Grid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 29,33 ---- import org.jrman.geom.ConvexHull3f; import org.jrman.grid.Grid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Primitive.java 16 Jul 2003 07:20:49 -0000 1.18 --- Primitive.java 9 Sep 2003 03:01:04 -0000 1.19 *************** *** 39,43 **** import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; --- 39,43 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; |
From: <ma...@us...> - 2003-09-09 03:01:15
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs1:/tmp/cvs-serv5646/src Modified Files: SurfaceRandomcolors.java Log Message: Started new implementation for parameter lists. Index: SurfaceRandomcolors.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceRandomcolors.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceRandomcolors.java 21 May 2003 04:58:40 -0000 1.2 --- SurfaceRandomcolors.java 9 Sep 2003 03:01:05 -0000 1.3 *************** *** 20,24 **** import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; --- 20,24 ---- import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; ! import org.jrman.parameters.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; |
From: <ma...@us...> - 2003-09-09 03:00:40
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1:/tmp/cvs-serv5621/src/org/jrman/parameters Log Message: Directory /cvsroot/jrman/drafts/src/org/jrman/parameters added to the repository |
From: <ma...@us...> - 2003-09-09 01:33:23
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv2926/src/org/jrman/render Modified Files: SimpleMicropolygon.java RendererHidden.java Micropolygon.java Sampler.java Log Message: Test Index: SimpleMicropolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SimpleMicropolygon.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SimpleMicropolygon.java 18 Jul 2003 08:40:24 -0000 1.7 --- SimpleMicropolygon.java 8 Sep 2003 23:03:29 -0000 1.8 *************** *** 54,62 **** private float cy; ! private float nx; ! ! private float ny; ! private float oneOverNz; private float colorRed; --- 54,60 ---- private float cy; ! private float nxOverZ; ! private float nyOverZ; private float colorRed; *************** *** 90,96 **** dos.writeFloat(cx); dos.writeFloat(cy); ! dos.writeFloat(nx); ! dos.writeFloat(ny); ! dos.writeFloat(oneOverNz); dos.writeFloat(colorRed); dos.writeFloat(colorGreen); --- 88,93 ---- dos.writeFloat(cx); dos.writeFloat(cy); ! dos.writeFloat(nxOverZ); ! dos.writeFloat(nyOverZ); dos.writeFloat(colorRed); dos.writeFloat(colorGreen); *************** *** 114,120 **** cx = dis.readFloat(); cy = dis.readFloat(); ! nx = dis.readFloat(); ! ny = dis.readFloat(); ! oneOverNz = dis.readFloat(); colorRed = dis.readFloat(); colorGreen = dis.readFloat(); --- 111,116 ---- cx = dis.readFloat(); cy = dis.readFloat(); ! nxOverZ = dis.readFloat(); ! nyOverZ = dis.readFloat(); colorRed = dis.readFloat(); colorGreen = dis.readFloat(); *************** *** 152,158 **** c = tmp; } ! nx = cp.x; ! ny = cp.y; ! oneOverNz = 1f / cp.z; // get bounds addPointToBounds(a.x, a.y, a.z); --- 148,153 ---- c = tmp; } ! nxOverZ = cp.x / cp.z; ! nyOverZ = cp.y / cp.z; // get bounds addPointToBounds(a.x, a.y, a.z); *************** *** 199,224 **** for (int row = minRow; row <= maxRow; row++) { for (int col = minColumn; col <= maxColumn; col++) { - sampleCount++; SamplePoint sp = sampler.getSamplePoint(col, row); ! if (sp.isOpaque() && sp.getZ() < minZ) { ! invisibleSampleCount++; continue; ! } ! boolean touched = sampleAtPoint(sp); ! if (touched) ! sampledSampleCount++; } } } ! public boolean sampleAtPoint(SamplePoint sp) { Point2f point = sp.getPoint(); if ((ay - by) * (point.x - ax) + (bx - ax) * (point.y - ay) > 0f) ! return false; if ((by - cy) * (point.x - bx) + (cx - bx) * (point.y - by) > 0f) ! return false; if ((cy - ay) * (point.x - cx) + (ax - cx) * (point.y - cy) > 0f) ! return false; ! float z = (nx * (ax - point.x) + ny * (ay - point.y)) * oneOverNz + az; sp.addSample( colorRed, --- 194,214 ---- for (int row = minRow; row <= maxRow; row++) { for (int col = minColumn; col <= maxColumn; col++) { SamplePoint sp = sampler.getSamplePoint(col, row); ! if (sp.isOpaque() && sp.getZ() < minZ) continue; ! sampleAtPoint(sp); } } } ! public void sampleAtPoint(SamplePoint sp) { Point2f point = sp.getPoint(); if ((ay - by) * (point.x - ax) + (bx - ax) * (point.y - ay) > 0f) ! return; if ((by - cy) * (point.x - bx) + (cx - bx) * (point.y - by) > 0f) ! return; if ((cy - ay) * (point.x - cx) + (ax - cx) * (point.y - cy) > 0f) ! return; ! float z = nxOverZ * (ax - point.x) + nyOverZ * (ay - point.y) + az; sp.addSample( colorRed, *************** *** 229,233 **** opacityBlue, z); ! return true; } --- 219,223 ---- opacityBlue, z); ! return; } Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** RendererHidden.java 21 Aug 2003 22:53:47 -0000 1.43 --- RendererHidden.java 8 Sep 2003 23:03:29 -0000 1.44 *************** *** 469,477 **** + "grids/second"); System.out.println("Total micropolygons: " + Micropolygon.count); - System.out.println("Total subpixel samples: " + Micropolygon.sampleCount); - System.out.println( - "Invisible micropolygon samples: " + Micropolygon.invisibleSampleCount); - System.out.println( - "Total micropolygon samples: " + Micropolygon.sampledSampleCount); System.out.println("Micropolygons/second: " + Micropolygon.count / time); System.out.println("Bucket samples: " + Sampler.bucketSamplesCount); --- 469,472 ---- Index: Micropolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Micropolygon.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Micropolygon.java 10 Jul 2003 14:48:26 -0000 1.12 --- Micropolygon.java 8 Sep 2003 23:03:29 -0000 1.13 *************** *** 29,38 **** public static int count; - public static int sampleCount; - - public static int invisibleSampleCount; - - public static int sampledSampleCount; - public abstract void sample(Sampler sampler); --- 29,32 ---- Index: Sampler.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sampler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Sampler.java 23 Aug 2003 21:22:46 -0000 1.10 --- Sampler.java 8 Sep 2003 23:03:29 -0000 1.11 *************** *** 31,35 **** private Point2f min = new Point2f(); ! private Color3f tmpColor = new Color3f(); --- 31,35 ---- private Point2f min = new Point2f(); ! private Color3f tmpColor = new Color3f(); *************** *** 132,138 **** } ! public void getColors(float[] dst, int dstOffset, int rowLength, int bands, int bandOffset) { for (int row = 0; row < height; row++) ! for (int col = 0; col < width; col++){ samplePoints[row * width + col].getColor(tmpColor); int offset = dstOffset + (row * rowLength + col) * bands + bandOffset; --- 132,143 ---- } ! public void getColors( ! float[] dst, ! int dstOffset, ! int rowLength, ! int bands, ! int bandOffset) { for (int row = 0; row < height; row++) ! for (int col = 0; col < width; col++) { samplePoints[row * width + col].getColor(tmpColor); int offset = dstOffset + (row * rowLength + col) * bands + bandOffset; |
From: <ma...@us...> - 2003-09-09 01:33:23
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv2926/sampleData Modified Files: uteapot.rib Log Message: Test Index: uteapot.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/uteapot.rib,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** uteapot.rib 2 Jul 2003 07:03:31 -0000 1.6 --- uteapot.rib 8 Sep 2003 23:03:29 -0000 1.7 *************** *** 10,16 **** #Display "uteapot.jpg" "file" "rgb" ! Display "teapot" "framebuffer" "rgb" ! Format 400 300 1.0 #Option "limits" "bucketsize" [32 32] "gridsize" 1024 PixelSamples 4 4 # Correct for monitor gamma of 2.2 --- 10,17 ---- #Display "uteapot.jpg" "file" "rgb" ! Display "teapot" "framebuffer" "rgba" ! Format 800 600 1.0 #Option "limits" "bucketsize" [32 32] "gridsize" 1024 + Option "statistics" "endofframe" 1 PixelSamples 4 4 # Correct for monitor gamma of 2.2 *************** *** 27,31 **** WorldBegin - LightSource "ambientlight" 1 "intensity" .4 "lightcolor" [.4 0 1] LightSource "distantlight" 2 "intensity" 1.0 --- 28,31 ---- |
From: <ma...@us...> - 2003-09-09 01:20:59
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv2926/src/org/jrman/geom Modified Files: AffineTransform.java Log Message: Test Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AffineTransform.java 20 Aug 2003 20:41:21 -0000 1.12 --- AffineTransform.java 8 Sep 2003 23:03:29 -0000 1.13 *************** *** 49,70 **** public static Transform createOrthographic(float near, float far) { ! Matrix4f m = ! new Matrix4f( ! 1f, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f, ! 0f, ! 0f, ! 0f, ! 0f, ! 1, //1f / (far - near), ! 0f, //-near / (far - near), ! 0f, ! 0f, ! 0f, ! 1f); return new AffineTransform(m); } --- 49,56 ---- public static Transform createOrthographic(float near, float far) { ! Matrix4f m = ! new Matrix4f(1f, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1, //1f / (far - near), ! 0f, //-near / (far - near), ! 0f, 0f, 0f, 1f); return new AffineTransform(m); } *************** *** 76,79 **** --- 62,67 ---- int verticalResolution, float pixelAspectRatio) { + System.out.println(frameAspectRatio); + System.out.println(pixelAspectRatio); float imageAspectRatio = (horizontalResolution * pixelAspectRatio) / verticalResolution; *************** *** 138,142 **** return new AffineTransform(m); } ! public static Transform readFromFile(DataInputStream dis) throws IOException { float a = dis.readFloat(); --- 126,130 ---- return new AffineTransform(m); } ! public static Transform readFromFile(DataInputStream dis) throws IOException { float a = dis.readFloat(); *************** *** 156,160 **** float o = dis.readFloat(); float p = dis.readFloat(); ! Matrix4f mat = new Matrix4f(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o ,p); return new AffineTransform(mat); } --- 144,148 ---- float o = dis.readFloat(); float p = dis.readFloat(); ! Matrix4f mat = new Matrix4f(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); return new AffineTransform(mat); } *************** *** 188,192 **** matrix.transform(p); point.x = p.x; ! point.y = p.y; } --- 176,180 ---- matrix.transform(p); point.x = p.x; ! point.y = p.y; } *************** *** 195,199 **** matrix.transform(p); out.x = p.x; ! out.y = p.y; } --- 183,187 ---- matrix.transform(p); out.x = p.x; ! out.y = p.y; } *************** *** 234,238 **** getInverseMatrix().transform(p); point.x = p.x; ! point.y = p.y; } --- 222,226 ---- getInverseMatrix().transform(p); point.x = p.x; ! point.y = p.y; } *************** *** 241,246 **** getInverseMatrix().transform(p); out.x = p.x; ! out.y = p.y; ! } public void untransformPoint(Point3f point) { --- 229,234 ---- getInverseMatrix().transform(p); out.x = p.x; ! out.y = p.y; ! } public void untransformPoint(Point3f point) { *************** *** 307,311 **** return new AffineTransform(getInverseMatrix()); } ! public String toString() { StringBuffer sb = new StringBuffer(); --- 295,299 ---- return new AffineTransform(getInverseMatrix()); } ! public String toString() { StringBuffer sb = new StringBuffer(); *************** *** 313,321 **** return sb.toString(); } ! public boolean isPerspective() { return false; } ! public void writeToFile(DataOutputStream dos) throws IOException { dos.writeFloat(matrix.m00); --- 301,309 ---- return sb.toString(); } ! public boolean isPerspective() { return false; } ! public void writeToFile(DataOutputStream dos) throws IOException { dos.writeFloat(matrix.m00); |
From: <edi...@us...> - 2003-08-30 07:29:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv28113/src/org/jrman/parser Modified Files: Parser.java Log Message: First complete implementation polygon Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Parser.java 23 Aug 2003 21:22:46 -0000 1.59 --- Parser.java 30 Aug 2003 07:29:54 -0000 1.60 *************** *** 81,1134 **** public class Parser { ! private final static String KEYWORD_PREFIX = "org.jrman.parser.keywords.Keyword"; ! private boolean inAreaLightSource; ! private String beginName; ! private World world; [...2179 lines suppressed...] ! String twrap, ! String filter, ! int swidth, ! int twidth) { ! try { ! MipMap.makeMipMap( ! picturename, ! texturename, ! MipMap.Mode.getNamed(swrap), ! MipMap.Mode.getNamed(twrap), ! filter, ! swidth, ! twidth); ! } catch (IOException e) { ! throw new IllegalArgumentException( ! "Can't create texture: " + picturename); ! } ! } } |
From: <edi...@us...> - 2003-08-30 07:29:58
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv28113/sampleData Modified Files: polygon.rib Added Files: morph.rib cubits.rib Log Message: First complete implementation polygon --- NEW FILE: morph.rib --- # morph.rib # Author: Scott Iverson <si@SpamSucks_sitexgraphics.com> # Date: 7/19/95 # Display "morph.tiff" "framebuffer" "rgb" Projection "perspective" "fov" 21 Format 380 380 -1 #Agregado por JVG PixelSamples 4 4 ShadingRate 1 Identity Rotate 0 0 0 1 Rotate -16 1 0 0 Rotate 46.5 0 1 0 Translate -1 -0.4 1 WorldBegin [...1582 lines suppressed...] Rotate 90 0 1 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] Rotate 90 0 1 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] Rotate 90 0 1 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] TransformEnd TransformBegin Rotate 180 1 0 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] Rotate 90 0 1 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] Rotate 90 0 1 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] Rotate 90 0 1 0 Polygon "P" [ 0 1 0 0 1 0 1 0 0 1 0 0 0 0 -1 0 0 -1 ] TransformEnd Translate 0 2.128 0 TransformEnd WorldEnd --- NEW FILE: cubits.rib --- # cubits.rib # Author: Scott Iverson <si@SpamSucks_sitexgraphics.com> # Date: 7/19/95 # Display "cubits.tiff" "framebuffer" "rgb" Format 380 380 -1 Projection "perspective" "fov" 25 #Agregado por JVG PixelSamples 4 4 ShadingRate 1 Rotate 0 0 0 1 Rotate -35 1 0 0 Rotate 147 0 1 0 Translate -1.7 -2.2 -2.6 WorldBegin Translate -.5 -.5 -.5 Surface "constant" Sides 2 Color 0.811111111 0.566666667 .1 Polygon "P" [ 0 0 0.111111111 0 1 0.111111111 1 1 0.111111111 1 0 0.111111111 ] Color 0.111111111 .4 0.0555555555 Polygon "P" [ 0 0.111111111 0 0 0.111111111 1 1 0.111111111 1 1 0.111111111 0 ] Color 0 0.533333333 .6 Polygon "P" [ 0.111111111 0 0 0.111111111 1 0 0.111111111 1 1 0.111111111 0 1 ] Color 0.722222222 0.533333333 .1 Polygon "P" [ 0 0 0.222222222 0 1 0.222222222 1 1 0.222222222 1 0 0.222222222 ] Color 0.222222222 .4 0.111111111 Polygon "P" [ 0 0.222222222 0 0 0.222222222 1 1 0.222222222 1 1 0.222222222 0 ] Color 0 0.466666667 .6 Polygon "P" [ 0.222222222 0 0 0.222222222 1 0 0.222222222 1 1 0.222222222 0 1 ] Color 0.633333334 0.500000000 .1 Polygon "P" [ 0 0 0.333333333 0 1 0.333333333 1 1 0.333333333 1 0 0.333333333 ] Color 0.333333333 .4 0.166666666 Polygon "P" [ 0 0.333333333 0 0 0.333333333 1 1 0.333333333 1 1 0.333333333 0 ] Color 0 0.400000000 .6 Polygon "P" [ 0.333333333 0 0 0.333333333 1 0 0.333333333 1 1 0.333333333 0 1 ] Color 0.544444445 0.466666667 .1 Polygon "P" [ 0 0 0.444444444 0 1 0.444444444 1 1 0.444444444 1 0 0.444444444 ] Color 0.444444444 .4 0.222222222 Polygon "P" [ 0 0.444444444 0 0 0.444444444 1 1 0.444444444 1 1 0.444444444 0 ] Color 0 0.333333334 .6 Polygon "P" [ 0.444444444 0 0 0.444444444 1 0 0.444444444 1 1 0.444444444 0 1 ] Color 0.455555555 0.433333333 .1 Polygon "P" [ 0 0 0.555555556 0 1 0.555555556 1 1 0.555555556 1 0 0.555555556 ] Color 0.555555556 .4 0.277777778 Polygon "P" [ 0 0.555555556 0 0 0.555555556 1 1 0.555555556 1 1 0.555555556 0 ] Color 0 0.266666666 .6 Polygon "P" [ 0.555555556 0 0 0.555555556 1 0 0.555555556 1 1 0.555555556 0 1 ] Color 0.366666666 0.400000000 .1 Polygon "P" [ 0 0 0.666666667 0 1 0.666666667 1 1 0.666666667 1 0 0.666666667 ] Color 0.666666667 .4 0.333333333 Polygon "P" [ 0 0.666666667 0 0 0.666666667 1 1 0.666666667 1 1 0.666666667 0 ] Color 0 0.200000000 .6 Polygon "P" [ 0.666666667 0 0 0.666666667 1 0 0.666666667 1 1 0.666666667 0 1 ] Color 0.277777778 0.366666667 .1 Polygon "P" [ 0 0 0.777777778 0 1 0.777777778 1 1 0.777777778 1 0 0.777777778 ] Color 0.777777778 .4 0.388888889 Polygon "P" [ 0 0.777777778 0 0 0.777777778 1 1 0.777777778 1 1 0.777777778 0 ] Color 0 0.133333333 .6 Polygon "P" [ 0.777777778 0 0 0.777777778 1 0 0.777777778 1 1 0.777777778 0 1 ] Color 0.188888889 0.333333333 .1 Polygon "P" [ 0 0 0.888888889 0 1 0.888888889 1 1 0.888888889 1 0 0.888888889 ] Color 0.888888889 .4 0.444444444 Polygon "P" [ 0 0.888888889 0 0 0.888888889 1 1 0.888888889 1 1 0.888888889 0 ] Color 0 0.0666666666 .6 Polygon "P" [ 0.888888889 0 0 0.888888889 1 0 0.888888889 1 1 0.888888889 0 1 ] WorldEnd Index: polygon.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/polygon.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** polygon.rib 22 Aug 2003 09:05:22 -0000 1.1 --- polygon.rib 30 Aug 2003 07:29:54 -0000 1.2 *************** *** 1,23 **** Display "polygon" "framebuffer" "rgba" Format 400 300 1 ! PixelSamples 1 1 ! ShadingRate 4 ! Exposure 1 2.2 Projection "perspective" "fov" 60 Translate 0 0 40 #Rotate -45 1 0 0 WorldBegin LightSource "ambientlight" 1 "intensity" 2 AttributeBegin Color 1 1 1 ! Patch "bilinear" "P" [-20 -20 0 20 -20 0 -20 20 0 20 20 0] AttributeEnd AttributeBegin Color 0 0 1 ! Polygon 4 "P" [0 0 -5 5 0 -5 0 5 -5 0 0 -5] AttributeEnd AttributeBegin Color 0 1 0 ! Polygon 4 "P" [10 10 -2 20 10 -2 10 20 -2 10 10 -2] AttributeEnd --- 1,46 ---- Display "polygon" "framebuffer" "rgba" Format 400 300 1 ! PixelSamples 2 2 ! ShadingRate 2 ! Exposure 1 2.5 Projection "perspective" "fov" 60 Translate 0 0 40 #Rotate -45 1 0 0 + WorldBegin LightSource "ambientlight" 1 "intensity" 2 AttributeBegin Color 1 1 1 ! Patch "bilinear" "P" [-30 -30 0 30 -30 0 -30 30 0 30 30 0] AttributeEnd + AttributeBegin Color 0 0 1 ! Translate 0 -15 0 ! Polygon "P" [0 0 -5 5 0 -5 0 5 -5 0 0 -5] AttributeEnd + AttributeBegin Color 0 1 0 ! Translate -30 -30 0 ! Polygon "P" [10 10 -2 20 10 -2 10 20 -2] ! AttributeEnd ! ! AttributeBegin ! Color 0 1 1 ! Translate 10 -15 0 ! Polygon "P" [0 0 -2 10 0 -2 10 10 -2 0 10 -2] ! AttributeEnd ! ! AttributeBegin ! Color 1 0 0 ! Translate 5 0 0 ! Polygon "P" [0 0 -2 10 0 -2 15 10 -2 5 20 -2 -5 10 -2] ! AttributeEnd ! ! AttributeBegin ! Color 1 1 0 ! Translate -20 0 0 ! Polygon "P" [0 0 -2 10 0 -2 15 7.5 -2 10 15 -2 0 15 -2 -5 7.5 -2] AttributeEnd |
From: <edi...@us...> - 2003-08-30 07:29:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv28113/src/org/jrman/parser/keywords Modified Files: KeywordPolygon.java Log Message: First complete implementation polygon Index: KeywordPolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPolygon.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KeywordPolygon.java 22 Aug 2003 09:05:22 -0000 1.3 --- KeywordPolygon.java 30 Aug 2003 07:29:54 -0000 1.4 *************** *** 27,48 **** public void parse(Tokenizer st) throws Exception { ! ! boolean array = false; ! int token = st.nextToken(); ! // Check por array ! if (token == TK_LBRACE) ! array = true; ! else ! st.pushBack(); ! // Expect points number ! match(st, TK_NUMBER); ! float nPoints = (float) st.nval; ! // Expect points and parameters ! Map parameters = parseParameterList(st);; ! if (array) ! match(st, TK_RBRACE); ! parser.addPolygon(nPoints, parameters); ! } ! } --- 27,34 ---- public void parse(Tokenizer st) throws Exception { ! // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.addPolygon(parameters); ! } } |
From: <ma...@us...> - 2003-08-23 21:22:50
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv20980/sampleData Modified Files: shadowTest.rib elephant.rib Log Message: Implemented shadowspotlight Added random number generator Index: shadowTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/shadowTest.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shadowTest.rib 21 Aug 2003 22:53:47 -0000 1.2 --- shadowTest.rib 23 Aug 2003 21:22:46 -0000 1.3 *************** *** 17,21 **** AttributeEnd AttributeBegin ! Sphere 1 -1 1 360 AttributeEnd AttributeBegin --- 17,22 ---- AttributeEnd AttributeBegin ! Translate 1.3 -2.5 -2.6 ! Sphere .5 -.5 .5 360 AttributeEnd AttributeBegin *************** *** 31,35 **** Format 800 600 1 Display "shadowTest" "framebuffer" "rgba" ! PixelSamples 4 4 Exposure 1 2.2 Projection "perspective" "fov" 40 --- 32,36 ---- Format 800 600 1 Display "shadowTest" "framebuffer" "rgba" ! PixelSamples 8 8 Exposure 1 2.2 Projection "perspective" "fov" 40 *************** *** 39,43 **** "from" [1 1 0] "to" [0 0 0] "shadowmap" "shadowTest.shdw" "bias" .1 ! "samples" 64 "blur" 5 LightSource "ambientlight" 2 "intensity" .1 Rotate -10 1 0 0 --- 40,44 ---- "from" [1 1 0] "to" [0 0 0] "shadowmap" "shadowTest.shdw" "bias" .1 ! "samples" 64 "blur" 10 LightSource "ambientlight" 2 "intensity" .1 Rotate -10 1 0 0 *************** *** 54,58 **** AttributeBegin Color 1 0 0 ! Sphere 1 -1 1 360 AttributeEnd AttributeBegin --- 55,60 ---- AttributeBegin Color 1 0 0 ! Translate 1.3 -2.5 -2.6 ! Sphere .5 -.5 .5 360 AttributeEnd AttributeBegin Index: elephant.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/elephant.rib,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** elephant.rib 12 Jun 2003 18:36:02 -0000 1.7 --- elephant.rib 23 Aug 2003 21:22:46 -0000 1.8 *************** *** 1,7 **** Format 400 300 1 ! Display "eleFloorRefl.png" "file" "rgb" ! PixelFilter "box" 1 1 ! PixelSamples 4 4 ! Exposure 1 2.2 Clipping 40 200 Projection "perspective" "fov" 5 --- 1,79 ---- + Declare "shadowmap" "string" + Declare "bias" "uniform float" + Declare "samples" "uniform float" + Declare "blur" "uniform float" + + Format 1024 1024 1 + Display "elephantSpot1.shdw" "file" "z" + PixelSamples 1 1 + Projection "perspective" "fov" 45 + Translate 0 0 9.433 + Rotate -58 1 0 0 + WorldBegin + ShadingRate 4 + AttributeBegin + Displacement "bumptest" + Attribute "displacementbound" "sphere" .03 + Surface "constant" + Translate 0 0 -4 + Rotate -120 0 1 0 + Rotate -90 1 0 0 + Scale .2 .2 .2 + ReadArchive "gumbo.rib" + AttributeEnd + WorldEnd + + Format 1024 1024 1 + Display "elephantSpot2.shdw" "file" "z" + PixelSamples 1 1 + Projection "perspective" "fov" 45 + Rotate 10 1 0 0 + Rotate -10 0 1 0 + Translate 0 0 9.165 + Rotate -60.79 1 0 0 + Rotate -116.57 0 1 0 + WorldBegin + ShadingRate 4 + AttributeBegin + Displacement "bumptest" + Attribute "displacementbound" "sphere" .03 + Surface "constant" + Translate 0 0 -4 + Rotate -120 0 1 0 + Rotate -90 1 0 0 + Scale .2 .2 .2 + ReadArchive "gumbo.rib" + AttributeEnd + WorldEnd + + + Format 1024 1024 1 + Display "elephantSpot3.shdw" "file" "z" + PixelSamples 1 1 + Projection "perspective" "fov" 45 + Rotate 10 1 0 0 + Rotate 10 0 1 0 + Translate 0 0 9.165 + Rotate -60.79 1 0 0 + Rotate 116.57 0 1 0 + WorldBegin + ShadingRate 4 + AttributeBegin + Displacement "bumptest" + Attribute "displacementbound" "sphere" .03 + Surface "constant" + Translate 0 0 -4 + Rotate -120 0 1 0 + Rotate -90 1 0 0 + Scale .2 .2 .2 + ReadArchive "gumbo.rib" + AttributeEnd + WorldEnd + + Format 400 300 1 ! Display "eleFloorRefl.png" "file" "rgba" ! PixelSamples 2 2 ! Exposure .6 1 Clipping 40 200 Projection "perspective" "fov" 5 *************** *** 9,21 **** Translate 0 0 120 Rotate 30 1 0 0 - WorldBegin ! LightSource "spotlight" 1 "from" [0 8 -5] "to" [0 0 0] "lightcolor" [1 0 0] "intensity" 75 ! LightSource "spotlight" 2 "from" [-4 8 2] "to" [0 0 0] "lightcolor" [0 1 0] "intensity" 75 ! LightSource "spotlight" 3 "from" [4 8 2] "to" [0 0 0] ! "lightcolor" [0 0 1] "intensity" 75 ! AttributeBegin Displacement "bumptest" --- 81,98 ---- Translate 0 0 120 Rotate 30 1 0 0 WorldBegin ! LightSource "shadowspotlight" 1 "from" [0 8 -5] "to" [0 0 0] "lightcolor" [1 0 0] "intensity" 75 ! "shadowmap" "elephantSpot1.shdw" "bias" .001 ! "samples" 16 "blur" 10 ! LightSource "shadowspotlight" 2 "from" [-4 8 2] "to" [0 0 0] "lightcolor" [0 1 0] "intensity" 75 ! "shadowmap" "elephantSpot2.shdw" "bias" .001 ! "samples" 16 "blur" 10 ! LightSource "shadowspotlight" 3 "from" [4 8 2] "to" [0 0 0] ! "lightcolor" [0 0 1] "intensity" 75 ! "shadowmap" "elephantSpot3.shdw" "bias" .001 ! "samples" 16 "blur" 10 ! LightSource "ambientlight" 4 "intensity" .06 AttributeBegin Displacement "bumptest" *************** *** 31,39 **** WorldEnd ! MakeTexture "eleFloorRefl.png" "eleFloorRefl.txr" "periodic" "periodic" "x" 1 1 Format 800 600 1 ! Display "elephant" "framebuffer" "rgb" ! PixelFilter "box" 1 1 PixelSamples 4 4 Exposure 1 2.2 --- 108,115 ---- WorldEnd ! MakeTexture "eleFloorRefl.png" "eleFloorRefl.txr" "clamp" "clamp" "gaussian" 2 2 Format 800 600 1 ! Display "elephant" "framebuffer" "rgba" PixelSamples 4 4 Exposure 1 2.2 *************** *** 42,57 **** Translate 0 0 120 Rotate -30 1 0 0 - WorldBegin ! LightSource "spotlight" 1 "from" [0 8 -5] "to" [0 0 0] "lightcolor" [1 0 0] "intensity" 75 ! LightSource "spotlight" 2 "from" [-4 8 2] "to" [0 0 0] "lightcolor" [0 1 0] "intensity" 75 ! LightSource "spotlight" 3 "from" [4 8 2] "to" [0 0 0] ! "lightcolor" [0 0 1] "intensity" 75 AttributeBegin Color .8 .8 .8 Declare "rtexturename" "string" ! Surface "reflectivepaintedplastic" "texturename" "woo12.txr" "rtexturename" "eleFloorRefl.txr" Rotate 17 0 1 0 Patch "bilinear" "P" [-20 0 -20 20 0 -20 -20 0 20 20 0 20] --- 118,144 ---- Translate 0 0 120 Rotate -30 1 0 0 WorldBegin ! ShadingRate .25 ! LightSource "shadowspotlight" 1 "from" [0 8 -5] "to" [0 0 0] "lightcolor" [1 0 0] "intensity" 75 ! "shadowmap" "elephantSpot1.shdw" "bias" .001 ! "samples" 64 "blur" 10 ! LightSource "shadowspotlight" 2 "from" [-4 8 2] "to" [0 0 0] "lightcolor" [0 1 0] "intensity" 75 ! "shadowmap" "elephantSpot2.shdw" "bias" .001 ! "samples" 64 "blur" 10 ! LightSource "shadowspotlight" 3 "from" [4 8 2] "to" [0 0 0] ! "lightcolor" [0 0 1] "intensity" 75 ! "shadowmap" "elephantSpot3.shdw" "bias" .001 ! "samples" 64 "blur" 10 ! LightSource "ambientlight" 4 "intensity" .06 ! Illuminate 1 1 ! Illuminate 2 1 ! Illuminate 3 1 ! Illuminate 4 1 AttributeBegin Color .8 .8 .8 Declare "rtexturename" "string" ! Surface "reflectivepaintedplastic" "rtexturename" "eleFloorRefl.txr" Rotate 17 0 1 0 Patch "bilinear" "P" [-20 0 -20 20 0 -20 -20 0 20 20 0 20] |
From: <ma...@us...> - 2003-08-23 21:22:50
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv20980/src/org/jrman/shaders Added Files: LightShadowspotlight.java Log Message: Implemented shadowspotlight Added random number generator --- NEW FILE: LightShadowspotlight.java --- /* LightShadowspotlight.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. */ package org.jrman.shaders; import javax.vecmath.Color3f; import javax.vecmath.Point3f; import javax.vecmath.Vector3f; import org.jrman.attributes.Space; import org.jrman.geom.Transform; import org.jrman.grid.Color3fGrid; import org.jrman.grid.FloatGrid; import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.parser.Declaration; import org.jrman.parser.Global; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; public class LightShadowspotlight extends LightShader { static FloatGrid fg1 = new FloatGrid(); static FloatGrid fg2 = new FloatGrid(); static FloatGrid fg3 = new FloatGrid(); static Color3fGrid cg1 = new Color3fGrid(); private static Vector3f vtmp = new Vector3f(); private static Point3f from = new Point3f(); private static Point3f to = new Point3f(); static Color3f c1 = new Color3f(); static Point3fGrid pg = new Point3fGrid(); static FloatGrid fg = new FloatGrid(); static Color3fGrid cg = new Color3fGrid(); protected void initDefaults() { float[][] intensity = new float[1][]; intensity[0] = new float[1]; intensity[0][0] = 1f; Parameter param = new Parameter(new Declaration("intensity", "uniform float"), intensity); defaultParameters.put("intensity", param); Color3f[][] lightcolor = new Color3f[1][]; lightcolor[0] = new Color3f[1]; lightcolor[0][0] = new Color3f(1f, 1f, 1f); param = new Parameter(new Declaration("lightcolor", "uniform color"), lightcolor); defaultParameters.put("lightcolor", param); Point3f[][] from = new Point3f[1][]; from[0] = new Point3f[1]; from[0][0] = new Point3f(0f, 0f, 0f); param = new Parameter(new Declaration("from", "uniform point"), from); defaultParameters.put("from", param); Point3f[][] to = new Point3f[1][]; to[0] = new Point3f[1]; to[0][0] = new Point3f(0f, 0f, 1f); param = new Parameter(new Declaration("to", "uniform point"), to); defaultParameters.put("to", param); float[][] coneangle = new float[1][]; coneangle[0] = new float[1]; coneangle[0][0] = (float) Math.toRadians(30); param = new Parameter(new Declaration("coneangle", "uniform float"), coneangle); defaultParameters.put("coneangle", param); float[][] conedeltaangle = new float[1][]; conedeltaangle[0] = new float[1]; conedeltaangle[0][0] = (float) Math.toRadians(5); param = new Parameter(new Declaration("conedeltaangle", "uniform float"), conedeltaangle); defaultParameters.put("conedeltaangle", param); float[][] beamdistribution = new float[1][]; beamdistribution[0] = new float[1]; beamdistribution[0][0] = 2f; param = new Parameter( new Declaration("beamdistribution", "uniform float"), beamdistribution); defaultParameters.put("beamdistribution", param); float[][] bias = new float[1][]; bias[0] = new float[1]; bias[0][0] = .1f; param = new Parameter(new Declaration("bias", "uniform float"), bias); defaultParameters.put("bias", param); String[][] shadowmap = new String[1][]; shadowmap[0] = new String[1]; shadowmap[0][0] = ""; param = new Parameter(new Declaration("shadowmap", "string"), shadowmap); defaultParameters.put("shadowmap", param); float[][] samples = new float[1][]; samples[0] = new float[1]; samples[0][0] = 16f; param = new Parameter(new Declaration("samples", "uniform float"), samples); defaultParameters.put("samples", param); float[][] blur = new float[1][]; blur[0] = new float[1]; blur[0][0] = 0f; param = new Parameter(new Declaration("blur", "uniform float"), blur); defaultParameters.put("blur", param); } public boolean shade( final ShaderVariables sv, Point3fGrid P, Vector3fGrid N, float angle) { super.shade(sv, P, N, angle); Parameter param = (Parameter) getParameter(sv, "intensity"); float[][] f = (float[][]) param.getData(); final float intensity = f[0][0]; param = (Parameter) getParameter(sv, "lightcolor"); Color3f[][] c = (Color3f[][]) param.getData(); final Color3f lightColor = c[0][0]; Transform shaderTransform = attributes.getTransform(); if (attributes.getSpace() == Space.WORLD) shaderTransform = Global.getTransform("camera").concat(shaderTransform); param = (Parameter) getParameter(sv, "from"); Point3f[][] p = (Point3f[][]) param.getData(); shaderTransform.transformPoint(p[0][0], from); param = (Parameter) getParameter(sv, "to"); p = (Point3f[][]) param.getData(); shaderTransform.transformPoint(p[0][0], to); param = (Parameter) getParameter(sv, "coneangle"); f = (float[][]) param.getData(); final float coneangle = f[0][0]; param = (Parameter) getParameter(sv, "conedeltaangle"); f = (float[][]) param.getData(); final float conedeltaangle = f[0][0]; param = (Parameter) getParameter(sv, "beamdistribution"); f = (float[][]) param.getData(); final float beamdistribution = f[0][0]; param = (Parameter) getParameter(sv, "bias"); f = (float[][]) param.getData(); final float bias = f[0][0]; param = (Parameter) getParameter(sv, "shadowmap"); String[][] s = (String[][]) param.getData(); final String shadowmap = s[0][0]; param = (Parameter) getParameter(sv, "samples"); f = (float[][]) param.getData(); final float samples = f[0][0]; param = (Parameter) getParameter(sv, "blur"); f = (float[][]) param.getData(); final float blur = f[0][0]; vtmp.sub(to, from); final Vector3f A = vtmp; A.normalize(); return illuminate(sv, P, N, angle, from, A, coneangle, new Statement() { public void execute(ShaderVariables sv) { fg1.dot(sv.L, A); fg2.length(sv.L); fg1.div(fg1, fg2); FloatGrid cosangle = fg1; fg2.dot(sv.L, sv.L); fg3.pow(cosangle, beamdistribution); fg3.div(fg3, fg2); FloatGrid atten = fg3; fg2.smoothstep( (float) Math.cos(coneangle), (float) Math.cos(coneangle - conedeltaangle), cosangle); atten.mul(atten, fg2); fg2.mul(atten, intensity); cg1.set(fg2); sv.Cl.set(lightColor, tmpCond1); sv.Cl.mul(sv.Cl, cg1, tmpCond1); if (!shadowmap.equals("")) { pg.transform(sv.P, sv.cameraToWorld); fg.shadow(shadowmap, pg, bias, samples, blur); fg.sub(1f, fg); cg.set(fg); sv.Cl.mul(sv.Cl, cg); } } }); } } |
From: <ma...@us...> - 2003-08-23 21:22:50
|
Update of /cvsroot/jrman/drafts/src/org/jrman/maps In directory sc8-pr-cvs1:/tmp/cvs-serv20980/src/org/jrman/maps Modified Files: ShadowMap.java Log Message: Implemented shadowspotlight Added random number generator Index: ShadowMap.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/maps/ShadowMap.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ShadowMap.java 21 Aug 2003 22:53:46 -0000 1.3 --- ShadowMap.java 23 Aug 2003 21:22:46 -0000 1.4 *************** *** 38,41 **** --- 38,42 ---- import org.jrman.geom.Transform; import org.jrman.util.Calc; + import org.jrman.util.Rand; public class ShadowMap { *************** *** 186,195 **** int x = Math.round( ! Calc.interpolate(ptmp1.x, ptmp2.x, (float) Math.random()) ! + ((float) Math.random() - .5f) * blur); int y = Math.round( ! Calc.interpolate(ptmp1.y, ptmp2.y, (float) Math.random()) ! + ((float) Math.random() - .5f) * blur); total += get(x, y, ptmp1.z - bias); } --- 187,196 ---- int x = Math.round( ! Calc.interpolate(ptmp1.x, ptmp2.x, Rand.uniform()) ! + (Rand.uniform() - .5f) * blur); int y = Math.round( ! Calc.interpolate(ptmp1.y, ptmp2.y, Rand.uniform()) ! + (Rand.uniform() - .5f) * blur); total += get(x, y, ptmp1.z - bias); } |
From: <ma...@us...> - 2003-08-23 21:22:50
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv20980/src/org/jrman/render Modified Files: Sampler.java Log Message: Implemented shadowspotlight Added random number generator Index: Sampler.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sampler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Sampler.java 20 Aug 2003 20:41:21 -0000 1.9 --- Sampler.java 23 Aug 2003 21:22:46 -0000 1.10 *************** *** 26,29 **** --- 26,30 ---- import org.jrman.util.Calc; import org.jrman.util.Constants; + import org.jrman.util.Rand; public class Sampler { *************** *** 106,111 **** float x = min.x + sampleWidth * .5f; for (int column = 0; column < width; column++) { ! float jx = x + ((float) Math.random() - .5f) * sampleWidth; ! float jy = y + ((float) Math.random() - .5f) * sampleHeight; samplePoints[row * width + column].init(jx, jy); x += sampleWidth; --- 107,112 ---- float x = min.x + sampleWidth * .5f; for (int column = 0; column < width; column++) { ! float jx = x + (Rand.uniform() - .5f) * sampleWidth; ! float jy = y + (Rand.uniform() - .5f) * sampleHeight; samplePoints[row * width + column].init(jx, jy); x += sampleWidth; |
From: <ma...@us...> - 2003-08-23 21:22:49
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv20980/src/org/jrman/util Added Files: Rand.java Log Message: Implemented shadowspotlight Added random number generator --- NEW FILE: Rand.java --- /* Rand.java Copyright (C) 1995,1996, 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. */ package org.jrman.util; public class Rand { final static long twoToThe31 = 0x80000000L; static int A[] = new int[56]; static int ptr; static { setSeed(31415926); } final static int modDiff(int x, int y) { return (x - y) & 0x7fffffff; } final static int flipCycle() { int ii; int jj; for (ii = 1, jj = 32; jj <= 55; ii++, jj++) A[ii] = modDiff(A[ii], A[jj]); for (jj = 1; ii <= 55; ii++, jj++) A[ii] = modDiff(A[ii], A[jj]); ptr = 54; return A[55]; } public final static int next() { if (A[ptr] >= 0) return A[ptr--]; else return flipCycle(); } public final static void setSeed(int seed) { int i; int prev = seed; int next = 1; A[0] = -1; ptr = 0; seed = prev = modDiff(prev, 0); A[55] = prev; for (i = 21; i != 0; i = (i + 21) % 55) { A[i] = next; next = modDiff(prev, next); if ((seed & 1) != 0) seed = 0x40000000 + (seed >> 1); else seed >>= 1; next = modDiff(next, seed); prev = A[i]; } flipCycle(); flipCycle(); flipCycle(); flipCycle(); flipCycle(); } public final static int uniform(int m) { long t = twoToThe31 - (twoToThe31 % m); int r; do { r = next(); } while (t <= r); return (int) (r % m); } public final static float uniform() { return (float) uniform(10000000) / 9999999f; } } |
From: <ma...@us...> - 2003-08-23 21:22:49
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv20980/src/org/jrman/parser Modified Files: Parser.java Log Message: Implemented shadowspotlight Added random number generator Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Parser.java 22 Aug 2003 09:05:23 -0000 1.58 --- Parser.java 23 Aug 2003 21:22:46 -0000 1.59 *************** *** 411,414 **** --- 411,416 ---- public void worldBegin() { pushState(State.WORLD); + frameStack.push(new Frame(frame)); + worldStack.push(new World(world)); frame.defineScreen(); Global.setTransform("raster", frame.getRasterTransform()); *************** *** 417,421 **** saveCurrentTransformAs("camera"); // from "world" to "camera" setIdentity(); - worldStack.push(new World(world)); currentAttributes.setSpace(Space.WORLD); pushAttributes(); --- 419,422 ---- *************** *** 427,430 **** --- 428,432 ---- renderer = null; world = (World) worldStack.pop(); + frame = (Frame) frameStack.pop(); popState(); popAttributes(); |
From: <edi...@us...> - 2003-08-22 09:05:26
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv23921/src/org/jrman/parser Modified Files: Parser.java Log Message: Implementing first version of polygon Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Parser.java 13 Aug 2003 03:59:38 -0000 1.57 --- Parser.java 22 Aug 2003 09:05:23 -0000 1.58 *************** *** 930,933 **** --- 930,940 ---- } } + + public void addPolygon(final float nPoints, final Map parameters) + { + System.out.println(nPoints); + System.out.println(parameters); + addBilinearPatch(parameters); + } public void addPoints(final Map parameters) { |
From: <edi...@us...> - 2003-08-22 09:05:26
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv23921/src/org/jrman/parser/keywords Modified Files: KeywordPolygon.java Log Message: Implementing first version of polygon Index: KeywordPolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPolygon.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordPolygon.java 7 Apr 2003 08:24:22 -0000 1.2 --- KeywordPolygon.java 22 Aug 2003 09:05:22 -0000 1.3 *************** *** 20,31 **** package org.jrman.parser.keywords; import org.jrman.parser.Tokenizer; public class KeywordPolygon extends MotionKeywordParser { ! public void parse(Tokenizer st) throws Exception { ! // Expect parameter list ! parseParameterList(st); ! } } --- 20,48 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; public class KeywordPolygon extends MotionKeywordParser { ! public void parse(Tokenizer st) throws Exception { ! ! boolean array = false; ! int token = st.nextToken(); ! // Check por array ! if (token == TK_LBRACE) ! array = true; ! else ! st.pushBack(); ! // Expect points number ! match(st, TK_NUMBER); ! float nPoints = (float) st.nval; ! // Expect points and parameters ! Map parameters = parseParameterList(st);; ! if (array) ! match(st, TK_RBRACE); ! parser.addPolygon(nPoints, parameters); ! } ! } |
From: <edi...@us...> - 2003-08-22 09:05:26
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv23921/sampleData Added Files: polygon.rib Log Message: Implementing first version of polygon --- NEW FILE: polygon.rib --- Display "polygon" "framebuffer" "rgba" Format 400 300 1 PixelSamples 1 1 ShadingRate 4 Exposure 1 2.2 Projection "perspective" "fov" 60 Translate 0 0 40 #Rotate -45 1 0 0 WorldBegin LightSource "ambientlight" 1 "intensity" 2 AttributeBegin Color 1 1 1 Patch "bilinear" "P" [-20 -20 0 20 -20 0 -20 20 0 20 20 0] AttributeEnd AttributeBegin Color 0 0 1 Polygon 4 "P" [0 0 -5 5 0 -5 0 5 -5 0 0 -5] AttributeEnd AttributeBegin Color 0 1 0 Polygon 4 "P" [10 10 -2 20 10 -2 10 20 -2 10 10 -2] AttributeEnd WorldEnd |
From: <ma...@us...> - 2003-08-22 04:59:40
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv14612/sampleData Added Files: shadowTest.rib Log Message: First shadows implementation. --- NEW FILE: shadowTest.rib --- Format 1024 1024 1 Display "shadowTest.shdw" "file" "z" PixelSamples 1 1 Projection "orthographic" ScreenWindow -1.2 4.5 -4.5 1.2 Clipping 7 13 Translate 0 0 10 Rotate 45 0 1 0 Rotate -90 1 0 0 WorldBegin Surface "constant" AttributeBegin Translate 1.5 -3 -1 Rotate -20 0 1 0 Scale .3 .3 .3 ReadArchive "bikeData.rib" AttributeEnd AttributeBegin Sphere 1 -1 1 360 AttributeEnd AttributeBegin Translate -1 -2.5 0 Sphere .5 -.5 .5 360 AttributeEnd WorldEnd Declare "shadowmap" "string" Declare "bias" "uniform float" Format 800 600 1 Display "shadowTest" "framebuffer" "rgba" PixelSamples 4 4 Exposure 1 2.2 Projection "perspective" "fov" 40 Clipping .1 1000 ScreenWindow -1.33 1.33 -1 1 LightSource "shadowdistantlight" 1 "intensity" .9 "from" [1 1 0] "to" [0 0 0] "shadowmap" "shadowTest.shdw" "bias" .1 LightSource "ambientlight" 2 "intensity" .1 Rotate -10 1 0 0 Translate 0 0 10 WorldBegin Surface "plastic" AttributeBegin Translate 1.5 -3 -1 Rotate -20 0 1 0 Scale .3 .3 .3 ReadArchive "bikeData.rib" AttributeEnd AttributeBegin Color 1 0 0 Sphere 1 -1 1 360 AttributeEnd AttributeBegin Color 0 1 0 Translate -1 -2.5 0 Sphere .5 -.5 .5 360 AttributeEnd AttributeBegin Translate 0 -3 0 Patch "bilinear" "P" [-30 0 -30 -30 0 30 30 0 -30 30 0 30] AttributeEnd WorldEnd |
From: <ma...@us...> - 2003-08-22 03:44:14
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv14612/src/org/jrman/geom Modified Files: AffineTransform.java PerspectiveTransform.java Log Message: First shadows implementation. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AffineTransform.java 17 Aug 2003 22:05:38 -0000 1.11 --- AffineTransform.java 20 Aug 2003 20:41:21 -0000 1.12 *************** *** 61,66 **** 0f, 0f, ! 1f / (far - near), ! -near / (far - near), 0f, 0f, --- 61,66 ---- 0f, 0f, ! 1, //1f / (far - near), ! 0f, //-near / (far - near), 0f, 0f, Index: PerspectiveTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/PerspectiveTransform.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PerspectiveTransform.java 17 Aug 2003 22:05:39 -0000 1.9 --- PerspectiveTransform.java 20 Aug 2003 20:41:21 -0000 1.10 *************** *** 81,85 **** 0f, fl, 0f, 0f, // 0f, 0f, far / (far - near), (far * near) / (near - far), ! 0f, 0f, 1f, 1f, 0f, 0f, 1f, 0f)); this.near = near; --- 81,85 ---- 0f, fl, 0f, 0f, // 0f, 0f, far / (far - near), (far * near) / (near - far), ! 0f, 0f, 1f, -1f, 0f, 0f, 1f, 0f)); this.near = near; *************** *** 112,116 **** transformHPoint(hpoint); point.project(hpoint); ! point.z = (hpoint. w - near) / (far - near); } --- 112,116 ---- transformHPoint(hpoint); point.project(hpoint); ! // point.z = (hpoint. w - near) / (far - near); } *************** *** 119,123 **** transformHPoint(hpoint); out.project(hpoint); ! out.z = (hpoint.w - near) / (far -near); } --- 119,123 ---- transformHPoint(hpoint); out.project(hpoint); ! // out.z = (hpoint.w - near) / (far -near); } |