Sign in to follow this  

HLSL effect sequence

This topic is 2851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am new in HLSL and I m trying to sort things out. I m texturizing a triangle strip in my PixelShader to create a picture using:
float4 PixelShader(VertexOut input) : COLOR0
float4 color;
color = tex2D( ColoredTextureSampler, input.textureCoordinates.xy)*2;
return color;
The *2 makes the picture brighter. My problem is that after that I want to blur the image using a 3x3 kernel so I created another method doing:
float4 Blur(VertexOut input) : COLOR0
float4 k11 = tex2D( ColoredTextureSampler, input.textureCoordinates.xy + float2(-1,-1));
etc...
return addedStuff/9; :P
but I don't get the picture any brighter only blurred, I suppose that the input uses the normal texture that is not brightened... So how do I get it both brightened and blurred?

Share this post


Link to post
Share on other sites
addedStuff is a float4 representing a color, isn't it? You can do whatever you want with it, including turning it grayscale.

addedStuff.rgb = (addedStuff.r + addedStuff.g + addedStuff.b) / 3.0f;

Share this post


Link to post
Share on other sites
yeah but lets say I add an effect afterwards that blurs the picture lets say using:

tex2D( ColoredTextureSampler, input.textureCoordinates.xy);

only the latter effect remains, meaning it will only be blurred not grayscale and order is important.

Share this post


Link to post
Share on other sites

This topic is 2851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this