OpenGL2: Load images with "_nh" suffix as parallax normalmaps.

This commit is contained in:
SmileTheory 2016-10-27 02:10:40 -07:00
parent 89701a1a45
commit ffcec94f50

View file

@ -2247,10 +2247,22 @@ static void CollapseStagesToLightall(shaderStage_t *diffuse,
image_t *normalImg;
imgFlags_t normalFlags = (diffuseImg->flags & ~(IMGFLAG_GENNORMALMAP | IMGFLAG_SRGB)) | IMGFLAG_NOLIGHTSCALE;
// try a normalheight image first
COM_StripExtension(diffuseImg->imgName, normalName, MAX_QPATH);
Q_strcat(normalName, MAX_QPATH, "_n");
Q_strcat(normalName, MAX_QPATH, "_nh");
normalImg = R_FindImageFile(normalName, IMGTYPE_NORMAL, normalFlags);
normalImg = R_FindImageFile(normalName, IMGTYPE_NORMALHEIGHT, normalFlags);
if (normalImg)
{
parallax = qtrue;
}
else
{
// try a normal image ("_n" suffix)
normalName[strlen(normalName) - 1] = '\0';
normalImg = R_FindImageFile(normalName, IMGTYPE_NORMAL, normalFlags);
}
if (normalImg)
{