Skip to content

feat: add rendering bindings - #75

Draft
northaxosky wants to merge 9 commits into
libxse:mainfrom
Dear-Modding-FO4:feat/rendering-bindings
Draft

northaxosky wants to merge 9 commits into
libxse:mainfrom
Dear-Modding-FO4:feat/rendering-bindings

Conversation

@northaxosky

Copy link
Copy Markdown

Rendering bindings from our fork, everything here is used by Community Shaders (a few bits by Addictol too). I went through all of it against the AE exe in IDA. Anything I couldn't verify and nothing reads is a pad instead of a guessed name.

What's in it

  • 163 rendering IDs, plus wrappers for the ones mods actually call or hook
  • BSGraphics: render state, render targets, z-prepass and draw functions, RendererShadowState as real members
  • Shader classes: BSShader command buffers, BSRenderPass, BSImagespaceShader, BSComputeShader, and the small derived shaders with correct AE sizes
  • Lights and shadows: BSLight, the BSShadow*Light family, ShadowSceneNode, BSDFTiledLighting, NiLight
  • Sky and world: Sky, Clouds, Precipitation, NVGodrays, TESWaterSystem, terrain chunks/nodes, DrawWorld
  • Geometry and culling: BSMeshLODTriShape, BSMergeInstancedTriShape, BSGeometrySegmentData, BSGeometryListCullingProcess

Fixes to existing code (separate commits)

  • ImageSpaceManager effect indices are off by one from 80 onward on AE, there's an ISCopyNormals effect at 80. Checked a bunch of indices across the range, not just the ends.
  • Main::GetLandLODRoot/GetObjectLODRoot returned the address of the global instead of the node.

Question for you
28 of the IDs don't have wrappers on purpose. Mods use them as hook targets or to find a call site inside them, not as something you'd call:

  • frame loop / call site anchors: Main::Run, OnIdle, DrawGamePause, DrawWorld_And_UI, RunCameraPath, DrawWorld::Begin, Render_PreUI, BSShaderUtil::AccumulateScene, TESObjectREFR::SetSequencePosition, BSGraphics::CreateD3DAndSwapChain
  • virtual function implementations (the class's virtual already covers calling it): BSUtilityShader::SetupTechnique, BSDFLightShader::SetupGeometry, BSImagespaceShader::Render/Dispatch, BSCubeMapCamera::ClickCubeMap, BSShader::Load
  • classes with no header here: BSCullingGroup::Add, ScreenShot::TakeScreenShot, BSShaderRenderTargets::Create, BSImagespaceShaderLensFlare::RenderLensFlare, BGSBtrDB::WaterRegistration
  • the four Sun position/alpha globals, a tiled lighting lambda, the D3D11 import stub, and NiAVObject::Update (you already have your own Update)

You ok with those staying as plain IDs? If you'd rather not carry hook-only IDs I can pull them out and keep them on our side.

Builds in debug on msvc and clang-cl.

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