Revision: 20299
          http://sourceforge.net/p/jmol/code/20299
Author:   hansonr
Date:     2015-02-17 11:36:25 +0000 (Tue, 17 Feb 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.2.12_2015.02.17"

new feature: set zshadePower 0
 -- allows examination of depth buffer and writing to image for external 
processing
 

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/g3d/Graphics3D.java
    trunk/Jmol/src/org/jmol/g3d/PixelatorShaded.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties
    trunk/Jmol/src/org/jmol/viewer/Viewer.java

Modified: trunk/Jmol/src/org/jmol/g3d/Graphics3D.java
===================================================================
--- trunk/Jmol/src/org/jmol/g3d/Graphics3D.java 2015-02-16 19:13:29 UTC (rev 
20298)
+++ trunk/Jmol/src/org/jmol/g3d/Graphics3D.java 2015-02-17 11:36:25 UTC (rev 
20299)
@@ -378,6 +378,11 @@
       if (isPass2 && pbufT != null)
         for (int offset = pbufT.length; --offset >= 0;)
           mergeBufferPixel(pbuf, offset, pbufT[offset], bgcolor);
+      
+      if (pixelShaded != null && pixelShaded.zShadePower == 0)
+        pixelShaded.showZBuffer();
+      
+
       //      if (ambientOcclusion != 0) {
       //        if (aobuf == null)
       //          aobuf = new int[pbuf.length];
@@ -391,6 +396,7 @@
         downsampleFullSceneAntialiasing(false);
     }
     platform.setBackgroundColor(bgcolor);
+
     platform.notifyEndOfRendering();
     //setWidthHeight(antialiasEnabled);
     currentlyRendering = false;

Modified: trunk/Jmol/src/org/jmol/g3d/PixelatorShaded.java
===================================================================
--- trunk/Jmol/src/org/jmol/g3d/PixelatorShaded.java    2015-02-16 19:13:29 UTC 
(rev 20298)
+++ trunk/Jmol/src/org/jmol/g3d/PixelatorShaded.java    2015-02-17 11:36:25 UTC 
(rev 20299)
@@ -33,7 +33,8 @@
 
 
   private int[] bgRGB, tmp;
-  private int zSlab, zDepth, zShadePower;
+  private int zSlab, zDepth;
+  int zShadePower;
 
   /**
    * @param g
@@ -77,4 +78,13 @@
     }
     p0.addPixel(offset, z, p);
   }
+
+  void showZBuffer() {
+    for (int i = p0.zb.length; --i >= 0;) {
+      if (p0.pb[i] == 0) // ignore background
+        continue; 
+      int z = (int) Math.min(255, Math.max(0, 255f * (zDepth - p0.zb[i]) / 
(zDepth - zSlab)));
+      p0.pb[i] = 0xFF000000 | z | (z << 8) | (z << 16);
+    }
+  }
 }
\ No newline at end of file

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-16 19:13:29 UTC 
(rev 20298)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-17 11:36:25 UTC 
(rev 20299)
@@ -15,8 +15,13 @@
 TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT 
command for problems)
 TODO: add 2D graphics panel for Ramachandran and NBO-style 2D graphics -- send 
to browser as data uri?
 
-Jmol.___JmolVersion="14.2.12_2015.02.16"
+Jmol.___JmolVersion="14.2.12_2015.02.17"
 
+new feature: set zshadePower 0
+ -- allows examination of depth buffer and writing to image for external 
processing
+ 
+JmolVersion="14.2.12_2015.02.16"
+
 new feature:  x.dot(y) for planes and points -- was present but undocumented 
and not working correctly
 new feature: (undocumented) x.distance.all(y)
 

Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Viewer.java  2015-02-16 19:13:29 UTC (rev 
20298)
+++ trunk/Jmol/src/org/jmol/viewer/Viewer.java  2015-02-17 11:36:25 UTC (rev 
20299)
@@ -5791,7 +5791,7 @@
       tm.slabToPercent(value);
       break;
     case T.zshadepower:
-      g.zShadePower = Math.max(value, 1);
+      g.zShadePower = value = Math.max(value, 0);
       break;
     case T.ribbonaspectratio:
       g.ribbonAspectRatio = value;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to