Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualiedoc

Posted 23 January 2012 - 11:25 PM

return float4(finalColor.a, 0, 0, 1);

this will return red. you should do it like this:

return float4(Red, Green, Blue, Alpha);

if your just trying to return the color of the texel in the sprite sheet with the alpha value, you can just do this:

return finalColor;

if you just want to completely not draw the transparent parts, you can clip, or stop pixels with a certain alpha value from even getting processed like this:

float4 finalColor = gSpriteSheet.Sample(PointSampler, input.texcoord);
clip(finalColor.a - .25);
return finalColor;

so anything with an alpha value of .25 or less will not be rendered.

#5iedoc

Posted 23 January 2012 - 11:24 PM

return float4(finalColor.a, 0, 0, 1);

this will return red. you should do it like this:

return float4(Red, Green, Blue, Alpha);

if your just trying to return the color of the texel in the sprite sheet with the alpha value, you can just do this:

return finalColor;

if you just want to completely not draw the transparent parts, you can clip, or stop pixels with a certain alpha value from even getting processed like this:

float4 finalColor = gSpriteSheet.Sample(PointSampler, input.texcoord);
clip(finalColor.a - .25);
return finalColor;

#4iedoc

Posted 23 January 2012 - 11:24 PM

return float4(finalColor.a, 0, 0, 1);

this will return red. you should do it like this:

return float4(Red, Green, Blue, Alpha);

if your just trying to return the color of the texel in the sprite sheet with the alpha value, you can just do this:

return finalColor;

if you just want to completely not draw the transparent parts, you can clip, or stop pixels with a certain alpha value from even getting processed like this:

float4 finalColor = gSpriteSheet.Sample(PointSampler, input.texcoord);
clip(alpha - .25);
return finalColor;

#3iedoc

Posted 23 January 2012 - 11:21 PM

return float4(finalColor.a, 0, 0, 1);

this will return red. you should do it like this:

return float4(Red, Green, Blue, Alpha);

if your just trying to return the color of the texel in the sprite sheet with the alpha value, you can just do this:

return finalColor;

#2iedoc

Posted 23 January 2012 - 11:21 PM

return float4(finalColor.a, 0, 0, 1);

this will return red. you should do it like this:

return float4(Red, Green, Blue, Alpha);

if your just trying to return the color of the texel in the sprite sheet with the alpha value, you can just do this:

return pixelColor;

#1iedoc

Posted 23 January 2012 - 11:19 PM

return float4(finalColor.a, 0, 0, 1);

this will return red. you should do it like this:

return float4(Red, Green, Blue, Alpha);

PARTNERS