Rendering one quad for every pixel

Started by
4 comments, last by Starfox 12 years, 4 months ago
I'm trying to render one quad over every pixel in the screen, and my code: http://pastebin.com/AwY0yfyq Doesn't seem to be working. It works when I render one point with point size 1 at the center of every pixel, but not with quads. Any idea what I'm doing wrong?
Holy crap I started a blog - http://unobvious.typepad.com/
Advertisement
Uh, maybe what you're doing wrong is trying to rasterize a one pixel quad? That doesn't make sense -- what are you trying to accomplish here? (That said I'm not exactly sure why this doesn't work as written...)
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Nah, I'm quite certain that *IS* what I want to do. It's a learning exercise. It's just that I don't know how to do it as you can see..
Holy crap I started a blog - http://unobvious.typepad.com/
Can you post the missing bits of relevant code, like HalfPixelNDCDimensions, PixelDimensions, etc...

I would guess that either your quads are backfacing (with backface culling enabled), or they're not covering the pixel sample locations.
What happens if you simply enlarge the quads to a more sane scale?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
You know what, I actually did that before you mentioned it and they seem to occupy a grid pattern with gaps. However when I change the quad coordinates calculation code to this it works perfectly:



const float2 PixelLowerLeft = (CurrentPixelNormalized + float2(-HalfPixelDimensions.x, -HalfPixelDimensions.y)) * float2(2.0, 2.0) - float2(1.0, 1.0);
const float2 PixelLowerRight = (CurrentPixelNormalized + float2(HalfPixelDimensions.x, -HalfPixelDimensions.y)) * float2(2.0, 2.0) - float2(1.0, 1.0);
const float2 PixelUpperRight = (CurrentPixelNormalized + float2(HalfPixelDimensions.x, HalfPixelDimensions.y)) * float2(2.0, 2.0) - float2(1.0, 1.0);
const float2 PixelUpperLeft = (CurrentPixelNormalized + float2(-HalfPixelDimensions.x, HalfPixelDimensions.y)) * float2(2.0, 2.0) - float2(1.0, 1.0);


Any idea why that is though?
Holy crap I started a blog - http://unobvious.typepad.com/

This topic is closed to new replies.

Advertisement