Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Edge-Friend: Fast and Deterministic Catmull-Clark Subdivision Surfaces
    • 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
    • Real-Time Procedural Generation with GPU Work Graphs
    • Scalable rendering for very large meshes
    • Spatiotemporal Variance-Guided Filtering for Motion Blur
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
    • Towards Practical Meshlet Compression
  • 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

  • Data formats: Why CSV and JSON aren't the best
    Posted on 2024-12-29
  • Replacing cron with systemd-timers
    Posted on 2024-04-21
  • Open Source Maintenance
    Posted on 2024-04-02
  • Angular, Caddy, Gunicorn and Django
    Posted on 2023-10-21
  • Effective meetings
    Posted on 2022-09-12
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

Anteru NIV_Anteru
Contents © 2005-2025
Anteru
Imprint/Impressum
Privacy policy/Datenschutz
Made with Liara
Last updated February 03, 2019