Lime engine update
Today I worked on and finished texture support. So far everything has been quite simple and straight forward as most features are shared by both DirectX and OpenGL. My first primary goal, trying to keep the majority of the core components completely platform independent has been achieved. For example, textures are API independent, only until they enter the graphics system they will be transformed to a DirectX or OpenGL specific format. Of course there were some times where I really hated this goal of mine, because DirectX uses textures as in ARGB while OpenGL wants it in ABGR (compared to DirectX). This means that OpenGL will have a drastic performance impact and I know this can easily be solved by flipping it once before sending it to the engine, or let the engine create and store another texture for internal use.
However, the LimeEngine is just a baby and I knew that this part would be easy and yes the above problem is what I call easy. The next part is going to be hard since it is almost impossible to stay platform or API independent. The problem is called shaders.
There are three popular shading languages. DirectX HLSL, Nvidia CG and OpenGL GLSL. The problem is that although the languages look identical they are not the same. Sometimes the variable naming is different. Further HLSL can only be used with DirectX and GLSL can only be used by OpenGL. CG is an odd one in that category as it has an implementation for both API's. However that requires an additional library and to be honest I prefer HLSL as the documentation is better than that of CG. GLSL is completely new to me and it requires an extension. An alternative could be that I write my own shader language, but doing so would most likely mean that other developers would hang me, burn me and forbid me to ever touch a computer again.
However the problem won't be with the coding but the use of the engine. Everyone using my engine should be aware that the engine is not intended as API independent, since it never is. You can learn a cat to bark, but it will never be a dog. Working with my engine will bring you as close as possible to the API without actually having to work with it and in fact this has always been my intention. This line is paper-thin and you might be better off seeing the LimeEngine as huge library filled with helper functions than a separate API.
But the next part is going to be hard as Shaders languages are all unique and I still want to abstract it until it is being used by the graphics engine.
There is one thing that the engine doesn't have which I'm not certain of if I want to add it. Since the engine is focused on shader there is no real need to add TL (Transform & Lighting) as these transformations are done by the vertex shader while the lighting is done by the pixel shader.
After that the engine will hit it's very first milestone as it will have all the features I have set out to add. And with a bit of luck I will meet the requirements of that milestone tomorrow. Actually there is the fact that I have to correct the documentation and oh... the fact that there are many small bugs I have to hunt and I bet a lot not so fun things that require my attention but let's not spoil the fun, shall we?