Today, to my Blinn-Phong shader, I added light attenuation for point lights and started implementing spotlights. I want the shader to deduce what type of light it is from the parameters, minimising the use of if-else statements as much as possible. So far it works well but needs fine-tuning.
top of page
TOMASZ WALAT
Search
Mar 24, 20221 min read
Today I implemented camera movement into my shaders tool - I based it on my code from last semester's module. The camera is in arcball style, and although not 100% perfect, it does the job.
Additionally, I added Blinn-Phong shaders to my program's list of shaders. Rather than having a single shader, I opted for the ability to change them at runtime so that:
I learn how to handle multiple shader programs and how to dynamically swap them
I'm not overriding and deleting previous work (I mean I am using GitHub so this is not actually a big deal)
it helps me understand what's going on if something with a new shader is not looking right (i.e. compare and contrast)
Of course, I couldn't resist also having a flat version of each one - I'll have to trim down on the amount of shaders for the final product (especially since some of them are unnecessary - I'm looking at you flat Phong).
0 views0 comments
Mar 23, 20221 min read
Updated: Mar 24, 2022
Today I added functionality to my shader tool to compile multiple shader programs and change them at runtime. The next step is to utilise a uniform buffer object so all uniforms don't have to be unnecessary set with every shader change.
0 views0 comments
bottom of page