Lots of graphics fixes.

This commit is contained in:
Justin Marshall
2026-04-23 22:07:20 -07:00
parent 7877bcb26c
commit fba147e7f8
8 changed files with 396 additions and 82 deletions
-8
View File
@@ -428,14 +428,6 @@ static bool R_ParseImageProgram_r( idLexer &src, byte **pic, int *width, int *he
return false;
}
if (width2 <= 0 || height2 <= 0) {
if (pic) {
R_StaticFree(*pic);
*pic = NULL;
}
return false;
}
// process it
if ( pic ) {
R_AddNormalMaps( *pic, *width, *height, pic2, width2, height2 );
+2 -1
View File
@@ -577,6 +577,7 @@ void idRenderModelStatic::UpdateDXR(uint32_t& dxrBottomAcel, int onlySurface)
std::vector<uint32_t> indices(numDXRIndexes);
int vertexId = 0;
int indexId = 0;
for (int i = 0; i < surfaces.Num(); i++)
{
if (onlySurface != -1 && onlySurface != i)
@@ -585,7 +586,7 @@ void idRenderModelStatic::UpdateDXR(uint32_t& dxrBottomAcel, int onlySurface)
modelSurface_t* surf = &surfaces[i];
for (int d = 0; d < surf->geometry->numIndexes; ++d)
{
indices[d] = vertexId + surf->geometry->indexes[d];
indices[indexId++] = vertexId + surf->geometry->indexes[d];
}
for (int d = 0; d < surf->geometry->numVerts; ++d)
+2
View File
@@ -137,6 +137,8 @@ typedef struct srfTriangles_s {
struct vertCache_s * ambientCache; // idDrawVert
struct vertCache_s * lightingCache; // lightingCache_t
struct vertCache_s * shadowCache; // shadowCache_t
bool isSkeletal;
} srfTriangles_t;
typedef idList<srfTriangles_t *> idTriList;
+1 -1
View File
@@ -301,7 +301,7 @@ void idMD5Mesh::UpdateSurface( const struct renderEntity_s *ent, const idJointMa
tri->deformedSurface = true;
tri->tangentsCalculated = false;
tri->facePlanesCalculated = false;
tri->isSkeletal = true;
tri->numIndexes = deformInfo->numIndexes;
tri->indexes = deformInfo->indexes;
tri->silIndexes = deformInfo->silIndexes;
+1 -1
View File
@@ -182,7 +182,7 @@ idRenderModel *idRenderWorldLocal::ParseModel( idLexer *src ) {
// add the completed surface to the model
model->AddSurface( surf );
if(!surf.shader->IsSky())
if (!surf.shader->IsSky())
{
idRenderModelStatic* modelStatic = (idRenderModelStatic*)model;
dxrWorldModel_t dxrModel;
+10 -3
View File
@@ -500,8 +500,7 @@ void RB_T_FillDepthBuffer( const drawSurf_t *surf ) {
// draw the entire surface solid
// draw the entire surface solid
if (drawSolid) {
glDisable(GL_BLEND);
if (drawSolid && !shader->IsSky()) {
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
// bind the texture
GL_SelectTexture(0);
@@ -513,6 +512,15 @@ void RB_T_FillDepthBuffer( const drawSurf_t *surf ) {
shader->GetBumpImage()->Bind();
glBindNormalMapTexture(shader->GetBumpImage()->texnum);
if (!surf->geo->isSkeletal)
{
glGeometryFlagf(GEOMETRY_FLAG_NONE);
}
else
{
glGeometryFlagf(GEOMETRY_FLAG_SKELETAL);
}
// set texture matrix and texGens. The Quake 4 path needs to know this is a depth fill.
RB_PrepareStageTexturing(pStage, surf, ac);
@@ -524,7 +532,6 @@ void RB_T_FillDepthBuffer( const drawSurf_t *surf ) {
GL_SelectTexture(1);
globalImages->BindNull();
GL_SelectTexture(0);
glEnable(GL_BLEND);
}