Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Commit c4be3b9

Browse files
authored
Merge branch 'master' into feature_splines
2 parents b3b2463 + 0373eb4 commit c4be3b9

File tree

8 files changed

+27
-8
lines changed

8 files changed

+27
-8
lines changed

install.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ FOR /F "delims=" %%i IN ('dir "C:\Program Files (x86)\Windows Kits\10\Include" /
6767
GOTO :found
6868
)
6969
call :colorEcho %red% No Windows SDK found in location: C:\Program Files (x86)\Windows Kits\10\Include
70-
EXIT 1
70+
goto :eof
7171
:found
7272
echo Latest installed Windows SDK: %windows_sdk_version%
7373
echo Windows SDK required: 10.0.17763.0 or newer
@@ -84,7 +84,7 @@ if "%is_remote%" == "1" (
8484
) else (
8585
pause
8686
)
87-
EXIT
87+
goto :eof
8888
REM ##### MAIN #####
8989

9090
REM ##### DOWNLOAD DEPS #####

reload.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if "%is_remote%" == "1" (
3535
) else (
3636
pause
3737
)
38-
EXIT
38+
goto :eof
3939
REM ##### MAIN #####
4040

4141
REM ##### Update Submodules ####

src/d3d12/d3d12_settings.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@ namespace wr::d3d12::settings
4949
static const constexpr unsigned int num_max_rt_materials = 3000;
5050
static const constexpr unsigned int num_max_rt_textures = 1000;
5151
static const constexpr unsigned int fallback_ptrs_offset = 3500;
52+
static const constexpr std::uint32_t res_skybox = 1024;
53+
static const constexpr std::uint32_t res_envmap = 512;
5254

5355
} /* wr::d3d12::settings */

src/render_tasks/d3d12_equirect_to_cubemap.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ namespace wr
180180

181181
data.in_equirect = skybox_node->m_hdr;
182182

183-
skybox_node->m_skybox = skybox_node->m_hdr.m_pool->CreateCubemap("Skybox", 3840, 3840, 0, wr::Format::R32G32B32A32_FLOAT, true);
183+
skybox_node->m_skybox = skybox_node->m_hdr.m_pool->CreateCubemap("Skybox", d3d12::settings::res_skybox, d3d12::settings::res_skybox, 0, wr::Format::R32G32B32A32_FLOAT, true);
184184

185-
skybox_node->m_prefiltered_env_map = skybox_node->m_hdr.m_pool->CreateCubemap("FilteredEnvMap", 512, 512, 5, wr::Format::R32G32B32A32_FLOAT, true);
185+
skybox_node->m_prefiltered_env_map = skybox_node->m_hdr.m_pool->CreateCubemap("FilteredEnvMap", d3d12::settings::res_envmap, d3d12::settings::res_envmap, 5, wr::Format::R32G32B32A32_FLOAT, true);
186186

187187
data.out_cubemap = skybox_node->m_skybox.value();
188188
data.out_pref_env = skybox_node->m_prefiltered_env_map.value();

src/scene_graph/camera_node.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ namespace wr
3939
DirectX::XMVECTOR right = DirectX::XMVector3Normalize(m_transform.r[0]);
4040

4141
m_view = DirectX::XMMatrixLookToRH(pos, forward, up);
42+
43+
if (!m_override_projection)
44+
{
45+
m_projection = DirectX::XMMatrixPerspectiveFovRH(m_fov.m_fov, m_aspect_ratio, m_frustum_near, m_frustum_far);
46+
}
4247

43-
m_projection = DirectX::XMMatrixPerspectiveFovRH(m_fov.m_fov, m_aspect_ratio, m_frustum_near, m_frustum_far);
4448
m_view_projection = m_view * m_projection;
4549
m_inverse_projection = DirectX::XMMatrixInverse(nullptr, m_projection);
4650
m_inverse_view = DirectX::XMMatrixInverse(nullptr, m_view);

src/scene_graph/camera_node.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ namespace wr
4141
m_f_number(32.0f),
4242
m_shape_amt(0.0f),
4343
m_aperture_blades(5),
44-
m_focus_dist(0)
44+
m_focus_dist(0),
45+
m_override_projection(false)
4546
{
4647
}
4748

@@ -71,6 +72,7 @@ namespace wr
7172
float m_shape_amt;
7273
int m_aperture_blades;
7374
bool m_enable_dof = false;
75+
bool m_override_projection;
7476

7577
FoV m_fov;
7678

src/scene_graph/node.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace wr
1111
Node::Node(std::type_info const & type_info) : m_type_info(type_info)
1212
{
1313
SignalTransformChange();
14+
m_used_quaternion = false;
1415
}
1516

1617
void Node::SignalChange()
@@ -62,6 +63,13 @@ namespace wr
6263
SignalTransformChange();
6364
}
6465

66+
void Node::SetQuaternionRotation( float x, float y, float z, float w )
67+
{
68+
m_rotation = { x,y,z,w };
69+
m_used_quaternion = true;
70+
SignalTransformChange();
71+
}
72+
6573
void Node::SetPosition(DirectX::XMVECTOR position)
6674
{
6775
m_position = position;

src/scene_graph/node.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ namespace wr
2424
virtual void SetRotation(DirectX::XMVECTOR roll_pitch_yaw);
2525
virtual void SetRotationQuaternion(DirectX::XMVECTOR rotation);
2626

27+
//Takes raw values of a quaternion
28+
virtual void SetQuaternionRotation( float x, float y, float z, float w );
29+
2730
//Sets position
2831
virtual void SetPosition(DirectX::XMVECTOR position);
2932

@@ -62,6 +65,6 @@ namespace wr
6265
private:
6366
std::bitset<3> m_requires_update;
6467
std::bitset<3> m_requires_transform_update;
65-
68+
bool m_used_quaternion;
6669
};
6770
} // namespace wr

0 commit comments

Comments
 (0)