I'm working on a development plan to remove two major dependencies from my framework: Cairo and ShaderC. Removing dependencies is a godsend for my framework, increasing code portability to other platforms. Specifically, the Cairo libraries don't represent a major blocker, but they do have other limitations, such as not supporting polygon rasterization, drawing to a destination alpha channel, and 16-bit per channel rendering. They also have a limited set of features for drawing 2D shapes and fonts. I've explored several alternatives, but none have satisfied me. Google's Skia libraries have too many external dependencies, while Blend2D doesn't support 16-bit per channel rendering, and they also don't support any type of 3D polygon rendering. I've decided to re-implement the entire software rendering layer, so I can freely introduce all the features I need, without having to rely on external projects and with the greatest degree of cross-platform portability. This way, I will be able to support drawing fonts, 2D and 3D polygons, up to 32-bit per channel, on destination alpha channels, without any restriction.
Another major dependency I'm going to remove is ShaderC. Again, the range of supported builds isn't particularly narrow, but it's still a major dependency to maintain over time, which limits porting to other platforms. Until now, ShaderC has been used to convert from GLSL to SPIRV at runtime for rendering with the Vulkan libraries. This is a crucial step because materials are converted to GLSL, which is then converted to SPIRV for rendering. The ShaderC libraries are huge and are used for a much wider range of tasks, beyond the scope of this framework (unfortunately, this is the flaw of many external dependencies). Since the framework now has its own language parser, the idea is to implement a proprietary GLSL to SPIRV converter, thus removing ShaderC as a mandatory dependency for 3D rendering with the Vulkan libraries. Another complementary step I'm implementing is an alternative module with the OpenGL libraries, which doesn't require ShaderC: this solution is already used in the Emscripten porting to work with WebGL, without ShaderC. It should also be noted that, even with ShaderC, in the future it will still be necessary to parse the GLSL code to support advanced features, such as GLSL rendering nodes in materials, so removing this dependency at some point will be a mandatory step.





The layout of the mesh doesn't have to match exactly with the material's one: if the mesh has the required vertex attribute then it's used, otherwise 0 values are used instead. It's for the material to decide how to use the vertex attributes offered by the mesh. In this way, a single material can be used to render any kind of mesh. Of course, a mesh without normals cannot render diffuse or specular, or without texcoords cannot render textures, normal maps and so on.


