Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Scalable rendering for very large meshes
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
  • About
  • Archive

Debugging shaders: Artifacts grouped into quads

November 29, 2008
  • Graphics
  • Programming
approximately 1 minutes to read

If you’re debugging a shader, and the wrong pixels come grouped into (screen-aligned) 2x2 blocks, don’t look too long at the code at hand – it might be that your gradients are wrong. Recently, I had a shader aliasing problem, which I couldn’t track down properly. Even after hours of debugging with PIX, the shader output was still wrong for some reason. It was not a float-point precision problem, because even with Load (which uses integer coordinates and does no sampling), things wouldn’t change.

I went so far that I computed the texture lookups on paper and performed filtering by hand, just to check that the UVs and so were right. Well, everything was right, except the gradients, which were way off and resulting in some blurred pixels - always grouped into 2x2, and aligned with the screen. As I didn’t have them computed explicitly, there way no easy way to visualize them, and hence I missed them for several hours straight.

Previous post
Next post

Recent posts

  • Five years of GPU DB
    Posted on 2020-09-27
  • Enabling SSL in your local network
    Posted on 2020-05-17
  • Goodbye, Bitbucket!
    Posted on 2020-03-19
  • QEMU, KVM and trim
    Posted on 2020-01-26
  • Fixing network after Ubuntu 19.04 to 19.10 upgrade
    Posted on 2019-10-26
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

NIV_Anteru

Contents © 2005-2021 | Anteru | Imprint/Impressum | Privacy policy/Datenschutz