ColorTransformMethod color offsets in wrong range (0-255), should be (0.0-1.0)

Software: Away3D 4.x

Stephen Hopkins, Sr. Member
Posted: 08 July 2011 03:37 AM   Total Posts: 110

I will submit this bug/typo on GitHub too.

ColorTransformMethod.as line 72

override arcane function activate(context Context3DcontextIndex uint) : void
  {
   _colorTransformData[0] 
_colorTransform.redMultiplier;
   
_colorTransformData[1] _colorTransform.greenMultiplier;
   
_colorTransformData[2] _colorTransform.blueMultiplier;
   
_colorTransformData[3] _colorTransform.alphaMultiplier;
   
_colorTransformData[4] _colorTransform.redOffset;
   
_colorTransformData[5] _colorTransform.greenOffset;
   
_colorTransformData[6] _colorTransform.blueOffset;
   
_colorTransformData[7] _colorTransform.alphaOffset;
   
context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT_colorTransformIndex_colorTransformData2);
  

the ColorTransform class asks for offsets between -255 and 255. However the shading code uses colors between 0 and 1. Additional code needs to be added to convert the offsets to the correct range.

Maybe this - not sure if the boundary conditions matter for the shader.

_colorTransformData[4] _colorTransform.redOffset 0xff;
   
_colorTransformData[5] _colorTransform.greenOffset 0xff;
   
_colorTransformData[6] _colorTransform.blueOffset 0xff;
   
_colorTransformData[7] _colorTransform.alphaOffset 0xff
 Signature 

http://www-scf.usc.edu/~shopkins

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X