Visual Studio 3D Starter Kit textures RRS feed

  • Question

  • I'm trying to load an FBX file that contains both a diffuse texture and a specular texture. Using the Visual Studio 3D starter kit, how would I load these textures. I've walked through the point where the textures for the meshes are loaded, and I have found nothing loads the specular texture. The diffuse texture loads fine, but not the specular texture. So, is this functionality not built in yet, if so how would I read it in?


    Friday, May 24, 2013 8:12 PM

All replies

  • Runtime material systems are designed to approximate the photo-realistic renderer solutions, so each implementation does something different. The CMO export material definition includes the multiple texture names, but only every uses the first texture.

    Friday, May 24, 2013 10:33 PM
  • I'm afraid I don't understand exactly what you're saying.

    I'm not worried about the rendering portion, I have my own shader for that. I just can't seem to load in the specular texture at all. Like I said, I've put a breakpoint at the point of the mesh class where the textures are loaded in, and only the diffuse is loaded.

    If you're saying that the issue is with the CMO importer, is there any way that I could change that so that it'll read in the other textures?

    Saturday, May 25, 2013 2:13 AM
  • The VS Starter Kit is just a sample. If you want it to do something else, then just modify it.

    Wednesday, May 29, 2013 10:06 PM
  • I just got my hands on Visual Studio 2012 Professional. Upon opening my file for testing, I've noticed that the fbx only has a diffuse texture. I also tested the file in Autodesk Maya to see if it was a problem with the file. But, the file is fine, and I saw the specular connection. So, clearly it's an issue with the CMO importer.
    Saturday, June 8, 2013 2:34 AM
  • Any ideas?
    Friday, June 21, 2013 6:44 PM
  • If you trace into the C++ source in the Load function in VSD3DStarter.h  you'll see the code loading the textures and storing them.  (look for "get or create texture"). If the exporter is correct, you'll see the texture reference.

    In the Render function in VSD3DStarter.h you can see it binding the resources for the material.

    Now, you actually need a pixel shader that uses it to see it.

    Friday, June 21, 2013 7:02 PM
  • I've already done this, multiple times. The load function will load up the color texture, but it never loads anything else. The other 7 textures are just "" empty strings.
    Saturday, June 22, 2013 2:46 PM
  • So it has nothing to do with the 'importer' at all. It's the CMO exporter that is not including those texture names in the material.
    Sunday, June 23, 2013 6:53 PM
  • After reading this, http://directxtk.codeplex.com/wikipage?title=Model I've noticed that the CMO exporter prefers a FBX 2013. I'll try this, and see if there's a difference. There's a chance that my team has been using FBX 2012.
    Monday, June 24, 2013 3:42 AM
  • The VS CMO exporter does not export more than one texture name. You can either 'fix it up' in a custom loader modification based on the material name, or you can look at something like SDKMESH using DirectXTK.
    Tuesday, June 25, 2013 3:00 AM