AFX2 T3D101 Bugs: ZodiacPlane and Billboard Asserts

From AFXWiki

Jump to: navigation, search

When running Debug builds, afxZodiacPlane and afxBillboard effects can produce this assert:

RenderTranslucentMgr::addElement() - Got null sort key... did you forget to set it?

afxZodiacPlane effects are currently used by the spells Soul Sucking Jerk and Wave Tester and the selectron Up Up Up. afxBillboard is used in the Up Up Up selectron.

This problem is remedied with a couple minor code edits...

Add the indicated line of code below to afxZodiacPlane::prepRenderImage() in file afxZodiacPlane_T3D.cpp near line 30:

bool afxZodiacPlane::prepRenderImage(SceneState* state, const U32 stateKey, const U32 /*startZone*/, const bool /*modifyBaseState*/)
{
  // ...
#if defined(AFX2_for_T3D)
  ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>();
  ri->renderDelegate.bind(this, &afxZodiacPlane::_renderZodiacPlane);
  ri->type = RenderPassManager::RIT_ObjectTranslucent;
  ri->translucentSort = true;
  ri->defaultKey = (U32)(dsize_t)mDataBlock; // < --- ADD THIS LINE
#else
  // ...
}

Add the indicated line of code below to afxBillboard::prepRenderImage() in file afxBillboard_T3D.cpp near line 32:


[[AFX: Known Bugs, Fixes, and Workarounds | Known Bugs, Fixes, and Workarounds]]
bool afxBillboard::prepRenderImage(SceneState* state, const U32 stateKey, const U32 /*startZone*/, const bool /*modifyBaseState*/)
{
  // ...
#if defined(AFX2_for_T3D)
  ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>();
  ri->renderDelegate.bind(this, &afxBillboard::_renderBillboard);
  ri->type = RenderPassManager::RIT_ObjectTranslucent;
  ri->translucentSort = true;
  ri->defaultKey = (U32)(dsize_t)mDataBlock; // < --- ADD THIS LINE
  ri->sortDistSq = getWorldBox().getSqDistanceToPoint( state->getCameraPosition() );      
  state->getRenderPass()->addInst(ri);
#else
  // ...
}


Back to Known Bugs, Fixes, and Workarounds

Personal tools