-
Tutorial 25: Texture Translation 연습문제Directx 11 with rastertek 2022. 9. 23. 13:56
To Do Exercises
1. Recompile the code and ensure you get a texture translating across the polygon surface.
2. Change the pixel shader to affect the Y axis instead of the X axis.
3. Change the pixel shader to affect both the Y axis and then X axis by the same translation value.
1. 코드를 다시 컴파일하고 도형 표면을 가로지르는 변환된 텍스처가 있는지를 확인합니다.
2. X축 대신 Y축에 영향을 미치도록 픽셀 셰이더를 변경해주세요.
translate.ps
float4 TranslatePixelShader(PixelInputType input) : SV_TARGET { // Translate the position where we sample the pixel from. input.tex.y += textureTranslation; return shaderTexture.Sample(SampleType, input.tex); }
3. 픽셀 셰이더를 변경하여 동일한 변환 값으로 Y축과 X축 모두에 영향을 주세요.
translate.ps
float4 TranslatePixelShader(PixelInputType input) : SV_TARGET { // Translate the position where we sample the pixel from. input.tex.x += textureTranslation; input.tex.y += textureTranslation; return shaderTexture.Sample(SampleType, input.tex); }
'Directx 11 with rastertek' 카테고리의 다른 글
Tutorial 28: Screen Fades (0) 2022.09.25 Tutorial 26: Transparency 연습문제 (0) 2022.09.23 Tutorial 24: Clipping Planes 연습문제 (0) 2022.09.22 Tutorial 23: Fog 연습문제 (1) 2022.09.21 Tutorial 22: Render to Texture 연습문제 (1) 2022.09.21