## Copyright (c) 2021, NVIDIA CORPORATION.  All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto.  Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.app
import omni.kit.commands
import omni.kit.undo
import omni.kit.test
from .test_common import RtxTest, testSettings, postLoadTestSettings, wait_for_update

class TestMaterialDistillingToggle(RtxTest):
    """
    rtx test running renderer with material distilling toggle on to ensure renderer correctly loads in neuraylib plugins,
    compiles shader cache, inserts preprocessor macro (DISTILLED_MTL_MODE)
    """
    async def setUp(self):
        await super().setUp()
        self.set_settings(testSettings)
        self.open_usd("material_distilling.usda")
        await omni.kit.app.get_app().next_update_async()
        self.set_settings(postLoadTestSettings)

    async def test_material_distilling_toggle(self):
        await wait_for_update()
        await self.capture_and_compare("material_distilling_toggle", "material_distilling_toggle.png", 1e-3)
