A comment at the end of shader.c says “there are many ways to add the light shaders.” What different ways are there?
There are at least two ways of doing this. If you like, you can create a global pointer to a light shader, and call that from within each of your surface shaders to figure out how much light is incident on the surface from each of the lights. Alternatively, you can duplicate the code from one of your surface shaders, and insert your light shader code into that. The former is more general, since then it’s possible to combine any of your light shaders with any of your surface shaders; however, the latter is fine too. We will accept code written either way. If you’re feeling really ambitious, you can try creating a light shader pointer for every light, so that each light can be of a different type.
Related Questions
- For objects moving away but not directly away in our light of sight, could we take measurements from different parts of the Earth and compare the readings to figure out precise velocity?
- In light of this view, how can the media portray the different cultural and religious groups without falling into generalizations?
- A comment at the end of shader.c says "there are many ways to add the light shaders." What different ways are there?
A comment at the end of shader.c says “there are many ways to add the light shaders.” What different ways are there?