Skip to content

Detail grass instancing mt#577

Open
samloeschen wants to merge 8 commits into
themrdemonized:all-in-one-vs2022-wpo-mtfrom
samloeschen:detail-grass-instancing-mt
Open

Detail grass instancing mt#577
samloeschen wants to merge 8 commits into
themrdemonized:all-in-one-vs2022-wpo-mtfrom
samloeschen:detail-grass-instancing-mt

Conversation

@samloeschen

Copy link
Copy Markdown

MT version of the grass optimizations branch. See this PR

required mod for grass shaders:
grass shaders.zip

samloeschen and others added 8 commits June 3, 2026 22:50
…ets moved to VS as a result). compress instances to 64b, and sort by depth
Brings the grass rendering optimizations into the MT branch:
- DX10/11 hardware instancing for details (single-copy VB/IB +
  per-instance vertex stream, 64B packed records, one
  DrawIndexedInstanced per detail object)
- fill-once-per-frame instance buffer reused by sun cascade / spot
  light shadow phases (no refill, alpha smoothing once per frame)
- distance fade moved to the vertex shader (dt_fade_params)
- draws grouped by ShaderElement, front-to-back slot sorting
- distance-based density falloff (r__detail_density_knee/_curve)

MT-side adaptations made during conflict resolution:
- instance records read mRotY_calculated (scale pre-multiplied in
  UpdateVisibleM on the MT worker) instead of the removed
  scale_calculated member
- hw_Render/hw_Render_dump keep the light* L parameter; sector
  visibility culls (GMBase / L->GMLight vs pOutdoorSector) hoisted to
  per-dump early-outs since they are instance-independent; still
  details (var 0) keep skipping SMAP phases
- upstream per-instance light-range cull dropped: out-of-range blades
  collapse to degenerate tris in the VS light fade instead
- density falloff coexists with the upstream SSA-fade blade discard
- fixed a missing-brace bug in hw_Render_dump's empty-variant
  early-out (the committed grass branch tip did not compile; fix was
  only in a stash)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@samloeschen

Copy link
Copy Markdown
Author

corrected shaders:
grass shaders.zip

I missed a typo Claude inserted when I was doing the dx10 stuff 🤦‍♂️

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