Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r473 - branches/itanium2/Model/Materials


Chronological Thread 
  • From: hansong@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r473 - branches/itanium2/Model/Materials
  • Date: Tue, 16 Aug 2005 10:58:10 -0600 (MDT)

Author: hansong
Date: Tue Aug 16 10:58:08 2005
New Revision: 473

Modified:
   branches/itanium2/Model/Materials/CopyColorMaterial.cc
Log:
fix extraction of color from integer

Modified: branches/itanium2/Model/Materials/CopyColorMaterial.cc
==============================================================================
--- branches/itanium2/Model/Materials/CopyColorMaterial.cc      (original)
+++ branches/itanium2/Model/Materials/CopyColorMaterial.cc      Tue Aug 16 
10:58:08 2005
@@ -30,11 +30,12 @@
                RayPacket::Element& e = rays.get(i);
                
                unsigned int payload = e.hitInfo.scratchpad<unsigned int>();
-               unsigned char *c = (unsigned char *)&payload;
+               // unsigned char *c = (unsigned char *)&payload;
                
-               Color result( RGB((float)c[0]*0.0039f,
-                                                                           
(float)c[1]*0.0039f,
-                                                                           
(float)c[2]*0.0039f ));
+               Color result( RGB(
+                                       ((payload & 0x00ff0000)>>16)*0.0039f,
+                                       ((payload & 0x0000ff00)>>8)*0.0039f,
+                                       ((payload & 0x000000ff))*0.0039f));
                
                rays.setResult( i, result );
        }




  • [MANTA] r473 - branches/itanium2/Model/Materials, hansong, 08/16/2005

Archive powered by MHonArc 2.6.16.

Top of page