what Mesh Viewer does ?

Started by
3 comments, last by sirob 17 years, 9 months ago
For the same mesh object, Mesh Viewer always have better image quality than my program. I don't know what it does. My program use default shader of D3D. I want to know what Mesh Viewer use or whatever it dose.:(
汇编语言不会编
Advertisement
Mesh viewer uses surface lighting, which makes the model and surface look better.
BTW: the source code to the DirectX Viewer (or Mesh Viewer in older SDKs IIRC) is in the SDK, so you can take a look at and copy exactly what it does.

Take a look in the %dxsdk_dir%\Utilities\Source\DxViewer folder.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

I think the key is DrawSubset() method. but...

Is there a way to know the internal workings of
DrawSubset (for meshes)?

Is there source code available of this
method?

I would like to know what settings to the render
pipeline it does. For example, if I set a vertex shader,
does DrawSubset render with this shader or does it
use it's own.
汇编语言不会编
You can use PIX to capture a call stream. This would more or less show you which lower-level D3D calls DrawSubset makes internally.

In general, DrawSubset doesn't modify any render states. If you have a shader bound when calling it, the subset will be drawn with that shader and using the states that were then set.

If you wanted to replace what DrawSubset is doing, I'd estimate it the equivalent to:

1) SetStreamSource,
2) SetIndices,
3) SetFVF,
4) DrawIndexedPrimitives.

I don't think it makes any other D3D calls, and if it does, none with any major effect.

Hope this helps :).
Sirob Yes.» - status: Work-O-Rama.

This topic is closed to new replies.

Advertisement