Skip to content

Texture Atlas, reduce shader math#293

Open
kirides wants to merge 34 commits intomasterfrom
feat/texture_atlas
Open

Texture Atlas, reduce shader math#293
kirides wants to merge 34 commits intomasterfrom
feat/texture_atlas

Conversation

@kirides
Copy link
Owner

@kirides kirides commented Mar 15, 2026

  • implements a Texture atlas approach for World mesh and static VOBs

    • the world mesh is drawn with a single Multidraw dispatch, where the buffers are created once upon world loading
    • static VOBs work the same, but currently are "broken" as in some static VOBs (actually mobs in gothic speech) don't get the correct textures to display. most notably Greg's hut is completely empty, and Irdorath stone doors are invisible.
  • On Top of Atlas support:

    • completely draw Mesh and vobs using Multidraw indirect with a single texture atlas binding per texture format.
    • build a Hi-Z buffer to perform occlusion culling for VOBs using the world mesh drawn in the previous step.
    • perform frustum and distance culling on the GPU using Compute shaders.
  • removed many matrix multiplications from pixelshaders and simplified world-from-depth in shaders.

  • prepare some abstractions to ease migration to dx12 at some point in the future.

    • D3D11CommandList as a wrapper around the immediate context, not yet in use.
    • PipelineStateObject as abstraction for currently manually managed d3d11 raster states. Not yet in use, would increase PR way too much and requires a lot of refactoring. Current approach of SetDefaultStates and UpdateRenderStates is working fine, but doesn't map to dx12/Vulkan at all.
  • started to reduce the weight of D3D11GraphicsEngine by moving some parts of specific renderpasses into separate classes.

  • increase normalmap precision while keeping them 32bpp using octahedral encoding.

    • required HBAO+ to stop using normals as the library doesn't support encoded normals.
  • implement dithering for god rays, increase god rays sample count to reduce banding artifacts on low standing sunsets/rises

many more things, will update this PR description shortly.

kirides added 30 commits March 5, 2026 23:34
…rm. profiled some more reduced CPU overhead, implement Hi-Z Culling for indirect VOB drawing
…4 and adding dithering, ensure clamping behavior for Godray zoom
…certain vobs, like the doors in irdorath or some things in pirates camp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant