mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
OpenGL2: Load images with "_nh" suffix as parallax normalmaps.
This commit is contained in:
parent
89701a1a45
commit
ffcec94f50
1 changed files with 14 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue