Home Quixel Megascans

SOLVED: How to export to alternating file name suffixes? (cryengine calibration)

akaChris
polycounter lvl 6
Offline / Send Message
akaChris polycounter lvl 6
Hi guys,

I`m trying to setup a proper export pipeline for cryengine, which requires for the normal map with gloss to be saved as _ddna, albedo as _diff and specular as _spec. How can I define suffixes like that in export or in the calibration profile?

btw the current cryengine calibration seems off. Below is what I think should be correct (copies gloss to normal alpha). Also: shouldn't the y be flipped in the projects settings for cryengine? cryengine expects -y while xnormal is supposed to provide ddo with an +y normal?

cheers,
Chris

#include common/functions.jsx

// Exports maps for CryEngine
// Uses Gloss (instead of Roughness)
// Supports Metalness
// Bumps Normal

function Calibrate()
{
var mapType = GetMapType();
switch(mapType)
{

case "Normal":
case "Bump":
var normal = GetBumpedNormal(mapType);
AddAlphaMap(normal, "Gloss");
return normal;

case "Gloss":
var gloss = GetMergedMap();
ApplyGGXCurve(true);

return null;

default:
return GetMergedMap();
}
}

function Finish()
{

}

Replies

  • teddybergsman
    Options
    Offline / Send Message
    Thanks akaChris for the question and for the additional information! For this you can use the SetMapType function. I have now updated the CryEngine calibration profile as per your specifications:
    #include common/functions.jsx
    
    // Exports maps for CryEngine
    // Renames maps to expected CE standard
    // Uses Gloss (instead of Roughness)
    // Supports Metalness
    // Bumps Normal
    
    function Calibrate()
    {
        SetSaveAlpha(false);
        SetIgnoreSuffixType(true);
        var mapType = GetMapType();
        switch(mapType)
        {
            case "Normal":
                SetMapType("ddna");
                var normal = GetBumpedNormal(mapType);
                
                FlipY();
                AddAlphaMap(normal, "Gloss");
                ApplyGGXCurveToChannel(true);
                
                return normal;	
    
             case "Albedo":
                SetMapType("diff");
                return GetMergedMap();
                
            case "Specular":
                SetMapType("spec");
                return GetMergedMap();
                
            case "Gloss":
            case "Bump":
                return null;
                
            default:
                return GetMergedMap();
        }
    }
    
    function Finish()
    {
        
    }
    

    I've uploaded the files here:

    http://quixel.se/suite/CryEngine.jsx (goes in script/calibration)
    http://quixel.se/suite/functions.jsx (goes in script/calibration/common)

    This will now be part of 1.7. Let me know if it does not work as expected and I'll fix it up ASAP.

    - Teddy
  • akaChris
    Options
    Offline / Send Message
    akaChris polycounter lvl 6
    Hi Teddy,

    thanks for the updated files! Works like a charm!

    -Chris
  • teddybergsman
    Options
    Offline / Send Message
    Great! Thanks for letting me know :)

    - Teddy
Sign In or Register to comment.