mercoledì 18 maggio 2016

Day 128: Model Loading WIP

Today I started to adapt the Assimp loader to the engine.
It required quite a lot of tweaks because the data are imported in a very general way.

The good news is that the mesh is splitted as I wanted (for instance, the cathedral in the screenshot is splitted in 1280 meshes and 16 materials, exactly as defined in the obj file).

The bad news, is that right now for some reason only one material of the ones loaded is actually used in rendering. As you can see in the screenshot, multiple areas are black, instead of a different material.

I also updated the texture manager to support caching. That's because with ~1300 meshes and only 16 materials, each texture is loaded on average ~100 times. Now it just checks if the texture is already loaded, and returns it. It could certainly be improved, and I didn't do any error checking or tested possible duplications, but for now it does its job.

Finally a note on the lights: point lights cast nice shadows, while directional lights are not really convincing....I'm not even sure if they are just wrong, or simply ugly looking because of peterpanning / complex geometry / moire patterns and all these other annoying problems.


Nessun commento:

Posta un commento