ID3DXPMesh::Save and D3DXCreatePMeshFromStream

ID3DXPMesh::Save and D3DXCreatePMeshFromStream

Post by Paul » Mon, 07 Jul 2003 10:39:41



I'm trying to save large meshes via ID3DXPMesh::Save. It works fine for
smaller meshes. However, when I save larger meshes the file size is always
the same regardless of the number of faces in the mesh. ID3DXPMesh::Save
doesn't complain for these larger meshes, but afterwards, I get
DXFILEERR_BADVALUE when I try to load them via D3DXCreatePMeshFromStream.

Also, I am able to create and use 32 bit progressive mesh (using
D3DXGeneratePMesh), but when I call D3DXCreatePMeshFromStream, it returns
DXFILEERR_BADVALUE when I try to request D3DXMESH_32BIT regardless of
whether I'm trying to load large or small meshes. This all leads me to
believe that these functions are limited to meshes with less than 2^16
faces. If this is true, then is Microsoft planning on updating these
functions to support 32 bit meshes? Of course this is all assuming that
D3DXMESH_32BIT is even supported in the first place. I noticed that the SDK
documentation for ID3DXMesh::GetOptions and ID3DXPMesh::GetOptions state
that it's not supported, but I'm hoping that it's just a problem with the
documentation having not been updated recently. I couldn't find any mentions
of D3DXMESH_32BIT not being supported anywhere else in the SDK.

 
 
 

ID3DXPMesh::Save and D3DXCreatePMeshFromStream

Post by Paul » Sat, 05 Jul 2003 10:35:59


I'm trying to save large meshes via ID3DXPMesh::Save. It works fine for
smaller meshes. However, when I save larger meshes the file size is always
the same regardless of the number of faces in the mesh. ID3DXPMesh::Save
doesn't complain for these larger meshes, but afterwards, I get
DXFILEERR_BADVALUE when I try to load them via D3DXCreatePMeshFromStream.

Also, I am able to create and use 32 bit progressive mesh (using
D3DXGeneratePMesh), but when I call D3DXCreatePMeshFromStream, it returns
DXFILEERR_BADVALUE when I try to request D3DXMESH_32BIT regardless of
whether I'm trying to load large or small meshes. This all leads me to
believe that these functions are limited to meshes with less than 2^16
faces. If this is true, then is Microsoft planning on updating these
functions to support 32 bit meshes? Of course this is all assuming that
D3DXMESH_32BIT is even supported in the first place. I noticed that the SDK
documentation for ID3DXMesh::GetOptions and ID3DXPMesh::GetOptions state
that it's not supported, but I'm hoping that it's just a problem with the
documentation having not been updated recently. I couldn't find any mentions
of D3DXMESH_32BIT not being supported anywhere else in the SDK.

 
 
 

ID3DXPMesh::Save and D3DXCreatePMeshFromStream

Post by Xin Huan » Tue, 08 Jul 2003 17:00:33


Yes, the doc seems to be out-of-date. D3DXMESH_32BIT is supported. The
correct statement for it is at
<http://msdn.microsoft.com/library/en-us/directx9_c/directx/graphics/r...
ce/d3dx/enums/d3dxmesh.asp>.

Do you have a reproduce of the problem? I would also suggest you switch to
debug runtime and look at the debug log first.

Hope this helps.

Regards,
Xin

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. (c) 2003 Microsoft Corporation. All
rights reserved.

 
 
 

ID3DXPMesh::Save and D3DXCreatePMeshFromStream

Post by Paul » Tue, 08 Jul 2003 22:31:41


(Oops. Sorry, Xin. I originally clicked "Reply" to sender instead of "Reply
Group.")

Yes, I'm already using the debug runtime, and it doesn't provide me with
anymore information than I've already posted. As far as reproducing the
problem goes, here's the general procedure:

1. Create a mesh using D3DXCreateMesh. Specify D3DXMESH_32BIT as one of the
options.
2. Fill the mesh with geometry consisting of 70,000 (approximately 2^16) or
more faces.
3. Convert the source mesh into a D3DXPMesh by calling the D3DXGeneratePMesh
function.

You can pause at step 3 and test the D3DXPMesh to make sure it's generated
correctly. I haven't run into any problems generating a D3DXPMesh this way.

4. Attempt to save via D3DXPMesh::Save. If you've loaded multiple large
(greater than 2^16 faces) D3DXPMeshes and tried to save this way you'll have
immediately noticed that something's wrong. All the files are the same size.
As I stated it my last post, this function doesn't return an error even
though it seems to fail.
5. It's reasonable to assume that loading from the files you've just created
will fail since the save seems to have failed. In fact, this is what
happens. Trying to load a large D3DXPMesh via D3DXCreatePMeshFromStream will
always fail.

To ensure reproduction of these errors I would suggest that you try using
geometry that consists of 70,000 or more faces. Conversely, you'll see that
all these functions work perfectly if you're using 60,000 or less faces.
Also, remember that regardless of how many faces are in your geometry,
everything up to and including step 3 will run correctly.


Quote:> Yes, the doc seems to be out-of-date. D3DXMESH_32BIT is supported. The
> correct statement for it is at

<http://msdn.microsoft.com/library/en-us/directx9_c/directx/graphics/r...
Quote:> ce/d3dx/enums/d3dxmesh.asp>.

> Do you have a reproduce of the problem? I would also suggest you switch to
> debug runtime and look at the debug log first.

> Hope this helps.

> Regards,
> Xin

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. (c) 2003 Microsoft Corporation. All
> rights reserved.

 
 
 

ID3DXPMesh::Save and D3DXCreatePMeshFromStream

Post by Rich [Microsoft Direct3D MV » Wed, 09 Jul 2003 01:55:18


[Please do not mail me a copy of your followup]



Quote:>problem goes, here's the general procedure:

>1. Create a mesh using D3DXCreateMesh. Specify D3DXMESH_32BIT as one of the
>options.
>2. Fill the mesh with geometry consisting of 70,000 (approximately 2^16) or
>more faces.
>3. Convert the source mesh into a D3DXPMesh by calling the D3DXGeneratePMesh
>function.

>You can pause at step 3 and test the D3DXPMesh to make sure it's generated
>correctly. I haven't run into any problems generating a D3DXPMesh this way.

>4. Attempt to save via D3DXPMesh::Save. If you've loaded multiple large
>(greater than 2^16 faces) D3DXPMeshes and tried to save this way you'll have
>immediately noticed that something's wrong. All the files are the same size.
>As I stated it my last post, this function doesn't return an error even
>though it seems to fail.


information.
--
"The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
          <http://www.xmission.com/~legalize/book/>
    Pilgrimage: Utah's first annual demoparty on August 9th, 2003
               <http://pilgrimage.scene.org>
 
 
 

1. Default SAVE and SAVE AS

Windows 98     PSP6.02

I have a web site where I post my art work and I also make greeting cards.  All
images are first refined in Paintshop.
I do several images each session.  I save to the default .psp and do a batch
conversion to change to gif which is the primary extension in both my card program
and FTP.  I must then delete all psp files.  This is a nuisance.

Is there a way to make gif the default instead of psp?
--
See my art work at
http://www.crcwnet.com/~rbarone
http://www.zing.com/cgi-bin/album.cgi?album_id=4294831249
__________________________________________________
Ray Barone Studio
Since I've regained my humility I'm a very lovable person.

2. PM6.5 & OL-410e

3. Default "SAVE and SAVE AS"

4. Scan-Line Visible Surface Algorithms

5. Does save workspace save prefs?

6. Sort of novice in graphic programming

7. New User - Saving Scenes (not saving surfaces)

8. Digital Camera Advice

9. Save Images & Save Alpha problems

10. PM 6.5 won't save or save-as after removing pages

11. Save As vs. Save Smaller

12. save, save as, save copy as, always the same format...

13. HELP! Trying to save jpeg only saves as html file (In Save for Web)