Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lack of understanding on fragment shader?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 SagoO   Members   -  Reputation: 100

Like
0Likes
Like

Posted 24 March 2011 - 10:47 PM

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?

Sponsor:

#2 Katie   Members   -  Reputation: 1284

Like
0Likes
Like

Posted 05 April 2011 - 01:39 AM

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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS