Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to write an anti-aliasing shader in HLSL, but I can't find any way to rasterize at a custom point. (in between pixels on the screen, but not orderly like supersampling)

Is there any way to do this completely in HLSL, or would it require external c++ code?

Currently I am creating a 2nd camera to rasterize my geometry on a screen of 1x1 at this point, and editing it from there, but it feels like this isn't the best way to do this.

share|improve this question

closed as unclear what you're asking by Josh Petrie Dec 17 '13 at 4:47

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If you do it as a post-process, you don't need to "rasterize a custom point". You just sample the rendered scene at whatever coordinates you choose. –  Seth Battin May 6 '13 at 5:55
    
Lets say i have a hole in some geometry so i can see though it. Behind this hole there is a light, but none of the samples actually see though the hole, they get them around it. http://i.imgur.com/UlJ4R8L.gif in this image, the blue points are where it samples the texture, and the yellow area is the hole with the light. How would i re-sample just a single pixel where the hole is? –  Joe Kessler May 6 '13 at 8:14
    
That's not antialiasing, that's drawing things that were never in the scene. Also, you should edit that explanation into your question, so it's clearer what you're trying to accomplish. –  Seth Battin May 6 '13 at 12:27
    
I'm a little confused. I know the light has been passed though my vertex shaders unaltered, because when i move the camera I can occasionally see it, so it must be within the scene. I'm trying to implement a fix in the Pixel shader, specifically performing an additional render at that point to retain the quality of the image. –  Joe Kessler May 6 '13 at 16:47
    
What I'm saying is that, once you're in the pixel shader, anti-aliasing is not going to get that light back out. By definition, anti-aliasing only samples pixels which have been already been drawn (to a rendertarget other than the screen) and smooths their edges. If you want light to appear when it wasn't in that pixel set, you need to do something else. Perhaps you could draw the scene twice with a half-pixel offset, and sample both those renders for your final pixel output to screen. But that is tantamount to supersampling. –  Seth Battin May 6 '13 at 21:47

Browse other questions tagged or ask your own question.