Coloring certain parts of the object

Take a look a the video below:

In this video, a beam of photons hits a 2D white plane. What I need to do is to change the white color to another one in localizations, where the photons hit the 2D plane. The goal is to get the visual distribution of photons in the beam on the 2D plane. I want to obtain something like in the figure below:

How can I obtain this?
For now, the 2D plane’s white color is given through an uniform, which is passed to output color in the fragment shader. From what I know, the white color is set on the vertices and it is interpolated onto the rest of the plane’s pixels. But how to set a color on specific parts of the plane?

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