rendering pixels to a big 2Dtexture

Started by
0 comments, last by Ripiz 11 years, 6 months ago
Rendering pixels to a big 2Dtexture using drawInstance() with pointlist, and one vertex in the vertex buffer that will define the location of the pixel rendering to in the vertex shader.
I have problems defining the position of the pixel in the vertex shader,
having (x,y,z,w) for the POSITION that returns the vertex shader and defines the pixel rendered, is there any way i can make x and y be directly the number of the pixel, making (x,y)-(0.0f,0.0f) the top left corner of the texture and (width-1.0f,height-1.0f) the buttom right?
Its because using (-1,1) top left (1,-1)buttom right, I will have to make the conversion and when the texture is big i have to divide big numbers and i think i am having some float errors there.
Advertisement
You need to create orthographic matrix. Google will help to create it if your algebra library doesn't support it.

This topic is closed to new replies.

Advertisement