• Advertisement
Sign in to follow this  

Rendering one quad for every pixel

This topic is 2262 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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...)

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement