How achieve shift operation in Shader
  Home FAQ Contact Sign in
microsoft.public.win32.programmer.directx.graphics.shaders only
 
Advanced search
POPULAR GROUPS

more...

 Up
How achieve shift operation in Shader         

Group: microsoft.public.win32.programmer.directx.graphics.shaders · Group Profile
Author: SanS
Date: Sep 17, 2008 08:41

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.
no comments
diggit! del.icio.us! reddit!