feat(D.2b): Slice 2 — PaperdollViewportRenderer RTT pass (static doll)
The C# analog of CreatureMode::Render: draws one re-dressed player clone into a private FBO (RGBA8 + depth24-stencil8) with the fixed DollCamera + one distant light (retail 0.3,1.9,0.65 @ 2.0), sealed in a GLStateScope so it can't disturb world/UI GL state. frustum:null ⇒ the doll's synthetic landblock is always visible ⇒ walked from entry.Entities and drawn from its current MeshRefs (static pose; idle animation is a later slice). Manages the FBO directly via GL (ManagedGLFramebuffer is unused/bitrotted WB infra). UiViewport blit flips V (FBO bottom-left origin vs UI top-left) so the doll isn't upside-down. Not yet wired — GameWindow hook is next. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
362d41aacf
commit
3cdecb536b
2 changed files with 191 additions and 2 deletions
|
|
@ -19,7 +19,9 @@ public sealed class UiViewport : UiElement
|
|||
{
|
||||
if (!Visible || TextureHandle == 0) return;
|
||||
// Local origin is already at this widget's Left/Top (PushTransform applied by DrawSelfAndChildren).
|
||||
// Draw the full-texture sprite with UV 0..1 and white tint (no color modulation).
|
||||
ctx.DrawSprite(TextureHandle, 0f, 0f, Width, Height, 0f, 0f, 1f, 1f, Vector4.One);
|
||||
// V is FLIPPED (v0=1, v1=0): TextureHandle is an off-screen FBO color texture, whose origin is
|
||||
// bottom-left (GL), while the UI sprite convention is top-left. Without the flip the doll renders
|
||||
// upside-down. (If the doll appears upside-down at the visual gate, this is the line to revisit.)
|
||||
ctx.DrawSprite(TextureHandle, 0f, 0f, Width, Height, 0f, 1f, 1f, 0f, Vector4.One);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue