0
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You may want to take a trip over to http://gpgpu.org/ where they specialize in just what you're doing, offloading a bunch of computation onto graphics processors. And also here http://www.khronos.org/opencl/ 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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .