Wednesday, October 28, 2009

GLSL Shaders


I decided to start spending most of the day rewriting all the GLSL shaders provided with the Leadwerks Engine version 2.27. I have several reasons for doing so and none of it is really geared towards optimization.


The first most reason is to learn the structure. I've always jumped right into several sections (included files) added/editing/deleting when I felt the need to do so, without actually knowing much about the shader, and therefore the main reason is for self-education about the shaders as a whole.


The second reason is while I was writing up my day/night cycle, I had looked at several shaders for the purpose of creating my main day/night cycle shader, and found a couple very minor mistakes. These minor mistakes are things like misspellings, defining something like "varying vec4 projectSpace;" but within the main portion of the code using "projectspace."


Third reason is to reorganize the whole structure. If I reorganize the whole structure to fit my own style/theme, then I'll feel like I have more power over the engine, compared to before. With the original structure it just feels like working with something that someone else created whom I can't contact to fix small errors. Actually, the support is excellent at Leadwerks that I probably would get the help, but in this way I won't really need to.


I may provide the ending result of the reprogrammed and reorganized shaders over at the Leadwerks forum but may keep it to myself. Not to be selfish, but I don't want to act like I'm taking credit from Josh Klint which had put a lot of hard work into these shaders.


0 comments:

Post a Comment