Adding lights for Christmas!
Changelog
Getting ready for Christmas! And getting ready for going physically based, really.
- Added simple light component classes (directional).
- Added example code on the dev example.
- Added default materials Unlit, Screen, and Standard.
- Standard will eventually become a physically based material. At the moment, it is Phong lit.
- Refactored all shader code.
- Added common shaders for shared features.
- Now the user doesn't need to:
- Add
#version 330
tag. - Define position, normals and uv vertex attributes in the shader. Getters in the format of
getPosition()
are provided for its use. - Define default varying data for the fragment shader. However, if the user wants to use the data in the shader, they can call several different functions to setup the data (
setupWorldSpaceOutput()
,setupScreenSpaceOutput()
) or setup each of the values separately (setupPositionOutput()
,setupNormalOutput(vec3())
). - Define the Common uniform block. Every shader will have access to its variables. Also, some helper functions have been provided for the user such as
getClipPosition()
. - Define texture uniforms. They can be accessed with u_tex0, u_tex1, u_tex2...
- Define
out fragColor
. Output color can be set usingsetFragmentColor(vec3 / vec4)
.
- Add
- Some helper functions such as
computeLightContribution()
have been added. At the moment, not much functionality is available, but soon a lot of other functions will follow!
- The editor now has an option to be hidden and show the application full-screen.
- Shaders are no longer located in the assets folder. Now they are inside of each backend folder inside of src/graphics.