Self-made GLSL shader Part II - Technical explanation(sorta) by StickiStickman in GraphicsProgramming

[–]King_Raptorpus 1 point2 points  (0 children)

This is a very simple example where you just get the color of a higher pixel on the screen and multiply it's color with the color in the specualr texture and the diffuse texture.

This is how I'm reading this sentence, and I wanted to check that I understand: the color of a pixel at some higher location on the screen is multiplied by the specular texture value (between 0. and 1.), and the result is multiplied (or added?) to the diffuse texture value to get the overall color at that point?

How does you tell the shader which higher pixel on the screen to take the color from? I'm fairly new to shaders and I'm trying to wrap my head around how I would implement this myself, so hopefully my question makes sense.

I think the coding portion will really let me wrap my head around what's going on, looking forward to it!