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;
'
I've posted this on the away3d forums as well.
ColorTransformMethod.as line 72
override arcane function activate(context : Context3D, contextIndex : 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, _colorTransformData, 2); }
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; '