Patch Update - Terrain Tweak
This commit is contained in:
parent
d7965fec64
commit
7d2b962420
@ -910,9 +910,9 @@ bool ApplicationClass::RenderRefractionToTexture()
|
|||||||
m_Camera->Render();
|
m_Camera->Render();
|
||||||
|
|
||||||
// Get the world, view, and projection matrices from the camera and d3d objects.
|
// Get the world, view, and projection matrices from the camera and d3d objects.
|
||||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
m_Camera->GetViewMatrix(viewMatrix);
|
m_Camera->GetViewMatrix(viewMatrix);
|
||||||
m_Direct3D->GetProjectionMatrix(projectionMatrix);
|
projectionMatrix = m_Direct3D->GetProjectionMatrix();
|
||||||
|
|
||||||
// Get the light properties.
|
// Get the light properties.
|
||||||
for (i = 0; i < m_numLights; i++)
|
for (i = 0; i < m_numLights; i++)
|
||||||
@ -965,8 +965,8 @@ bool ApplicationClass::RenderReflectionToTexture()
|
|||||||
m_Camera->GetReflectionViewMatrix(reflectionViewMatrix);
|
m_Camera->GetReflectionViewMatrix(reflectionViewMatrix);
|
||||||
|
|
||||||
// Get the world and projection matrices from the d3d object.
|
// Get the world and projection matrices from the d3d object.
|
||||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
m_Direct3D->GetProjectionMatrix(projectionMatrix);
|
projectionMatrix = m_Direct3D->GetProjectionMatrix();
|
||||||
|
|
||||||
|
|
||||||
// Reset the render target back to the original back buffer and not the render to texture anymore. And reset the viewport back to the original.
|
// Reset the render target back to the original back buffer and not the render to texture anymore. And reset the viewport back to the original.
|
||||||
@ -989,7 +989,7 @@ bool ApplicationClass::RenderSceneToTexture(float rotation)
|
|||||||
m_Camera->Render();
|
m_Camera->Render();
|
||||||
|
|
||||||
// Get the matrices.
|
// Get the matrices.
|
||||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
m_Camera->GetViewMatrix(viewMatrix);
|
m_Camera->GetViewMatrix(viewMatrix);
|
||||||
m_RenderTexture->GetProjectionMatrix(projectionMatrix);
|
m_RenderTexture->GetProjectionMatrix(projectionMatrix);
|
||||||
|
|
||||||
@ -1030,10 +1030,10 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
|||||||
|
|
||||||
|
|
||||||
// Get the world, view, and projection matrices from the camera and d3d objects.
|
// Get the world, view, and projection matrices from the camera and d3d objects.
|
||||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
m_Camera->GetViewMatrix(viewMatrix);
|
m_Camera->GetViewMatrix(viewMatrix);
|
||||||
m_Direct3D->GetProjectionMatrix(projectionMatrix);
|
projectionMatrix = m_Direct3D->GetProjectionMatrix();
|
||||||
m_Direct3D->GetOrthoMatrix(orthoMatrix);
|
orthoMatrix = m_Direct3D->GetOrthoMatrix();
|
||||||
|
|
||||||
// Get the light properties.
|
// Get the light properties.
|
||||||
for (i = 0; i < m_numLights; i++)
|
for (i = 0; i < m_numLights; i++)
|
||||||
@ -1122,8 +1122,8 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
|||||||
rotateMatrix = object->GetRotateMatrix();
|
rotateMatrix = object->GetRotateMatrix();
|
||||||
}
|
}
|
||||||
translateMatrix = object->GetTranslateMatrix();
|
translateMatrix = object->GetTranslateMatrix();
|
||||||
srMatrix = XMMatrixMultiply(scaleMatrix, rotateMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
worldMatrix = XMMatrixMultiply(srMatrix, translateMatrix);
|
|
||||||
|
|
||||||
object->Render(m_Direct3D->GetDeviceContext());
|
object->Render(m_Direct3D->GetDeviceContext());
|
||||||
|
|
||||||
@ -1216,7 +1216,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset the world matrix.
|
// Reset the world matrix.
|
||||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
|
|
||||||
// Get the camera reflection view matrix.
|
// Get the camera reflection view matrix.
|
||||||
m_Camera->GetReflectionViewMatrix(reflectionMatrix);
|
m_Camera->GetReflectionViewMatrix(reflectionMatrix);
|
||||||
@ -1334,7 +1334,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
|||||||
m_Direct3D->EnableAlphaBlending();
|
m_Direct3D->EnableAlphaBlending();
|
||||||
|
|
||||||
// Reset the world matrix.
|
// Reset the world matrix.
|
||||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
worldMatrix = m_Direct3D->GetWorldMatrix();
|
||||||
|
|
||||||
// Render the render count text string using the font shader.
|
// Render the render count text string using the font shader.
|
||||||
m_RenderCountString->Render(m_Direct3D->GetDeviceContext());
|
m_RenderCountString->Render(m_Direct3D->GetDeviceContext());
|
||||||
@ -1635,16 +1635,16 @@ void ApplicationClass::GenerateTerrain()
|
|||||||
|
|
||||||
|
|
||||||
// for loop to generate terrain chunks for a 10x10 grid
|
// for loop to generate terrain chunks for a 10x10 grid
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 10; j++)
|
for (int j = 0; j < 20; j++)
|
||||||
{
|
{
|
||||||
Object* newTerrain = new Object();
|
Object* newTerrain = new Object();
|
||||||
newTerrain->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textures);
|
newTerrain->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textures);
|
||||||
|
|
||||||
newTerrain->SetScaleMatrix(scaleMatrix);
|
newTerrain->SetScaleMatrix(scaleMatrix);
|
||||||
|
|
||||||
newTerrain->SetTranslateMatrix(XMMatrixTranslation(i / 2 * (scaleX * 2), -12.0f, j * (scaleZ * 2)));
|
newTerrain->SetTranslateMatrix(XMMatrixTranslation(i / 2 * scaleX, -12.0f, j * scaleZ));
|
||||||
|
|
||||||
newTerrain->SetName(filenameWithoutExtension);
|
newTerrain->SetName(filenameWithoutExtension);
|
||||||
|
|
||||||
|
@ -565,28 +565,6 @@ ID3D11DeviceContext* D3DClass::GetDeviceContext()
|
|||||||
return m_deviceContext;
|
return m_deviceContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XMMATRIX D3DClass::GetProjectionMatrix(XMMATRIX& projectionMatrix)
|
|
||||||
{
|
|
||||||
projectionMatrix = m_projectionMatrix;
|
|
||||||
return m_projectionMatrix;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void D3DClass::GetWorldMatrix(XMMATRIX& worldMatrix)
|
|
||||||
{
|
|
||||||
worldMatrix = m_worldMatrix;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void D3DClass::GetOrthoMatrix(XMMATRIX& orthoMatrix)
|
|
||||||
{
|
|
||||||
orthoMatrix = m_orthoMatrix;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void D3DClass::GetVideoCardInfo(char* cardName, int& memory)
|
void D3DClass::GetVideoCardInfo(char* cardName, int& memory)
|
||||||
{
|
{
|
||||||
strcpy_s(cardName, 128, m_videoCardDescription);
|
strcpy_s(cardName, 128, m_videoCardDescription);
|
||||||
|
@ -42,14 +42,14 @@ public:
|
|||||||
|
|
||||||
ID3D11Device* GetDevice();
|
ID3D11Device* GetDevice();
|
||||||
ID3D11DeviceContext* GetDeviceContext();
|
ID3D11DeviceContext* GetDeviceContext();
|
||||||
XMMATRIX GetProjectionMatrix(XMMATRIX& projectionMatrix);
|
//XMMATRIX GetProjectionMatrix(XMMATRIX& projectionMatrix);
|
||||||
IDXGISwapChain* m_swapChain;
|
IDXGISwapChain* m_swapChain;
|
||||||
IDXGISwapChain* GetSwapChain();
|
IDXGISwapChain* GetSwapChain();
|
||||||
void ResizeSwapChain(int, int);
|
void ResizeSwapChain(int, int);
|
||||||
|
|
||||||
XMMATRIX GetProjectionMatrix();
|
XMMATRIX GetProjectionMatrix() const { return m_projectionMatrix; };
|
||||||
void GetWorldMatrix(XMMATRIX&);
|
XMMATRIX GetWorldMatrix() const { return m_worldMatrix;};
|
||||||
void GetOrthoMatrix(XMMATRIX&);
|
XMMATRIX GetOrthoMatrix() const { return m_orthoMatrix; };
|
||||||
|
|
||||||
void GetVideoCardInfo(char*, int&);
|
void GetVideoCardInfo(char*, int&);
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ Pos=60,60
|
|||||||
Size=342,82
|
Size=342,82
|
||||||
|
|
||||||
[Window][Light]
|
[Window][Light]
|
||||||
Pos=1547,17
|
Pos=1548,17
|
||||||
Size=358,535
|
Size=358,535
|
||||||
|
|
||||||
[Window][Shader Manager]
|
[Window][Shader Manager]
|
||||||
Pos=30,255
|
Pos=28,255
|
||||||
Size=172,284
|
Size=172,284
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user