Lack of understading on fragment shader?

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?

I want to process the texture line by line in parallel.

What is this obsession you have with things happening “in parallel?” Whether it’s happening in parallel or serially is secondary to whether it’s happening fast.

More to your question, what do you mean by “process”? If you’re talking about the GPGPU stuff you were dealing with in your last thread, you have to do what I said there: make your “processing” look like rendering.

So your first step is to understand how rendering works. You shouldn’t be thinking in terms of “processing” yet; you should be thinking in terms of drawing pictures. Once you have an understanding of how OpenGL works as a renderer, then you can start to figure out how to finesse it into computing whatever algorithm you need to do.

A terse description of the rendering pipeline is available here.

How is the rasterization part convert both geometric and pixel data into fragment? I saw the pipelining. If i sent a texture data, the texture will be stored into the texture memory. The data i pass in should be in array form right? Then, it will pass to rasterization.

Fragments are a rectangular array containing color, depth, line width, point size and antialiasing calculations (GL_POINT_SMOOTH, GL_LINE_SMOOTH, GL_POLYGON_SMOOTH).

I really dun know how they convert the data into fragments that contain those arrays. Confusing…

Actually what is vertex? There are 2 kinds only: pixel data and vertex data. Is vertex means coordinate? What id the difference between vertices and vertex?

Can’t you just do OpenCL/CUDA whatever ?
You seem to be too ignorant of how rendering works to use OpenGL.

May be my lecturer think that it is lack of challenge to use CUDA/openCL since they are purposely designed for GPGPU. So, he picks openGL. There are some paper published about packet filtering using openGL. However, their concepts is too deep for me. I was trying to search an easier method to implement my project only.

Read what is linked in my signature. That should at least get you started.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.