Advertisement
andrefmandrade

Untitled

Jun 1st, 2020
1,207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #define FXAA_PRESET 3
  2. #define FXAA_HLSL_4 1
  3. #include “FxaaShader.h”
  4. cbuffer cbFxaa : register(b1) {
  5. float4 rcpFrame : packoffset(c0); };
  6. struct FxaaVS_Output {
  7.  float4 Pos : SV_POSITION;
  8.  float2 Tex : TEXCOORD0; };
  9. FxaaVS_Output FxaaVS(uint id : SV_VertexID) {
  10.  FxaaVS_Output Output;
  11.  Output.Tex = float2((id << 1) & 2, id & 2);
  12.  Output.Pos = float4(Output.Tex * float2(2.0f, -2.0f) +
  13.  float2(-1.0f, 1.0f), 0.0f, 1.0f);
  14.  return Output; }
  15. SamplerState anisotropicSampler : register(s0);
  16. Texture2D inputTexture : register(t0);
  17. float4 FxaaPS(FxaaVS_Output Input) : SV_TARGET {
  18.  FxaaTex tex = { anisotropicSampler, inputTexture };
  19.  return float4(FxaaPixelShader(
  20.  Input.Tex.xy, tex, rcpFrame.xy), 1.0f); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement