예제 #1
0
 /// <description>
 /// Returns the script filename of where the CubemapData object was defined.  This is used by the material editor.
 /// </description>
 public void Save(string filename = "", GFXFormat format = GFXFormat.GFXFormatBC1)
 {
     InternalUnsafeMethods.Save__Args _args = new InternalUnsafeMethods.Save__Args()
     {
         filename = filename,
         format   = (int)format,
     };
     InternalUnsafeMethods.Save()(ObjectPtr, _args);
 }
예제 #2
0
        public bool HDRPostFXonEnabled(string thisobj)
        {
            // We don't allow hdr on OSX yet.
            if (sGlobal["$platform"] == "macos")
            {
                return(false);
            }

            // See what HDR format would be best.
            //%format = getBestHDRFormat();
            GFXFormat format = Util.getBestHDRFormat();

            if ((format == GFXFormat.GFXFormat_UNKNOWNSIZE) || (format == GFXFormat.GFXFormatR8G8B8A8))
            {
                // We didn't get a valid HDR format... so fail.
                return(false);
            }
            // HDR does it's own gamma calculation so
            // disable this postFx.

            ((coPostEffect)"GammaPostFX").disable();

            // Set the right global shader define for HDR.
            switch (format)
            {
            case GFXFormat.GFXFormatR10G10B10A2:
                Util.addGlobalShaderMacro("TORQUE_HDR_RGB10", "");
                break;

            case GFXFormat.GFXFormatR16G16B16A16:
                Util.addGlobalShaderMacro("TORQUE_HDR_RGB16", "");
                break;
            }

            console.print("HDR FORMAT: " + format.ToString());
            // Change the format of the offscreen surface
            // to an HDR compatible format.

            (( coSimObject)"AL_FormatToken")["format"] = format.ToString();

            Util.setReflectFormat(format);
            // Reset the light manager which will ensure the new
            // hdr encoding takes effect in all the shaders and
            // that the offscreen surface is enabled.
            Util.resetLightManager();

            return(true);
        }
/// <summary>
/// Set the reflection texture format.
///    @ingroup GFX )
/// 
/// </summary>
public  void setReflectFormat(GFXFormat format){
m_ts.fn_setReflectFormat((int)format );
}