6 reputation
1
bio website youtube.com/derrace
location
age
visits member for 1 year, 11 months
seen Nov 23 '12 at 9:00

Nov
22
comment HLSL Pixel Shader that does palette swap
hmm, how do u insert code in the new comments? It wraps all my lines up =\. Anyway, the main gist of the code is: int2 index = int2(colour.r,0); float4 lookUp = tex2D(PaletteSampler,index); the 2nd param for tex2D, is the pixel coordinate relative to the size of texture I have passed in for PaletteSampler? I am asking because it's returning me a different colour.
Nov
22
comment HLSL Pixel Shader that does palette swap
Hi Blau, I am passing in 2 palettes, one the default of the sprite, and the other a lookup. When the function is called, I am comparing the RGB of that pixel with the default palette to determine the location, so that I can grab the colour I want from the look up. But this involves using a loop. With your suggestion, Assuming my red channel is unique for my base sprite and my colour table has 15 RGB values, would that mean I would have (255-15) empty values as I would only sample 15 values of Red?
Nov
22
comment HLSL Pixel Shader that does palette swap
Hmm, think I got it, It involves using a for loop to cycle through the a variant of the above code but I am getting this silly error now =( Shader uses texture addressing operations in a dependency chain that is too complex for the target shader model (ps_2_0) to handle.