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 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
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

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.