강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

언리얼공부님의 프로필 이미지
언리얼공부

작성한 질문수

[게임 프로그래머 도약반] DirectX11 입문

모델 띄우기

Model.cpp에서 ReadMaterial()의 SpecularTexture 부분 질문입니다.

작성

·

53

·

수정됨

0

node = node->NextSiblingElement();
if (node->GetText())
{
    wstring texture = Utils::ToWString(node->GetText());
    if (texture.length() > 0)
    {
        wstring textureStr = Utils::ToWString(node->GetText());
	if (textureStr.length() > 0)
	{
	    auto texture = RESOURCES->GetOrAddTexture(textureStr, (parentPath / textureStr).wstring());
	    material->SetSpecularMap(texture);
	}
    }
}

이렇게 강의에서 코드가 되어있습니다. 중간에 texture랑 textureStr를 if문으로 체크하는 부분이 중복으로 들어가는거 같아서 질문드립니다.

node = node->NextSiblingElement();
if (node->GetText())
{
    wstring textureStr = Utils::ToWString(node->GetText());
    if (textureStr.length() > 0)
    {
        auto texture = RESOURCES->GetOrAddTexture(textureStr, (parentPath / textureStr).wstring());
        material->SetSpecularMap(texture);
    }
}

위 코드처럼 Diffuse Texture와 Normal Texture과 동일하게 하나를 지우고 작성해도 상관없는 부분인가요??

퀴즈

46%나 틀려요. 한번 도전해보세요!

3D 모델 로딩 라이브러리 Assimp의 주된 목적은 무엇일까요?

3D 모델을 직접 생성합니다

다양한 3D 파일 형식을 읽어 메모리에 올립니다

모델에 복잡한 애니메이션을 추가합니다

3D 장면을 화면에 렌더링합니다

답변

답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!
언리얼공부님의 프로필 이미지
언리얼공부

작성한 질문수

질문하기