Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
(params[info.m_nBlendModulateTexture]->IsTexture() );
bool hasNormalMapAlphaEnvmapMask = IS_FLAG_SET( MATERIAL_VAR_NORMALMAPALPHAENVMAPMASK );
#ifdef PARALLAX_CORRECTED_CUBEMAPS
// Parallax cubemaps
bool hasParallaxCorrection = params[info.m_nEnvmapParallax]->GetIntValue() > 0;
// Parallax cubemaps. Check for envmap because if we don't, white splotchs can appear at certain viewing angles when mat_specular is 0.
bool hasParallaxCorrection = params[info.m_nEnvmap]->IsDefined() && params[info.m_nEnvmapParallax]->GetIntValue() > 0;
#endif

if ( hasFlashlight && !IsX360() )
Expand Down
23 changes: 12 additions & 11 deletions sp/src/utils/vbsp/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#include "materialsub.h"
#include "fgdlib/fgdlib.h"
#include "manifest.h"
#ifdef PARALLAX_CORRECTED_CUBEMAPS
#include "matrixinvert.h"
#endif
Comment on lines -18 to -20
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifdef PARALLAX_CORRECTED_CUBEMAPS
#include "matrixinvert.h"
#endif
#ifdef PARALLAX_CORRECTED_CUBEMAPS
#include "mathlib/vmatrix.h"
#endif

#ifdef MAPBASE_VSCRIPT
#include "vscript_vbsp.h"
#endif
Expand Down Expand Up @@ -1657,9 +1654,11 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam)
//
if (!strcmp("parallax_obb", pClassName))
{
matrix3x4_t obbMatrix, invObbMatrix;
SetIdentityMatrix(obbMatrix);
SetIdentityMatrix(invObbMatrix);
//Originally was matrix3x2. Now we use built-in functions to the engine instead of a custom invert matrix
VMatrix obbMatrix, invObbMatrix;
MatrixSetIdentity(obbMatrix);
MatrixSetIdentity(invObbMatrix);


// Get corner and its 3 edges (scaled, local x, y, and z axes)
mapbrush_t *brush = &mapbrushes[mapent->firstbrush];
Expand Down Expand Up @@ -1714,13 +1713,15 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam)
x *= abs(DotProduct(diag, x));

// Build transformation matrix (what is needed to turn a [0,0,0] - [1,1,1] cube into this brush)
MatrixSetColumn(x, 0, obbMatrix);
MatrixSetColumn(y, 1, obbMatrix);
MatrixSetColumn(z, 2, obbMatrix);
MatrixSetColumn(corner, 3, obbMatrix);
//Originally was MatrixSetColum. Since we use VMatrix now, changed to obbMatrix
obbMatrix.SetForward(x);
obbMatrix.SetLeft(y);
obbMatrix.SetUp(z);
obbMatrix.SetTranslation(corner);

//find inverse (we need the world to local matrix, "transformationmatrix" is kind of a misnomer)
MatrixInversion(obbMatrix, invObbMatrix);
//Originally was MatrixInversion. This is now using the built in functions, not relying on MatrixInversion and matrixinvert.h anymore
MatrixInverseGeneral(obbMatrix, invObbMatrix);
break;
}

Expand Down
117 changes: 0 additions & 117 deletions sp/src/utils/vbsp/matrixinvert.h

This file was deleted.