Closed ginkxo closed 4 years ago
Shaders are sent to the GPU as a string, and we concatenate the appropriate function files at runtime before sending them to the GPU. You can look at this file to see which files you have access to in the vertex, tessellation, and fragment shaders for test-05
. This shows that you don't have access to rotate_about_y
, and since you don't submit these data files, you aren't allowed to change them.
Thanks. would it be okay to re-define rotate_about_y in the fragment shader file itself, then?
From the readme:
Unless otherwise noted, do not declare new functions.
You can create a rotation matrix inline if you really feel it's necessary, but if your normals and vertex positions are in the appropriate coordinate spaces, you shouldn't need to do that in the fragment shader. Please take a look at the output specification comments carefully in all the files, since it's easy to miss.
From the readme:
Unless otherwise noted, do not declare new functions.
You can create a rotation matrix inline if you really feel it's necessary, but if your normals and vertex positions are in the appropriate coordinate spaces, you shouldn't need to do that in the fragment shader. Please take a look at the output specification comments carefully in all the files, since it's easy to miss.
How should us rotate the light source without using an rotation matrix?
You can directly model the light position as a function of time.
where can we link the .glsl file to allow the use of this function in lit.fs? A previous issue here a year ago mentioned "fragment" but I can't seem to find this.