강의

멘토링

커뮤니티

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

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

작성한 질문수

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

모델 띄우기

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

작성

·

8

·

수정됨

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과 동일하게 하나를 지우고 작성해도 상관없는 부분인가요??

답변

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

작성한 질문수

질문하기