multiple uv coordinates
Hello there,I'm trying to create an X file with a mesh that has multiple UV
coordinates. How can I do that? I know that it must somehow be possible
as the (old) mesh viewer has tha option to show up to 8 texture
coordinate sets.
How can more than one uv set be declared in an X file? (ASCII)
In fact, is there ANY complete and reliable documentation of the X file
standard? That document would be like the holy grail for many many
developers out there I guess. :)
regards,
Robin
[566 byte] By [
eisebs] at [2007-12-23]
| I would love to see some documentation on the x-file too. |
|
| In fact, is there ANY complete and reliable documentation of the X file standard? |
|
yes there is:
X-File Reference and
Legacy X-File Reference.
| That document would be like the holy grail for many many developers out there I guess |
|
I would disagree actually! A lot of developers will use the .X format, but I'd put money on
more developers NOT using it. A lot of professional studios and engines will have their own file formats, content creation tools and other asset-management systems. Custom file formats have a number of advantages - especially in the cases where consoles are involved (optimized loading, cross-platform)...
hth
Jack
The file is perfectly parsed with two contiguous MeshTextureCoords sets (and two materials with different textures), but is rendered totally aliased with the following code.
HRESULT CXD3DMesh::Render()
{
if (!m_pLocalMesh)
return E_FAIL;
m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT);
m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_TEXTURE);
m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
for (DWORD i = 0; i < m_dwNumMaterials; i++)
{
m_pd3dDevice->SetMaterial(&m_pMaterials[ i ]->MatD3D);
m_pd3dDevice->SetTexture(i, m_pTextures[ i ]);
}
m_pLocalMesh->DrawSubset(0);
return S_OK;
}
If I comment out the texture stages, the first texture shows up; If I hardcode my vertices in a FVF everything works like a charm; what is wrong? It has to be the file parsing, but no D3DX function is failing... please help
Actually, the way that the SDK X exporter does it (and my X exporters do, too), is to put the second (and more) texture coordinate set in a DeclData template. That seems to be what the DirectX Viewer wants -- at least it works very well. Same thing for tangents, binormals, and any other data you want to add that doesn't have a specific template for it.
Note that the DeclData is indexed with the same indices as the Mesh template, so you may have to split verts in the first Mesh template to make sure you can uniquely index the correct DeclData.