Minor: Ajout du Shader de l'eau
This commit is contained in:
@@ -19,6 +19,16 @@ ApplicationClass::ApplicationClass()
|
||||
m_Position = 0;
|
||||
m_Frustum = 0;
|
||||
m_DisplayPlane = 0;
|
||||
m_GroundModel = 0;
|
||||
m_WallModel = 0;
|
||||
m_BathModel = 0;
|
||||
m_WaterModel = 0;
|
||||
m_Light = 0;
|
||||
m_RefractionTexture = 0;
|
||||
m_ReflectionTexture = 0;
|
||||
m_LightShader = 0;
|
||||
m_RefractionShader = 0;
|
||||
m_WaterShader = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -191,6 +201,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
|
||||
m_Light->SetDiffuseColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
m_Light->SetDirection(0.0f, 0.0f, -1.0f);
|
||||
m_Light->SetAmbientColor(0.15f, 0.15f, 0.15f, 1.0f);
|
||||
m_Light->SetSpecularColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
m_Light->SetSpecularPower(16.0f);
|
||||
|
||||
@@ -257,6 +268,122 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
m_ModelList = new ModelListClass;
|
||||
m_ModelList->Initialize(25);
|
||||
|
||||
// Set the file names of the ground model.
|
||||
strcpy_s(modelFilename, "ground.txt");
|
||||
strcpy_s(textureFilename1, "ground01.tga");
|
||||
|
||||
// Create and initialize the ground model object.
|
||||
m_GroundModel = new ModelClass;
|
||||
|
||||
result = m_GroundModel->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3, textureFilename4,
|
||||
textureFilename5, textureFilename6);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the ground model object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the file names of the wall model.
|
||||
strcpy_s(modelFilename, "wall.txt");
|
||||
strcpy_s(textureFilename1, "wall01.tga");
|
||||
|
||||
// Create and initialize the wall model object.
|
||||
m_WallModel = new ModelClass;
|
||||
|
||||
result = m_WallModel->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3, textureFilename4,
|
||||
textureFilename5, textureFilename6);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the wall model object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the file names of the bath model.
|
||||
strcpy_s(modelFilename, "bath.txt");
|
||||
strcpy_s(textureFilename1, "marble01.tga");
|
||||
|
||||
// Create and initialize the bath model object.
|
||||
m_BathModel = new ModelClass;
|
||||
|
||||
result = m_BathModel->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3, textureFilename4,
|
||||
textureFilename5, textureFilename6);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the bath model object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the file names of the water model.
|
||||
strcpy_s(modelFilename, "water.txt");
|
||||
strcpy_s(textureFilename1, "water01.tga");
|
||||
|
||||
// Create and initialize the water model object.
|
||||
m_WaterModel = new ModelClass;
|
||||
|
||||
result = m_WaterModel->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3, textureFilename4,
|
||||
textureFilename5, textureFilename6);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the water model object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the refraction render to texture object.
|
||||
m_RefractionTexture = new RenderTextureClass;
|
||||
|
||||
result = m_RefractionTexture->Initialize(m_Direct3D->GetDevice(), screenWidth, screenHeight, SCREEN_DEPTH, SCREEN_NEAR, 1);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the refraction render texture object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the reflection render to texture object.
|
||||
m_ReflectionTexture = new RenderTextureClass;
|
||||
|
||||
result = m_ReflectionTexture->Initialize(m_Direct3D->GetDevice(), screenWidth, screenHeight, SCREEN_DEPTH, SCREEN_NEAR, 1);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the reflection render texture object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the light shader object.
|
||||
m_LightShader = new LightShaderClass;
|
||||
|
||||
result = m_LightShader->Initialize(m_Direct3D->GetDevice(), hwnd);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the light shader object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the refraction shader object.
|
||||
m_RefractionShader = new RefractionShaderClass;
|
||||
|
||||
result = m_RefractionShader->Initialize(m_Direct3D->GetDevice(), hwnd);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the refraction shader object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the water shader object.
|
||||
m_WaterShader = new WaterShaderClass;
|
||||
|
||||
result = m_WaterShader->Initialize(m_Direct3D->GetDevice(), hwnd);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the water shader object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the height of the water.
|
||||
m_waterHeight = 2.75f;
|
||||
|
||||
// Initialize the position of the water.
|
||||
m_waterTranslation = 0.0f;
|
||||
|
||||
// Create and initialize the timer object.
|
||||
m_Timer = new TimerClass;
|
||||
|
||||
@@ -313,6 +440,78 @@ void ApplicationClass::Shutdown()
|
||||
m_ShaderManager = 0;
|
||||
}
|
||||
|
||||
// Release the water shader object.
|
||||
if (m_WaterShader)
|
||||
{
|
||||
m_WaterShader->Shutdown();
|
||||
delete m_WaterShader;
|
||||
m_WaterShader = 0;
|
||||
}
|
||||
|
||||
// Release the refraction shader object.
|
||||
if (m_RefractionShader)
|
||||
{
|
||||
m_RefractionShader->Shutdown();
|
||||
delete m_RefractionShader;
|
||||
m_RefractionShader = 0;
|
||||
}
|
||||
|
||||
// Release the light shader object.
|
||||
if (m_LightShader)
|
||||
{
|
||||
m_LightShader->Shutdown();
|
||||
delete m_LightShader;
|
||||
m_LightShader = 0;
|
||||
}
|
||||
|
||||
// Release the reflection render texture object.
|
||||
if (m_ReflectionTexture)
|
||||
{
|
||||
m_ReflectionTexture->Shutdown();
|
||||
delete m_ReflectionTexture;
|
||||
m_ReflectionTexture = 0;
|
||||
}
|
||||
|
||||
// Release the refraction render texture object.
|
||||
if (m_RefractionTexture)
|
||||
{
|
||||
m_RefractionTexture->Shutdown();
|
||||
delete m_RefractionTexture;
|
||||
m_RefractionTexture = 0;
|
||||
}
|
||||
|
||||
// Release the water model object.
|
||||
if (m_WaterModel)
|
||||
{
|
||||
m_WaterModel->Shutdown();
|
||||
delete m_WaterModel;
|
||||
m_WaterModel = 0;
|
||||
}
|
||||
|
||||
// Release the bath model object.
|
||||
if (m_BathModel)
|
||||
{
|
||||
m_BathModel->Shutdown();
|
||||
delete m_BathModel;
|
||||
m_BathModel = 0;
|
||||
}
|
||||
|
||||
// Release the wall model object.
|
||||
if (m_WallModel)
|
||||
{
|
||||
m_WallModel->Shutdown();
|
||||
delete m_WallModel;
|
||||
m_WallModel = 0;
|
||||
}
|
||||
|
||||
// Release the ground model object.
|
||||
if (m_GroundModel)
|
||||
{
|
||||
m_GroundModel->Shutdown();
|
||||
delete m_GroundModel;
|
||||
m_GroundModel = 0;
|
||||
}
|
||||
|
||||
// Release the frustum class object.
|
||||
if (m_Frustum)
|
||||
{
|
||||
@@ -532,6 +731,28 @@ bool ApplicationClass::Frame(InputClass* Input)
|
||||
rotation += 360.0f;
|
||||
}
|
||||
|
||||
// Update the position of the water to simulate motion.
|
||||
m_waterTranslation += 0.001f;
|
||||
if (m_waterTranslation > 1.0f)
|
||||
{
|
||||
m_waterTranslation -= 1.0f;
|
||||
}
|
||||
|
||||
// Render the refraction of the scene to a texture.
|
||||
result = RenderRefractionToTexture();
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Render the reflection of the scene to a texture.
|
||||
result = RenderReflectionToTexture();
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//// Update the x position variable each frame.
|
||||
//x -= 0.0174532925f * 0.6f;
|
||||
|
||||
@@ -580,6 +801,88 @@ bool ApplicationClass::Frame(InputClass* Input)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ApplicationClass::RenderRefractionToTexture()
|
||||
{
|
||||
XMMATRIX worldMatrix, viewMatrix, projectionMatrix;
|
||||
XMFLOAT4 clipPlane;
|
||||
bool result;
|
||||
|
||||
// Setup a clipping plane based on the height of the water to clip everything above it.
|
||||
clipPlane = XMFLOAT4(0.0f, -1.0f, 0.0f, m_waterHeight + 0.1f);
|
||||
|
||||
// Set the render target to be the refraction render to texture and clear it.
|
||||
m_RefractionTexture->SetRenderTarget(m_Direct3D->GetDeviceContext());
|
||||
m_RefractionTexture->ClearRenderTarget(m_Direct3D->GetDeviceContext(), 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Generate the view matrix based on the camera's position.
|
||||
m_Camera->Render();
|
||||
|
||||
// Get the world, view, and projection matrices from the camera and d3d objects.
|
||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
||||
m_Camera->GetViewMatrix(viewMatrix);
|
||||
m_Direct3D->GetProjectionMatrix(projectionMatrix);
|
||||
|
||||
// Translate to where the bath model will be rendered.
|
||||
worldMatrix = XMMatrixTranslation(0.0f, 2.0f, 0.0f);
|
||||
|
||||
// Render the bath model using the refraction shader.
|
||||
m_BathModel->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_RefractionShader->Render(m_Direct3D->GetDeviceContext(), m_BathModel->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_BathModel->GetTexture(0),
|
||||
m_Light->GetDirection(), m_Light->GetAmbientColor(), m_Light->GetDiffuseColor(), clipPlane);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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.
|
||||
m_Direct3D->SetBackBufferRenderTarget();
|
||||
m_Direct3D->ResetViewport();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ApplicationClass::RenderReflectionToTexture()
|
||||
{
|
||||
XMMATRIX worldMatrix, reflectionViewMatrix, projectionMatrix;
|
||||
XMFLOAT4 diffuseColor[4], getDirection[4], ambientColor[4];
|
||||
bool result;
|
||||
|
||||
|
||||
// Set the render target to be the reflection render to texture and clear it.
|
||||
m_ReflectionTexture->SetRenderTarget(m_Direct3D->GetDeviceContext());
|
||||
m_ReflectionTexture->ClearRenderTarget(m_Direct3D->GetDeviceContext(), 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Use the camera to render the reflection and create a reflection view matrix.
|
||||
m_Camera->RenderReflection(m_waterHeight);
|
||||
|
||||
// Get the camera reflection view matrix instead of the normal view matrix.
|
||||
m_Camera->GetReflectionViewMatrix(reflectionViewMatrix);
|
||||
|
||||
// Get the world and projection matrices from the d3d object.
|
||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
||||
m_Direct3D->GetProjectionMatrix(projectionMatrix);
|
||||
|
||||
// Translate to where the wall model will be rendered.
|
||||
worldMatrix = XMMatrixTranslation(0.0f, 6.0f, 8.0f);
|
||||
|
||||
// Render the wall model using the light shader and the reflection view matrix.
|
||||
m_WallModel->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderlightShaderWater(m_Direct3D->GetDeviceContext(), m_WallModel->GetIndexCount(), worldMatrix, reflectionViewMatrix, projectionMatrix, m_WallModel->GetTexture(4),
|
||||
getDirection, ambientColor, diffuseColor);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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.
|
||||
m_Direct3D->SetBackBufferRenderTarget();
|
||||
m_Direct3D->ResetViewport();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ApplicationClass::RenderSceneToTexture(float rotation)
|
||||
{
|
||||
XMMATRIX worldMatrix, viewMatrix, projectionMatrix;
|
||||
@@ -619,9 +922,9 @@ bool ApplicationClass::RenderSceneToTexture(float rotation)
|
||||
|
||||
bool ApplicationClass::Render(float rotation, float x, float y, float z, float textureTranslation)
|
||||
{
|
||||
XMMATRIX worldMatrix, viewMatrix, orthoMatrix, projectionMatrix, rotateMatrix, translateMatrix, scaleMatrix, srMatrix;
|
||||
XMMATRIX worldMatrix, viewMatrix, orthoMatrix, projectionMatrix, rotateMatrix, translateMatrix, scaleMatrix, srMatrix, reflectionMatrix;
|
||||
float positionX, positionY, positionZ, radius;
|
||||
XMFLOAT4 diffuseColor[4], lightPosition[4];
|
||||
XMFLOAT4 diffuseColor[4], lightPosition[4], getDirection[4], ambientColor[4];
|
||||
int modelCount, renderCount, i;
|
||||
bool result, renderModel;
|
||||
float blendAmount;
|
||||
@@ -650,6 +953,9 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
|
||||
// Create the light position array from the four light positions.
|
||||
lightPosition[i] = m_Lights[i]->GetPosition();
|
||||
|
||||
// Create the light position array from the four light positions.
|
||||
ambientColor[i] = m_Lights[i]->GetPosition();
|
||||
}
|
||||
|
||||
scaleMatrix = XMMatrixScaling(0.5f, 0.5f, 0.5f); // Build the scaling matrix.
|
||||
@@ -665,7 +971,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
|
||||
// Render the model using the light shader.
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
diffuseColor, lightPosition);
|
||||
diffuseColor, lightPosition, ambientColor);
|
||||
|
||||
for (auto cube : m_cubes)
|
||||
{
|
||||
@@ -687,7 +993,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
cube->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
diffuseColor, lightPosition);
|
||||
diffuseColor, lightPosition, ambientColor);
|
||||
if (!result)
|
||||
{
|
||||
logger.Log("Could not render the cube model using the light shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
@@ -711,7 +1017,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
object->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
diffuseColor, lightPosition);
|
||||
diffuseColor, lightPosition, ambientColor);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -734,7 +1040,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
chunk->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), chunk->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, chunk->GetTexture(5),
|
||||
diffuseColor, lightPosition);
|
||||
diffuseColor, lightPosition, ambientColor);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -816,7 +1122,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
m_Model->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
diffuseColor, lightPosition);
|
||||
diffuseColor, lightPosition, ambientColor);
|
||||
if (!result)
|
||||
{
|
||||
logger.Log("Could not render the model using the light shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
@@ -925,13 +1231,78 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
}
|
||||
|
||||
|
||||
// Translate to where the ground model will be rendered.
|
||||
worldMatrix = XMMatrixTranslation(0.0f, 1.0f, 0.0f);
|
||||
|
||||
// Render the model using the multitexture shader.
|
||||
//result = m_MultiTextureShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
|
||||
// m_Model->GetTexture(0), m_Model->GetTexture(1));
|
||||
// Put the ground model vertex and index buffers on the graphics pipeline to prepare them for drawing.
|
||||
m_GroundModel->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
//// Render the model using the multitexture shader.
|
||||
//m_Model->Render(m_Direct3D->GetDeviceContext());
|
||||
// Render the ground model using the light shader.
|
||||
result = m_ShaderManager->RenderlightShaderWater(m_Direct3D->GetDeviceContext(), m_GroundModel->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_GroundModel->GetTexture(0),
|
||||
getDirection, ambientColor, diffuseColor);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the world matrix.
|
||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
||||
|
||||
|
||||
// Translate to where the wall model will be rendered.
|
||||
worldMatrix = XMMatrixTranslation(0.0f, 6.0f, 8.0f);
|
||||
|
||||
// Put the wall model vertex and index buffers on the graphics pipeline to prepare them for drawing.
|
||||
m_WallModel->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
// Render the wall model using the light shader.
|
||||
result = m_ShaderManager->RenderlightShaderWater(m_Direct3D->GetDeviceContext(), m_GroundModel->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_GroundModel->GetTexture(0),
|
||||
getDirection, ambientColor, diffuseColor);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the world matrix.
|
||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
||||
|
||||
|
||||
// Translate to where the bath model will be rendered.
|
||||
worldMatrix = XMMatrixTranslation(0.0f, 2.0f, 0.0f);
|
||||
|
||||
// Put the bath model vertex and index buffers on the graphics pipeline to prepare them for drawing.
|
||||
m_BathModel->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
// Render the bath model using the light shader.
|
||||
result = m_ShaderManager->RenderlightShaderWater(m_Direct3D->GetDeviceContext(), m_GroundModel->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_GroundModel->GetTexture(0),
|
||||
getDirection, ambientColor, diffuseColor);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the world matrix.
|
||||
m_Direct3D->GetWorldMatrix(worldMatrix);
|
||||
|
||||
// Get the camera reflection view matrix.
|
||||
m_Camera->GetReflectionViewMatrix(reflectionMatrix);
|
||||
|
||||
// Translate to where the water model will be rendered.
|
||||
worldMatrix = XMMatrixTranslation(0.0f, m_waterHeight, 0.0f);
|
||||
|
||||
// Put the water model vertex and index buffers on the graphics pipeline to prepare them for drawing.
|
||||
m_WaterModel->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
// Render the water model using the water shader.
|
||||
result = m_WaterShader->Render(m_Direct3D->GetDeviceContext(), m_WaterModel->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, reflectionMatrix,
|
||||
m_ReflectionTexture->GetShaderResourceView(), m_RefractionTexture->GetShaderResourceView(), m_WaterModel->GetTexture(0),
|
||||
m_waterTranslation, 0.01f);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Setup matrices.
|
||||
rotateMatrix = XMMatrixRotationY(rotation);
|
||||
@@ -1055,7 +1426,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
// Render the model using the transparent shader.
|
||||
m_Model->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0), diffuseColor, lightPosition);
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0), diffuseColor, lightPosition, ambientColor);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user