Map projections' depth like the client's renderer
IMVU's projections give depth from -1 to 1; its Direct3D renderer maps it to 0 to 1, and now so does ours. Without that, the nearer half of the depth range was clipped, the whole 2D overlay (name tags, the frame rate, the room's title) with it. The adapter also draws drawTrianglesFromMemory without indices, and sums up what the client draws in its log. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
299cd8c312
commit
3cdda4c7ed
6 files changed
+78
-43
No files matched your search
+9
-2
@@ -71,9 +71,16 @@ virtual methods, IMVU's code only uses an engine through helpers that call its v
|
||||
vertical field of view, Direct3D's 0 to 1 depth) and an orthographic one for 2D, orthonormal view rotations,
|
||||
opaque clear colors, ambient light with zero alpha, linear fog (1 to 50), scrolling texture transforms. Furniture
|
||||
vertices are interleaved: positions and normals are 12-byte elements 32 bytes apart, so strides matter.
|
||||
- Projections give depth from -1 to 1, as OpenGL's do: IMVU's Direct3D renderer multiplies them by a matrix
|
||||
mapping it to 0 to 1 (z' = z / 2 + w / 2) and shifting them half a pixel (-1 / width, +1 / height, for Direct3D
|
||||
9's pixel centers). Without the depth mapping, everything in the nearer half of the depth range is clipped: the
|
||||
2D overlay (name tags, the frame rate, the room's title) is drawn at depth -0.98.
|
||||
- The 2D overlay is ordinary `drawTriangles` with an orthographic projection (a few per frame), textured with text
|
||||
IMVU draws with GDI into bitmaps.
|
||||
- Particles (`drawPointSprites`): a Visual C++ 2010 `std::vector` of 16-byte points (position, color), drawn as
|
||||
Direct3D 9 point sprites: squares viewport height / distance pixels across (Direct3D 9's defaults clamp them to
|
||||
1 to 64; IMVU sets only the size, 1, and the scale factors 0, 0, 1), textured over the whole square.
|
||||
Direct3D 9 point sprites: squares viewport height / distance pixels across (IMVU sets the size, 1, and the scale
|
||||
factors 0, 0, 1), textured over the whole square. Direct3D 9's documented 64-pixel default limit doesn't apply in
|
||||
practice: clamped to it they look much smaller and fainter than the client's.
|
||||
- Fog: linear table fog, start 1 and end 50 in rooms. Fogging by view depth matches the client; by depth buffer
|
||||
value (as Direct3D 9's documentation suggests for projections like IMVU's) doesn't.
|
||||
- Still unknown: render targets, `CompoundRegion` (texture update
|
||||
|
||||
Reference in new issue
Block a user