SanS
2008-09-17 15:41:52 UTC
Hi all.
My doubt is how achieve shift operation in Shader.
// CPU code.
byte lsbValue;
byte msbValue;
short t = ( msbValue<<8) + lsbValue;
// How to achieve this in shader.
float fmsb;
float flsb;
float fShortValue = ( ( fmsb * MAXVALUE) *MAXVALUE + flsb*MAXVALUE ) /
( MAXVALUE*MAXVALUE )
where maxVALUE IS maximum value of a component ( say 256 )
is it correct.
My doubt is how achieve shift operation in Shader.
// CPU code.
byte lsbValue;
byte msbValue;
short t = ( msbValue<<8) + lsbValue;
// How to achieve this in shader.
float fmsb;
float flsb;
float fShortValue = ( ( fmsb * MAXVALUE) *MAXVALUE + flsb*MAXVALUE ) /
( MAXVALUE*MAXVALUE )
where maxVALUE IS maximum value of a component ( say 256 )
is it correct.