Vertex Shader는 정상작동하는 것을 확인할 수 있지만, pixel shader는 did not run이라는 문구와 함께 디버깅도 하지 못하는 경우가 있을 것이다. 이는 프로그램 자체에서 쉐이더가 돌아갈 필요가 없다고 판단하여 작동하지 않는 경우이다.
대표적으로 몇가지 케이스가 있다.
1. early depth test
2. 완전 엉뚱한데 그리는 경우
1. depth 값이 카메라에 잡히지 않는 곳에 있으면서 생기는 문제이다. 이는 pixel shader에서 SV_DEPTH를 통해 값을 억지로 부여해서 확인해 보는 방법도 있다.
2. 내가 경험한 경우는 2번 케이스였다. 쉐이더로 보내는 cbuffer 값들이 전혀 설정이 되지 않아 IA에서는 모양이 제대로 잡혔지만, VS에서 값을 변환하면서 아에 사라져버리는 현상이 발생하였다. 그렇게되면서 PS를 그릴필요 없다고 판단한 프로그램이 원천 차단을 해버린 것이다.
cbuffer 값들을 확인해보기 전까지는 PS 자체 문제가 발생한 줄 알았다..
3. blend로 생기는 문제들도 있지만, 기본적으로 blendstate를 설정하지 않아도 화면을 그리는데에는 지장이 없기 때문에, blend로 문제 발생 시에는 blendstate를 binding하지 말고 한번 렌더링 해보자.
'Riley-Engine' 카테고리의 다른 글
AABB에 대해서 (0) | 2024.07.30 |
---|---|
bug : camera의 Projection 행렬 값 오류 (0) | 2024.07.24 |
bug : Shadow mapping 그림자 관련 (2) | 2024.07.24 |
ECS에 대해서 - 1편 - (0) | 2024.07.18 |
bug : ResizeBuffers() 가 정상작동하지 않는 문제. (0) | 2024.07.17 |