🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Lack of understanding on fragment shader?

Started by
0 comments, last by Katie 13 years, 2 months ago
I have a texture 2048x2048.
I want to process the texture line by line in parallel. But I dun know how to program my shader program.
Shader can be used to process each vertex in parallel. But I dun understand how it works? Can anyone explain further?
Advertisement
The basis for understanding how shaders work is to imagine that your graphics card has *hundreds* of teeny-tiny processors in it. When you hand a list of verticies off to the vertex shader, each processor works on ONE of the verticies. On their own.

Likewise, each pixel processor running your pixel shader gets to work on ONE of the output pixels -- thousands of them in each triangle.

So those programs need to written as if they're the only thing happening. In other words; you don't need to worry about the "line-by-line" thing. You only need to worry about what happens for each individual pixel.

Could you perhaps elaborate a little more on what it is you're trying to achieve?

This topic is closed to new replies.

Advertisement