Tuesday, April 5, 2011

Model Loading Complete

I've finally got the model loading as complete as it needs to be for the purposes of this project. As I found out after writing a lot of the code myself, ASSIMP contains options for simplifying loaded scenes into flat structures (one node, with a bunch of pre-transformed meshes). The ASSIMP implementation tends to generate some errors on the COLLADA models that I've plugged in from Google's 3d warehouse. My implementation, on the other hand, was orders of magnitude slower; I decided to scrap it in favor of reasonable speed and just use model files that don't cause the importer to mess up.



Here is a sample image using some random ikea furniture and a bizarre amount of spiders, which shows textures working. Due to perceived time constraints on getting this project finished,  I'm not going to do anything fancier than just using diffuse color textures. Plus, none of the models that I've come across include textures for bump- or normal-mapping.

Because some models have textures and others don't, I experimented with using preprocessor defines in the shaders to help me generate two different shaders. While this wasn't really needed for such a simple case, I wanted to make sure that it worked as expected for the when I have to make 16 or 32 shader combinations.

I hope to set up the lighting system and non-tiled deferred rendering path by class on Monday so that I have something to present. Even if I get that far it doesn't even seem like half of the coding portion of the project would even be done; there is still a ton to do, and I hope I can finish it all in three weeks.

2 comments:

  1. This is good progress so far. I am confident that you will be able to get deferred shading working by Monday, but perhaps not with all the effects, i.e., post processing, etc.

    It is a common optimization to flatten the scene graph of a model for rendering. This reduces the application CPU overhead of walking the graph every frame and can reduce the number of draw calls.

    ReplyDelete
  2. Hi, my project also use Assimp to import the 3D model.
    But after using the sample code from Assimp.my model still untexturized..any idea?

    ReplyDelete