• Advertisement
Sign in to follow this  

rendering to one pixel

This topic is 1368 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 want to render to only one pixel of a texture 

So this is done using one vertex, drawing it using the D3D10_PRIMITIVE_TOPOLOGY_POINTLIST

and then the SV_Position value will depend on wich pixel I want to render

The problem is that if this SV_Position value is in the middle of 2 pixels, two pixels get rendered and I just want one pixel always to be rendered

Is there code that configures the API to only render one pixel instead of two?

Edited by lomateron

Share this post


Link to post
Share on other sites
Advertisement
The answer is pretty obvious. You cannot render a pixel in the middle of two raster positions without splitting it up somehow. Therefor, you need to avoid that situation and always render to a single raster position.

There are multiple ways to do this, depending on what kind of projection you are using and how many of these guys you want to render. If you use orthogonal projection and just "a few" (number depends on kind and power of the hardware used) pixels, just trim off any fractions of the position on the CPU or in the vertex shader.

If you use perspective projection, either do the projection on the CPU and trim, or again, use the vertex shader.

For a more detailed answer you'll need to provide more details!

I hope that helps!

Share this post


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

  • Advertisement