Fixed RR sets motion ids correctly.

This commit is contained in:
Justin Marshall
2026-05-28 22:29:54 -07:00
parent c795aba899
commit 3bd646d4ed
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -1576,6 +1576,7 @@ enum GeometryFlag_t
};
void APIENTRY glGeometryFlagf(GLfloat flag);
void APIENTRY glMotionObjectIdui(GLuint objectId);
#endif
+15
View File
@@ -118,6 +118,19 @@ static float RB_EstimatePathTraceSpecularStrength( const idMaterial *shader, con
return idMath::ClampFloat( 0.5f, 2.4f, strength );
}
static GLuint RB_PathTraceMotionObjectId( const drawSurf_t *surf ) {
if ( !surf || !surf->space || !surf->space->entityDef ) {
return 1;
}
const int entityIndex = surf->space->entityDef->index;
if ( entityIndex < 0 ) {
return 1;
}
return (GLuint)( entityIndex + 2 );
}
static idDrawVert *RB_BindAmbientBuffer( const srfTriangles_t *tri ) {
if ( tri->ambientVbo ) {
glBindBufferARB( GL_ARRAY_BUFFER_ARB, tri->ambientVbo );
@@ -654,6 +667,7 @@ void RB_T_FillDepthBuffer(const drawSurf_t* surf) {
else {
glGeometryFlagf(GEOMETRY_FLAG_SKELETAL);
}
glMotionObjectIdui( RB_PathTraceMotionObjectId( surf ) );
// set texture matrix and texGens. The Quake 4 path needs to know this is a depth fill.
RB_PrepareStageTexturing(pStage, surf, ac);
@@ -683,6 +697,7 @@ void RB_T_FillDepthBuffer(const drawSurf_t* surf) {
GL_SelectTexture(0);
globalImages->BindNull();
glMotionObjectIdui(0);
if (alphaTestWasEnabled) {
glDisable(GL_ALPHA_TEST);
glEnable(GL_BLEND);