GPU 스텐실 참조 값 가져오기
gpu_get_stencil_ref
함수는 현재 스텐실 테스트 참조 값을 가져오는 기능을 제공합니다. 이 값은 gpu_set_stencil_ref
에 의해 설정됩니다. 스텐실 참조 값은 스텐실 테스트에서 다음과 같이 사용됩니다:
- ref: 스텐실 참조 값
- cmp_func: 스텐실 테스트에 사용되는 비교 함수
문법
gpu_get_stencil_ref()
반환 값
- Real: 현재 스텐실 테스트에 사용되는 참조 값
예제
var _ref = gpu_get_stencil_ref();
위 코드는 현재 스텐실 테스트에 사용되는 참조 값을 가져와서 임시 변수 _ref
에 저장합니다.
활용 예제
예제 1: 스텐실 테스트 값 확인
var current_ref = gpu_get_stencil_ref();
show_message("현재 스텐실 참조 값: " + string(current_ref));
예제 2: 스텐실 테스트 설정 후 값 확인
gpu_set_stencil_ref(5); // 스텐실 참조 값 설정
var new_ref = gpu_get_stencil_ref(); // 설정한 값 가져오기
show_message("설정한 스텐실 참조 값: " + string(new_ref));
예제 3: 스텐실 테스트 조건에 따른 동작
var stencil_ref = gpu_get_stencil_ref();
if (stencil_ref > 0) {
// 스텐실 참조 값이 0보다 클 경우의 동작
show_message("스텐실 참조 값이 0보다 큽니다.");
} else {
// 스텐실 참조 값이 0일 경우의 동작
show_message("스텐실 참조 값이 0입니다.");
}
관련 함수
함수 이름 | 설명 |
---|---|
gpu_set_stencil_ref | 스텐실 테스트 참조 값 설정 |
gpu_get_stencil_func | 스텐실 테스트에 사용되는 비교 함수 가져오기 |
© Copyright YoYo Games Ltd. 2024 All Rights Reserved