From: Gerardo H. <ma...@us...> - 2006-12-06 17:17:15
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4593/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Implemented "truedisplacement" attribute. Now renders killeroo without cracks. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** RendererHidden.java 14 Nov 2005 02:51:32 -0000 1.72 --- RendererHidden.java 6 Dec 2006 17:17:10 -0000 1.73 *************** *** 34,37 **** --- 34,38 ---- import org.jrman.geom.Plane; import org.jrman.geom.Transform; + import org.jrman.grid.Point3fGrid; import org.jrman.maps.ShadowMap; import org.jrman.options.CameraProjection; *************** *** 115,118 **** --- 116,121 ---- private boolean rendering; + private Point3fGrid pointsTmp; + public void init(Frame frame, World world, Parser parser) { super.init(frame, world, parser); *************** *** 128,131 **** --- 131,135 ---- createBuckets(); samplesFilter = frame.getFilter().getSamplesFilter(); + pointsTmp = new Point3fGrid(); worldParseStart = System.currentTimeMillis(); } *************** *** 343,348 **** Attributes attr = p.getAttributes(); DisplacementShader ds = attr.getDisplacement(); ! if (ds != null) ds.shade(shaderVariables); if (cameraToRaster.isPerspective()) shaderVariables.I.set(shaderVariables.P); --- 347,359 ---- Attributes attr = p.getAttributes(); DisplacementShader ds = attr.getDisplacement(); ! if (ds != null) { ! Attributes attrShader = ds.getAttributes(); ! boolean ts = attrShader.getTrueDisplacement(); ! if (!ts) ! pointsTmp.set(shaderVariables.P); ds.shade(shaderVariables); + if (!ts) + shaderVariables.P.set(pointsTmp); + } if (cameraToRaster.isPerspective()) shaderVariables.I.set(shaderVariables.P); |