Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering if I can (if possible) make a vertex shader that will always make the pixel shader draw everything in 1 pixel, at position 0,0.

I know this sounds crazy, but it's needed in the situation I'm in right now.

Let's say that I am drawing a line with 2 vertices that each have the color blue. For every vertex, I tried attaching a TEXCOORD that specifies what pixel I want this vertex to be drawn in. However, I can't get this to work.

The reason I am doing this is that I am making experiments where the physics of my game (which is very intensive) is drawn onto a texture, and handled by the GPU.

share|improve this question
up vote 1 down vote accepted

You may want to take a trip over to where they specialize in just what you're doing, offloading a bunch of computation onto graphics processors. And also here where the rubber meets the road.

I realized that that wasn't much of a direct answer except to say that there are nicer API than raw texture map writes. What you're trying to do is entirely possible and in fact there is a whole array of twisty, turny, squeezy, stretchy model manipulations that rely on modified vertex processing. If you render to a quad with an identity projection the correspondence between UV and calculated output pixel remains constant, also set point sampling and other appropriate flags that would modify or post process the output to the texture.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.