HLSL effect sequence

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

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...

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 on other sites
It should be as simple as changing

to

where 2 is the factor of brightness you want to multiply by (in this case double).

Share on other sites
Yeah but for stuff that manipulate color, lets say grayscale it doesnt work...

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.

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.

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 10
• 13
• Forum Statistics

• Total Topics
632984
• Total Posts
3009720
• Who's Online (See full list)

There are no registered users currently online

×