Sign in to follow this  
m35hnvfn

DirectX Tweaker post process filters (request)

Recommended Posts

I have one good tool that can manipulate with dx games: DirectX Tweaker And this tool alow 2 force post process filters for almost any Dx 8 and 9 game. By unfortunely with tool included just 3 filters: blind copy (dunno what it change didnt c any effect), sephia, and greyscale. There are source of filters:
//Blind copy:
<Effect Display="Blind Copy">
  <Pass Destination="Display">
    <Source Sampler="0" Name="Backbuffer"/>
    <PixelShader>
      <![CDATA[
      ps_2_0
      dcl_2d s0
      dcl t0.xy   
      texld r0, t0, s0
      mov oC0,r0    
      ]]>
    </PixelShader>
  </Pass>
</Effect>
//
//Greyscale:
<Effect Display="Greyscale">
  <Pass Destination="Display">
    <Source Sampler="0" Name="Backbuffer"/>
    <FConst Start="0">
      <Vector X="0.30" Y="0.59" Z="0.11" W="1.0"/> 
    </FConst>
    <PixelShader>
      <![CDATA[
      ps_2_0
      dcl_2d s0
      dcl t0.xy   
      texld r0, t0, s0
      dp3 r0,r0,c0
      mov oC0,r0    
      ]]>
    </PixelShader>
  </Pass>
</Effect>
//
//Sepia:
<Effect Display="Sepia">
  <Pass Destination="Display">
    <Source Sampler="0" Name="Backbuffer"/>
    <FConst Start="0">
      <Vector X="0.30" Y="0.59" Z="0.11" W="1.0"/> 
      <Vector X="0.02" Y="0.02" Z="0.02" W="0.0"/> 
      <Vector X="5.8731" Y="2.38095" Z="1.0" W="1.0"/> 
    </FConst>
    <PixelShader>
      <![CDATA[
      ps_2_0
      dcl_2d s0
      dcl t0.xy   
      texld r0, t0, s0
      dp3 r0,r0,c0
      mul r0,r0,r0
      sub_sat r0,r0,c1
      add r0,r0,c1
      mul r0,r0,c2
      mov oC0,r0    
      ]]>
    </PixelShader>
  </Pass>
</Effect>
well, would be nice 2 if someone will make lot of other filters such as BLOOM (i need it so much). Post them here please. [Edited by - m35hnvfn on August 30, 2005 4:05:13 PM]

Share this post


Link to post
Share on other sites
Bloom is significantly more complex effect than the three ones you've shown. First of all, physically correct blooming requires that the original render target has "overbright" colors - any current game or card does not support floating-point backbuffers (even though HDR transfer to textures is acceptable) so you're out of luck here.

Secondly, if you want to emulate true high dynamic range, you still have to store the extra lighting range information somewhere. Games do not usually do this unless they implement the filter themselves.

Thirdly, if you still want a bloom effect with the limited access to the original data, it's going to be a very complex shader and it still doesn't look "real" even though you might be able to get a good fake effect.

Do you know how to do blurring in a pixel shader? You could try to program the effect yourself.

Share this post


Link to post
Share on other sites
Quote:
Original post by m35hnvfn
realy dont know how 2 do it for this tool.
but maybe some one can do easy motionblur and some other nice filters?


A motion blur shader would also need more data than is available from the backbuffer color. To motion blur something, you'd need the per-pixel motion vectors so you could calculate the blur length and directions.

Uniform Gaussian blur would be achievable using only the color information, since the function doesn't vary per pixel, though.

By the way, you could use HLSL to write a shader, compile it with the fxc.exe tool that comes with the DirectX SDK, and paste the resulting assembly code to the tweaker effect. This way, writing shaders becomes quite easy if you understand c-style languages and basic shader concepts.

Various shaders can be found around the internet, for example in ATI's or NVidia's developer relations sites. Just remember that you only have the backbuffer color as the source data for the shaders when using the tweaker tool (as far as I can tell).

Share this post


Link to post
Share on other sites

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