Hi there,
I'm prototyping a Global Illumination technique by extending one of NVidia's demos (DX11 Samples - Diffuse Global Illumination). The demo uses the CDXUTSDKMesh class to load and render the scene.
What I did so far:
- Create a test scene in Blender.
- Unwrap it for texturing and export it using the .x exporter by Chris Foster.
- Use the DirectX MeshConvert utility to convert my .x file to .sdkmesh format.
This works fine so far and has allowed me to fix some carelessness on NVidia's part (e.g. lots of unwanted normal interpolation on flat surfaces and no (!) tangents, although they use normal mapping in the demo...). Now, my technique requires two different UV maps (texturing + lightmapping) for my test scene. What I've tried:
- Create a second UV map.
- The .x exporter only handles the active UV map, so I extended it to output the second UV map as follows (pseudo-C++, although it was actually implemented in Python):
FVFData { 258; NUM_VERTICES * 2; reinterpret_cast<unsigned long>(uv[0].x), reinterpret_cast<unsigned long>(uv[1].x), ...; } - Use MeshConvert with /tcount 2, which creates a second UV channel. Whatever I do, the values of this channel are always 0. The tool does not seem to care about the FVFData at all.
- IDEA: Use the vertex color and just put the UVs in the RG channels. Unfortunately, MeshConvert doesn't seem to care the vertex color either.
- IDEA: Load two separate meshes, one with each UV map, and somehow merge them in code. Since the vertex buffers are not writeable, I have not found a way to do this.
Any hints, experiences or further ideas are appreciated.
Thanks
David