0

I'm using Direct3D 11 and Visual Studio 2012.

I've read that VS2012 can automatically compile FBX files during the build phase, similar to HLSL files. I haven't been able to find any documentation on how to do this, though. What build action do I set for the FBX files?

Also, what function or functions should I look up on MSDN / Google that relate to loading the compiled FBX file? A tutorial or stackoverflow link, etc, will work. I just have nothing to go on at the moment, so I don't even know what to Google for. My searches haven't turned up anything.

I'm trying to transition from rendering my manually defined cube to rendering a cube, or any model, loaded from an external model file.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ryan
  • 7,733
  • 10
  • 61
  • 106

1 Answers1

0

You can add build customizations to read FBX files into the asset pipeline, but if you want to load them at runtime, need to build the vertex and index buffers yourself. Here is the relevant MSDN page on loading and using 3D models, and it reads:

Direct3D 11 does not provide functions for creating resources from 3-D models. Instead, you have to write code that reads the 3-D model file and creates vertex and index buffers that represent the 3-D model and any resources that the model requires—for example, textures or shaders.

Justin R.
  • 23,435
  • 23
  • 108
  • 157