Skip to content

Commit

Permalink
support color fields as actor uniforms
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and nashmuhandes committed Feb 7, 2025
1 parent 3272a2f commit 9d1f7f1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/r_data/gldefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,19 @@ void UserShaderDesc::BindActorFields(void * act_v)
{
setUniformF(uniformField, FVector4(*(DVector4*)addr));
}
else if(t == TypeColor)
{
if(uniformField.Type == UniformType::Int)
{
setUniformI(uniformField, *(int*)addr);
}
else
{
PalEntry col;
col.d = *(uint32_t*)addr;
setUniformF(uniformField, FVector4(col.r / 255.0, col.g / 255.0, col.b / 255.0, col.a / 255.0));
}
}
}
}
}
Expand Down

0 comments on commit 9d1f7f1

Please sign in to comment.