From: Gerardo H. <ma...@us...> - 2007-02-26 19:36:00
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30698/src/org/jrman/shaders Modified Files: DisplacementBumpy.java DisplacementShader.java Imager.java LightAmbientlight.java LightDistantlight.java Log Message: Check for Catmull Clark scheme before trying to instance a Subdivision Mesh. Started reformatting source code to fit in 80 columns, remove tabs and ugly formatting done by Eclipse. Index: LightAmbientlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightAmbientlight.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LightAmbientlight.java 25 Nov 2003 16:34:08 -0000 1.3 --- LightAmbientlight.java 26 Feb 2007 19:35:52 -0000 1.4 *************** *** 1,19 **** /* ! LightAmbientlight.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. */ --- 1,19 ---- /* ! LightAmbientlight.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. */ *************** *** 38,44 **** protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("lightcolor", "uniform color"), 1f, 1f, 1f)); } --- 38,48 ---- protected void initDefaults() { defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("intensity", ! "uniform float"), ! 1f)); defaultParameters.addParameter( ! new UniformScalarTuple3f(new Declaration("lightcolor", ! "uniform color"), ! 1f, 1f, 1f)); } *************** *** 47,55 **** } ! public boolean shade(ShaderVariables sv, Point3fGrid P, Vector3fGrid N, float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); ! UniformScalarTuple3f paramLightcolor = (UniformScalarTuple3f) getParameter(sv, "lightcolor"); paramLightcolor.getValue(c1); c1.x *= intensity; --- 51,62 ---- } ! public boolean shade(ShaderVariables sv, Point3fGrid P, Vector3fGrid N, ! float angle) { super.shade(sv, P, N, angle); ! UniformScalarFloat paramIntensity = ! (UniformScalarFloat) getParameter(sv, "intensity"); float intensity = paramIntensity.getValue(); ! UniformScalarTuple3f paramLightcolor = ! (UniformScalarTuple3f) getParameter(sv, "lightcolor"); paramLightcolor.getValue(c1); c1.x *= intensity; Index: Imager.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/Imager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Imager.java 25 Nov 2003 16:34:08 -0000 1.3 --- Imager.java 26 Feb 2007 19:35:52 -0000 1.4 *************** *** 1,19 **** /* ! Imager.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. */ --- 1,19 ---- /* ! Imager.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. */ Index: DisplacementBumpy.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/DisplacementBumpy.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DisplacementBumpy.java 13 Apr 2004 20:37:03 -0000 1.6 --- DisplacementBumpy.java 26 Feb 2007 19:35:52 -0000 1.7 *************** *** 1,20 **** /* ! DisplacementBumpy.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 org.jrman.grid.FloatGrid; --- 1,21 ---- /* ! DisplacementBumpy.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 org.jrman.grid.FloatGrid; *************** *** 38,54 **** new UniformScalarFloat(new Declaration("Km", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("texturename", "string"), "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"),0f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKm = (UniformScalarFloat) getParameter(sv, "Km"); final float Km = paramKm.getValue(); UniformScalarString paramTexturename = (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); ! UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); final float blur = paramBlur.getValue(); if (!texturename.equals("")) --- 39,59 ---- new UniformScalarFloat(new Declaration("Km", "uniform float"), 1f)); defaultParameters.addParameter( ! new UniformScalarString(new Declaration("texturename", "string"), ! "")); defaultParameters.addParameter( ! new UniformScalarFloat(new Declaration("blur", "uniform float"), ! 0f)); } public void shade(ShaderVariables sv) { super.shade(sv); ! UniformScalarFloat paramKm = ! (UniformScalarFloat) getParameter(sv, "Km"); final float Km = paramKm.getValue(); UniformScalarString paramTexturename = (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); ! UniformScalarFloat paramBlur = ! (UniformScalarFloat) getParameter(sv, "blur"); final float blur = paramBlur.getValue(); if (!texturename.equals("")) Index: DisplacementShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/DisplacementShader.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DisplacementShader.java 11 Jan 2006 06:23:23 -0000 1.7 --- DisplacementShader.java 26 Feb 2007 19:35:52 -0000 1.8 *************** *** 1,19 **** /* ! DisplacementShader.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. */ --- 1,19 ---- /* ! DisplacementShader.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. */ *************** *** 39,45 **** DisplacementShader result; String className = ! "Displacement" + name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase(); try { ! result = (DisplacementShader) Class.forName(className).newInstance(); } catch (Exception e) { try { --- 39,47 ---- DisplacementShader result; String className = ! "Displacement" + name.substring(0, 1).toUpperCase() + ! name.substring(1).toLowerCase(); try { ! result = (DisplacementShader) ! Class.forName(className).newInstance(); } catch (Exception e) { try { *************** *** 49,53 **** .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown displacement shader: " + name); } } --- 51,56 ---- .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown displacement shader: " ! + name); } } Index: LightDistantlight.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightDistantlight.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LightDistantlight.java 16 Sep 2004 04:16:42 -0000 1.5 --- LightDistantlight.java 26 Feb 2007 19:35:52 -0000 1.6 *************** *** 1,19 **** /* ! LightDistantlight.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. */ --- 1,19 ---- /* ! LightDistantlight.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. */ |