I'm working on Source Engine mesh stuff, and I have some questions.
What happens when you try to draw a mesh without known vertex format
(VERTEX_FORMAT_INVALID)? Where does the engine get the stream/FVF
offsets from in this case? Currently bound material? Can drawing occur
without known material at all? And what vertex format is used for vertex
description/size computation if no vertex format is set?
What are the different kinds of meshes exactly for?
- CMeshDX8 - a regular static mesh? It's created by the engine and
StudioRender, and it seems that the vertex format is always defined
explicitly, but you can assign your own vertex and index buffers to it,
what happens when you bind a vertex buffer with a different vertex
format? Is Lock/Modify write-only for it?
- CDynamicMeshDX8 - MeshMgr GetDynamicMesh singleton. The problem with
it is that the material system uses it with vertex format 0 in some places.
- CTempMeshDX8 - stores a copy of the vertex data in RAM? What's the
purpose? Clipping polygons with a plane?
- CBufferedMeshDX8 - another GetDynamicMesh singleton. WTF is this???
Proxies calls to another mesh, and draws that mesh when
FlushBufferedPrimitives is called. FlushBufferedPrimitives happens when
almost any state change is done, but not on Xbox 360 (why?).
What is the difference between Lock/Unlock and ModifyBegin/ModifyEnd?
What kinds of meshes support reading locked data? Also there are no
asserts on ModifyBeginEx bReadOnly.
There are also different implementations of vertex and index buffer.
CVertexBufferDX8 and CIndexBufferDX8 mostly implement
IVertexBuffer/IIndexBuffer functions, but there are also CVertexBuffer
("dynamicvb") and CIndexBuffer ("dynamicib") that contain their own
functions, a lot of Xbox 360 code and some code from NVIDIA's Sim
Dietrich Jr.
The former is used for the "new vertex/index buffer interface" of
MeshMgr, but the latter is used in the mesh code.
Thanks,
-- SiPlus
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders