Facepunch / sbox-issues

176 stars 12 forks source link

Opening tools breaks cubemap textures in scene temporarily #5052

Open kira0x1 opened 8 months ago

kira0x1 commented 8 months ago

Describe the bug

Opening animgraph or modeldoc breaks cubemap textures in scene until the animgraph is closed, and then it returns back to normal. I assume its using the cubemap in the animgraph preview maybe?

To Reproduce

1 - have a plane with a reflective material i.e dev_metal_rough40 2 - open a animationgraph window

Expected behavior

Lighting preview in tools should not affect scene lighting.

Media/Files

https://github.com/Facepunch/sbox-issues/assets/13779328/4257b5fd-05ef-4f44-9693-b3db58ce47e7

image

Additional context

os: windows 11 gpu: 3070ti ram: 32gb ram, cpu: intel i5-12400F

Logs when opening the animgraph

 02:23:37   engine/InputBindSystem * Rehandling active codes
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/models/solids/black_color_tga_772d73e6.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 2 (materials/models/solids/black_color_tga_772d73e6.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 2 -> 3 (materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 3 -> 2 (materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/models/solids/black_color_tga_772d73e6.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 2 -> 1 (materials/models/solids/black_color_tga_772d73e6.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex)
 02:23:38   engine/ResourceSystem WARNING: Long resource system update - should have taken no more than 1ns, but took 0.0059s! (Frame #1036534)
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/models/solids/black_color_tga_772d73e6.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/models/editor/sun.vmat ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/models/solids/black.vmat ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/sun.vphys ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/sun_mesh.vmesh ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/sun.vmdl ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/ResourceSystem WARNING: Long resource system update - should have taken no more than 1ns, but took 0.0049s! (Frame #1036535)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/editor/env_sky_tga_8342e814.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (materials/editor/env_sky_tga_8342e814.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/editor/env_sky_tga_8342e814.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (materials/editor/env_sky_tga_8342e814.generated.vtex)
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/editor/env_sky_tga_8342e814.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/editor/env_sky.vmat ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex)
 02:23:38   engine/RenderSystem TEX read request: 976 KB; materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex_c
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex)
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/skybox/light_test_sky_default.vmat ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 2 (materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 2 -> 1 (materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( materials/editor/env_cubemap_model.vmat ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/env_cubemap_mesh.vmesh ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/env_cubemap.vmdl ) - RESOURCE_LOAD_SUCCESS
 02:23:38   engine/ResourceSystem WARNING: Long resource system update - should have taken no more than 1ns, but took 0.0042s! (Frame #1037143)
 02:23:38   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:38   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (models/editor/spawnpoint_color_png_ef2698c2.generated.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 2 (models/editor/spawnpoint_color_png_ef2698c2.generated.vtex)
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 2 -> 1 (models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (models/editor/spawnpoint_color_png_ef2698c2.generated.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (models/editor/spawnpoint_color_png_ef2698c2.generated.vtex)
 02:23:39   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:39   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/spawnpoint_color_png_ef2698c2.generated.vtex ) - RESOURCE_LOAD_SUCCESS
 02:23:39   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/spawnpoint.vmat ) - RESOURCE_LOAD_SUCCESS
 02:23:39   engine/AssetSystem CAssetSystem::NotifyResourceStatusChange( models/editor/spawnpoint.vmdl ) - RESOURCE_LOAD_SUCCESS
 02:23:39   engine/ResourceSystem WARNING: Long resource system update - should have taken no more than 1ns, but took 0.0038s! (Frame #1037204)
 02:23:39   engine/Hammer  [1] Took 0.000 seconds to create selection set for hidden nodes
 02:23:39   engine/AssetSystem  [1] CAssetSystem::HandleFileChange: C:\Program Files (x86)\Steam\steamapps\common\sbox\addons\citizen\models\first_person\first_person_arms_punching.vanmgrph
 02:23:39   engine/InputBindSystem  [3] * Rehandling active codes
 02:23:39   engine/AssetSystem CAssetSystem::HandleFileChange: C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\17980_16372_1ad8.dmx
 02:23:39   engine/AssetSystem Irrelevant deleted file: C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\17980_16372_1ad8.dmx
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_light_probe_volume_16.vtex_c )
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_cubemap_16.vtex_c )
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_light_probe_volume_16.vtex )
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_cubemap_16.vtex )
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_cubemap_16.txt )
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_light_probe_volume_16.exr )
 02:23:39   engine/AssetSystem Ignoring file change for non-asset file ( C:\Program Files (x86)\Steam\steamapps\common\sbox\core\maps\editor\_bakeresourcecache\toolscene_default_baked\env_cubemap_16.exr )
 02:23:39   engine/InputBindSystem * Rehandling active codes
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (maps/editor/_bakeresourcecache/toolscene_default_baked/env_cubemap_16.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (maps/editor/_bakeresourcecache/toolscene_default_baked/env_cubemap_16.vtex)
 02:23:39   engine/RenderSystem TEX read request: 298 KB; maps/editor/_bakeresourcecache/toolscene_default_baked/env_cubemap_16.vtex_c
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (maps/editor/_bakeresourcecache/toolscene_default_baked/env_cubemap_16.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (maps/editor/_bakeresourcecache/toolscene_default_baked/env_cubemap_16.vtex)
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::LoadStreamingData LoadStreamingData (maps/editor/_bakeresourcecache/toolscene_default_baked/env_light_probe_volume_16.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 0 -> 1 (maps/editor/_bakeresourcecache/toolscene_default_baked/env_light_probe_volume_16.vtex)
 02:23:39   engine/RenderSystem TEXMAN: CTextureManagerBase::MN_OnResourceLoadCompleted MarkTextureBitsLoaded (maps/editor/_bakeresourcecache/toolscene_default_baked/env_light_probe_volume_16.vtex)
 02:23:39   engine/RenderSystem TEXMAN: Outstanding stream count 1 -> 0 (maps/editor/_bakeresourcecache/toolscene_default_baked/env_light_probe_volume_16.vtex)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 1/1 mips (4x4 / 4x4) of materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex (8 bytes)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 6/6 mips (128x128 / 128x128) of materials/models/solids/black_color_tga_772d73e6.generated.vtex (10920 bytes)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 1/1 mips (4x4 / 4x4) of materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex (16 bytes)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 5/5 mips (64x64 / 64x64) of materials/editor/env_sky_tga_8342e814.generated.vtex (2728 bytes)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 8/8 mips (512x512 / 512x512) of materials/skybox/tests/src/lightingtest_sky_default_exr_2abc5e5.generated.vtex (999979 bytes)
 02:23:38   engine/RenderSystem Decompressed 8 texture mips in 0.59 ms (3383.5mb/s)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 1/1 mips (4x4 / 4x4) of materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex (8 bytes)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 1/1 mips (4x4 / 4x4) of materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex (16 bytes)
 02:23:38   engine/RenderSystem TEXMAN: streaming loaded gpu 1/1 mips (4x4 / 4x4) of models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex (16 bytes)
 02:23:39   engine/RenderSystem TEXMAN: streaming loaded gpu 8/8 mips (512x512 / 512x512) of models/editor/spawnpoint_color_png_ef2698c2.generated.vtex (122021 bytes)
 02:23:39   engine/RenderSystem Decompressed 8 texture mips in 0.05 ms (3467.6mb/s)
 02:23:39   engine/RenderSystem TEXMAN: streaming loaded gpu 7/7 mips (256x256 / 256x256) of maps/editor/_bakeresourcecache/toolscene_default_baked/env_cubemap_16.vtex (305838 bytes)
 02:23:39   engine/RenderSystem Decompressed 7 texture mips in 0.14 ms (3543.3mb/s)
 02:23:39   engine/RenderSystem TEXMAN: streaming loaded gpu 1/1 mips (12x16 / 12x16) of maps/editor/_bakeresourcecache/toolscene_default_baked/env_light_probe_volume_16.vtex (9216 bytes)
 02:23:41   engine/RenderSystem  [3] CSwapChainVulkan::SwapBuffers(): the main thread is more than 3 frames ahead which means no swap queue images are available.  Waiting for outstanding frames...
 02:23:42   engine/InputBindSystem  [4] * Rehandling active codes
 02:23:42   engine/RenderSystem  [1] CSwapChainVulkan::SwapBuffers(): the main thread is more than 3 frames ahead which means no swap queue images are available.  Waiting for outstanding frames...

Logs after closing the anim graph

  02:23:57   engine/InputBindSystem  [5] * Rehandling active codes
 02:23:58   engine/RenderSystem CSwapChainVulkan::SwapBuffers(): the main thread is more than 3 frames ahead which means no swap queue images are available.  Waiting for outstanding frames...
 02:23:59   engine/InputBindSystem  [2] * Rehandling active codes
 02:23:59   engine/RenderSystem Removing texture from streamable list (materials/editor/env_sky_tga_8342e814.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (materials/editor/env_sky_tga_8342e814.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (materials/models/solids/black_vmat_g_troughness_6fb51546.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (materials/models/solids/black_color_tga_772d73e6.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (materials/models/solids/black_color_tga_772d73e6.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (materials/models/editor/sun_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (materials/editor/env_cubemap_model_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (materials/editor/env_cubemap_model_vmat_g_tcolor_a0ce44b8.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (models/editor/spawnpoint_vmat_g_tnormal_3f3ccc55.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from streamable list (models/editor/spawnpoint_color_png_ef2698c2.generated.vtex)
 02:23:59   engine/RenderSystem Removing texture from pending streamable list (models/editor/spawnpoint_color_png_ef2698c2.generated.vtex)
 02:23:59   engine/RenderSystem TEXMAN: Deleting 19 textures
 02:23:59   engine/RenderSystem TEXMAN: Deleting 2 textures
 02:23:59   engine/RenderSystem TEXMAN: Deleting 15 textures
 02:24:02   engine/InputBindSystem  [1] * Rehandling active codes
kira0x1 commented 8 months ago

I confirmed changing the lighting preview in the preview also changes it for the scene image

kira0x1 commented 8 months ago

seems to even happen when just a preview window is open with no other tool windows open. image

samzanemesis commented 7 months ago

should be good, maybe