Skip to content

Commit

Permalink
Code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Apr 27, 2018
1 parent 84831be commit 68fc189
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Inc/DirectXCollision.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ struct BoundingFrustum
XMFLOAT3 Origin; // Origin of the frustum (and projection).
XMFLOAT4 Orientation; // Quaternion representing rotation.

float RightSlope; // Positive X slope (X/Z).
float LeftSlope; // Negative X slope.
float TopSlope; // Positive Y slope (Y/Z).
float BottomSlope; // Negative Y slope.
float RightSlope; // Positive X (X/Z)
float LeftSlope; // Negative X
float TopSlope; // Positive Y (Y/Z)
float BottomSlope; // Negative Y
float Near, Far; // Z of the near plane and far plane.

// Creators
Expand Down
6 changes: 3 additions & 3 deletions SHMath/DirectXSHD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ HRESULT DirectX::SHProjectCubeMap(
return E_FAIL;
}

const float fV = y * fS + fB;
const float v = y * fS + fB;

XMVECTOR* pixel = ptr;
for (UINT x = 0; x < desc.Width; ++x, ++pixel)
{
const float fU = x * fS + fB;
const float u = x * fS + fB;

float ix, iy, iz;
switch (face)
Expand Down Expand Up @@ -338,7 +338,7 @@ HRESULT DirectX::SHProjectCubeMap(
XMVECTOR dir = XMVectorSet(ix, iy, iz, 0);
dir = XMVector3Normalize(dir);

const float fDiffSolid = 4.0f / ((1.0f + fU * fU + fV * fV)*sqrtf(1.0f + fU * fU + fV * fV));
const float fDiffSolid = 4.0f / ((1.0f + u * u + v * v)*sqrtf(1.0f + u * u + v * v));
fWt += fDiffSolid;

XMSHEvalDirection(shBuff, order, dir);
Expand Down
6 changes: 3 additions & 3 deletions SHMath/DirectXSHD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ HRESULT DirectX::SHProjectCubeMap(
return E_FAIL;
}

const float fV = y * fS + fB;
const float v = y * fS + fB;

XMVECTOR* pixel = ptr;
for (UINT x = 0; x < desc.Width; ++x, ++pixel)
{
const float fU = x * fS + fB;
const float u = x * fS + fB;

float ix, iy, iz;
switch (face)
Expand Down Expand Up @@ -301,7 +301,7 @@ HRESULT DirectX::SHProjectCubeMap(
XMVECTOR dir = XMVectorSet(ix, iy, iz, 0);
dir = XMVector3Normalize(dir);

const float fDiffSolid = 4.0f / ((1.0f + fU * fU + fV * fV)*sqrtf(1.0f + fU * fU + fV * fV));
const float fDiffSolid = 4.0f / ((1.0f + u * u + v * v)*sqrtf(1.0f + u * u + v * v));
fWt += fDiffSolid;

XMSHEvalDirection(shBuff, order, dir);
Expand Down

0 comments on commit 68fc189

Please sign in to comment.