Email or username:

Password:

Forgot your password?
Admer the GoldSRC fox

It sure took me long enough, but #ElegyEngine can now render textured models !!!

Also got a pretty colourful "missing texture" texture now. Should be very easy to notice and still look aesthetically pleasing

2 comments
Admer the GoldSRC fox

This took a lot longer than I expected to say the least:

Loading glTF and PNG files was the easy part; most of the effort went into the material/shader system.

Typically when you write a renderer, you can define which resources (textures, matrices etc.) occupy which slots in the shader. E.g. view & proj matrix -> slot 0, model matrix -> slot 1, textures -> slot 2.

But here I wanted a more data-driven thing, where the shader & renderer agree on a few common slots, and the rest it figures out from the material file. So you can easily just write a new shader and use it! No need to touch the renderer code at all.

There were lots of little nuances to this, so it took a while.

I also realised, however, that my renderer plugin API is pretty inflexible and flawed. I'll need to redo that next month. Oops!

This took a lot longer than I expected to say the least:

Loading glTF and PNG files was the easy part; most of the effort went into the material/shader system.

Typically when you write a renderer, you can define which resources (textures, matrices etc.) occupy which slots in the shader. E.g. view & proj matrix -> slot 0, model matrix -> slot 1, textures -> slot 2.

Admer the GoldSRC fox

Also funny sidenote:

I spent an entire day just figuring out why my cube model was facing the wrong way.

Wrote a bunch of unit tests for the matrix maths, and everything was perfectly fine.

Turns out I forgot to use "clear rotation" in Blender before exporting. The model itself was not rotated correctly. :blobfox3c:

At least now I have some unit tests, so that's good.

Go Up