|
|
|
|
@@ -873,9 +873,6 @@ bool application_class::frame(input_class* Input)
|
|
|
|
|
// Update the sun camera position and rotation based on the light position.
|
|
|
|
|
sun_camera_->set_position(sun_light_->GetPosition().x, sun_light_->GetPosition().y, sun_light_->GetPosition().z);
|
|
|
|
|
sun_camera_->set_rotation(pitch, yaw, roll);
|
|
|
|
|
|
|
|
|
|
// sun_camera_->set_position(positionX, positionY, positionZ);
|
|
|
|
|
// sun_camera_->set_rotation(rotationX, rotationY, 0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
active_camera_->render();
|
|
|
|
|
@@ -915,6 +912,7 @@ bool application_class::frame(input_class* Input)
|
|
|
|
|
result = render_refraction_to_texture();
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
LOG_ERROR("Could not render the refraction texture");
|
|
|
|
|
R_FALSE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -922,6 +920,7 @@ bool application_class::frame(input_class* Input)
|
|
|
|
|
result = render_reflection_to_texture();
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
LOG_ERROR("Could not render the reflection texture");
|
|
|
|
|
R_FALSE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1002,6 +1001,7 @@ bool application_class::render_refraction_to_texture()
|
|
|
|
|
bath_model_->GetTexture(TextureType::Diffuse,0), lights_[0]->GetDirection(), ambientColor, diffuseColor, lightPosition, clipPlane);
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
LOG_ERROR("Could not render the bath model using the refraction shader");
|
|
|
|
|
R_FALSE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1058,6 +1058,7 @@ bool application_class::render_scene_to_texture(float rotation)
|
|
|
|
|
model_->GetTexture(TextureType::Diffuse,0));
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
LOG_ERROR("Could not render the model using the texture shader");
|
|
|
|
|
R_FALSE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1074,10 +1075,6 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|
|
|
|
XMFLOAT4 diffuseColor[4], lightPosition[4], ambientColor[4];
|
|
|
|
|
int i;
|
|
|
|
|
bool result;
|
|
|
|
|
float blendAmount;
|
|
|
|
|
|
|
|
|
|
// Set the blending amount to 10%.
|
|
|
|
|
blendAmount = 0.1f;
|
|
|
|
|
|
|
|
|
|
// Generate the view matrix based on the camera's position.
|
|
|
|
|
active_camera_->render();
|
|
|
|
|
@@ -1088,9 +1085,6 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|
|
|
|
projectionMatrix = direct_3d_->get_projection_matrix();
|
|
|
|
|
orthoMatrix = direct_3d_->get_ortho_matrix();
|
|
|
|
|
|
|
|
|
|
//render Sky box
|
|
|
|
|
//RenderSkybox(viewMatrix, projectionMatrix);
|
|
|
|
|
|
|
|
|
|
// Get the light properties.
|
|
|
|
|
for (i = 0; i < num_lights_; i++)
|
|
|
|
|
{
|
|
|
|
|
@@ -1117,12 +1111,6 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|
|
|
|
direct_3d_->reset_viewport();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// CPT ALED C'EST ICI QUE CA SE PASSE ///
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//scene_texture_->SetRenderTarget(direct_3d_->get_device_context());
|
|
|
|
|
//scene_texture_->ClearRenderTarget(direct_3d_->get_device_context(), 0.0f, 0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
|
|
scaleMatrix = XMMatrixScaling(0.5f, 0.5f, 0.5f); // Build the scaling matrix.
|
|
|
|
|
rotateMatrix = XMMatrixRotationY(rotation); // Build the rotation matrix.
|
|
|
|
|
translateMatrix = XMMatrixTranslation(x, y, z); // Build the translation matrix.
|
|
|
|
|
@@ -1145,12 +1133,7 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|
|
|
|
// -------------------------------------------------------- //
|
|
|
|
|
// ------------ render the object in the queue ------------ //
|
|
|
|
|
// -------------------------------------------------------- //
|
|
|
|
|
|
|
|
|
|
// set the active camera to the sun camera for rendering the shadow map.
|
|
|
|
|
// active_camera_ = sun_camera_;
|
|
|
|
|
// active_camera_->render();
|
|
|
|
|
// // Render the objects in the render queues. with depth only pass.
|
|
|
|
|
// active_camera_->get_view_matrix(viewMatrix);
|
|
|
|
|
|
|
|
|
|
result = render_pass(diffuseColor, lightPosition, ambientColor, viewMatrix, projectionMatrix);
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
@@ -1158,21 +1141,6 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|
|
|
|
R_FALSE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Reset the active camera to the main camera.
|
|
|
|
|
// active_camera_ = camera_;
|
|
|
|
|
// active_camera_->render();
|
|
|
|
|
// active_camera_->get_view_matrix(viewMatrix);
|
|
|
|
|
//
|
|
|
|
|
// // render the objects in the render queues. with standard pass.
|
|
|
|
|
// result = render_pass(render_queues_, diffuseColor, lightPosition, ambientColor, viewMatrix, projectionMatrix);
|
|
|
|
|
// if (!result)
|
|
|
|
|
// {
|
|
|
|
|
// LOG_ERROR("Could not render the model using any shader");
|
|
|
|
|
// R_FALSE
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// stats_->update_geometric_stats();
|
|
|
|
|
|
|
|
|
|
// Update the render count text.
|
|
|
|
|
result = update_render_count_string(get_render_count());
|
|
|
|
|
if (!result)
|
|
|
|
|
@@ -1193,6 +1161,7 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|
|
|
|
bath_model_->GetTexture(TextureType::Diffuse,0), diffuseColor, lightPosition, ambientColor);
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
LOG_ERROR("Bath model could not be rendered using the light shader");
|
|
|
|
|
R_FALSE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|