• Create Account

### #Actualderrace

Posted 22 November 2012 - 11:18 AM

Ok, I have created a 4x1 png and inserted 4 different coloured pixels. I have changed index from 0 to 3 (or any value for that fact) but it always display the colour of the first pixel. If i change index with the var coords in the tex1D method, and move my sprite, it cycles through the colours when I move, but displays the colour of the first pixel when stationary. Do you have any idea why this is happening?

here's the snippet of my function:

    float4 PixelShaderFunction(float2 coords: TEXCOORD0) : COLOR0
{

float4 colour = tex2D(input, coords);

int index = 0; //doesn't matter what value i put, it always return the first pixel of my palette
float4 lookUp = tex1D(Palette2Sampler,index);
//float4 lookUp = tex1D(Palette2Sampler,coord);
// when I run the above and move the sprite, it cycles through the colours, but always
// displays the colour of the first pixel when stationary.

return lookup;
}


### #1derrace

Posted 22 November 2012 - 11:18 AM

Ok, I have created a 4x1 png and inserted 4 different coloured pixels. I have changed index from 0 to 3 (or any value for that fact) but it always display the colour of the first pixel. If i change index with the var coords in the tex1D method, and move my sprite, it cycles through the colours when I move, but displays the colour of the first pixel when stationary. Do you have any idea why this is happening?

here's the snippet of my function:

PARTNERS