Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

A comment at the end of shader.c says “there are many ways to add the light shaders.” What different ways are there?

comment different light shaders
0
Posted

A comment at the end of shader.c says “there are many ways to add the light shaders.” What different ways are there?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123