Directx 11 with rastertek

Tutorial 22: Render to Texture 연습문제

코다람쥐 2022. 9. 21. 15:46

To Do Exercises

1. Recompile the project and run it. You should get a spinning cube as well as a smaller spinning cube on a blue background showing the render to texture effect.

2. Modify the debug window to ensure the aspect ratio is correct for different monitor resolutions.

3. Change the 3D scene and ensure it renders correctly to a render to texture object.

4. Change the camera angle at which the render to texture sees your 3D scene.

5. Use the render to texture as a shader input to one of your own shaders and modify the result (maybe add noise, scan lines, or something easy like that).

 

 

1. 프로젝트를 다시 컴파일하여 실행합니다. 텍스처 렌더링 효과를 보여주는 회전 큐브와 파란색 배경에 더 작은 회전 큐브가 있어야 합니다.

2. 다른 모니터 해상도에서 가로세로 비율이 올바른지 확인하기 위해 debug window를 수정해보세요.

graphicsclass.cpp

bool GraphicsClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
{
.............................생략.............................
	result = m_DebugWindow->Initialize(m_D3D->GetDevice(), screenWidth, screenHeight, 192, 108);
.............................생략.............................
}

 

3. 3D 장면을 바꾸고 RTT객체가 올바르게 랜더되는지 확인하세요.

graphicsclass.cpp

bool GraphicsClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
{
.............................생략.............................
	result = m_Model->Initialize(m_D3D->GetDevice(), L"../rastertek/data/seafloor.dds",
    							"../rastertek/data/sphere.txt");
.............................생략.............................
}

 

4. 3D장면을 보는 카메라 각도를 바꿔보십시오.

graphicsclass.cpp

bool GraphicsClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
{
.............................생략.............................
	m_Camera->SetRotation(0.0f, -15.0f, 0.0f);
.............................생략.............................
}

 

5. 렌더링을 사용하여 자신의 셰이더 중 하나에 셰이더 입력으로 텍스처를 지정하고 결과를 수정합니다(노이즈, 스캔 라인 또는 그와 같은 쉬운 것을 추가할 수 있습니다).

 

??