I encountered two questions while studying babylon source code(very beautiful I have to say
).
- What does {X} means?
2. Why is there “[0…maxSimultaneousLights]”(looks like array) in this “includes”?
I encountered two questions while studying babylon source code(very beautiful I have to say
).
2. Why is there “[0…maxSimultaneousLights]”(looks like array) in this “includes”?
Those two are related:
#include<lightFragment>[0..maxSimultaneousLights]
means the lightFragment.fx file should be included maxSimultaneousLights times and for the first inclusion the {X} string will be replaced by 0, for the 2nd inclusion {X} will be replaced by 1, …, for the last inclusion {X} will be replaced by maxSimultaneousLights-1.