KOVIAHN Posted November 30, 2022 Share Posted November 30, 2022 hello. I understand that the function below creates a new Material. void CUnigineMaterialManager::Set_Object_Material_Property(Unigine::ObjectPtr object, OBJECT_MATERIAL_MASK changeMask, Unigine::Math::vec4 property, int iSurface ) { return; switch (changeMask) { case OBJECT_MATERIAL_MASK::METALNESS: object->setMaterialParameterFloat4("metalness", property, iSurface); break; case OBJECT_MATERIAL_MASK::ROUGHNESS: object->setMaterialParameterFloat4("roughness", property, iSurface); break; case OBJECT_MATERIAL_MASK::ALBEDO_COLOR: object->setMaterialParameterFloat4("albedo_color", property, iSurface); break; case OBJECT_MATERIAL_MASK::UV_TRANSFORM: object->setMaterialParameterFloat4("uv_transform", property, iSurface); break; case OBJECT_MATERIAL_MASK::MIRROR_ROTATION: object->setMaterialParameterFloat4("reflection_pivot_rotation", property, iSurface); break; case OBJECT_MATERIAL_MASK::EMMISIVECOLOR: object->setMaterialParameterFloat4("emission_color", property, iSurface); break; case OBJECT_MATERIAL_MASK::AUXILIARYCOLOR: object->setMaterialParameterFloat4("auxiliary_color", Unigine::Math::vec4(1.0f, 0.0f, 0.0f, 0.5f), iSurface); break; } } However, after creating a new Material, Assertion Fail is displayed, and then an error occurs in Unigine_x64d.dll!Engine::iterate(). --------------------------- Microsoft Visual C++ Runtime Library --------------------------- Assertion failed! Program: ...VI_Project\KOVIArchiS_x64\Execute\Unigine_x64d.dll File: D:\BA\work\304c3c27bd7fb59b\source\engine\...\Memory.cpp Line: 500 Expression: (p->used_map[g] >> i) & 1 For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts (Press Retry to debug the application - JIT must be enabled) --------------------------- 중단(A) 다시 시도(R) 무시(I) --------------------------- ntdll.dll!00007ff9a59cf632() 알 수 없음 ntdll.dll!00007ff9a59d83f2() 알 수 없음 ntdll.dll!00007ff9a59d86da() 알 수 없음 ntdll.dll!00007ff9a59de361() 알 수 없음 ntdll.dll!00007ff9a58f5bf0() 알 수 없음 ntdll.dll!00007ff9a58f47b1() 알 수 없음 ucrtbase.dll!00007ff9a382f05b() 알 수 없음 Unigine_x64d.dll!Memory::deallocate(void * ptr) 줄 679 C++ [인라인 프레임] Unigine_x64d.dll!Unigine::VectorAllocator::deallocate(char *) 줄 25 C++ [인라인 프레임] Unigine_x64d.dll!Unigine::Vector<Unigine::String,short,Unigine::VectorAllocator>::dealloc(char * ptr) 줄 1208 C++ [인라인 프레임] Unigine_x64d.dll!Unigine::Vector<Unigine::String,short,Unigine::VectorAllocator>::{dtor}() 줄 249 C++ [인라인 프레임] Unigine_x64d.dll!Unigine::HashMap<int,Material::DataPass,unsigned int>::{dtor}() 줄 69 C++ Unigine_x64d.dll!Material::~Material() 줄 727 C++ [외부 코드] Unigine_x64d.dll!Material::~Material() 줄 693 C++ [외부 코드] [인라인 프레임] Unigine_x64d.dll!Object::clearMaterialInherit(int) 줄 759 C++ Unigine_x64d.dll!Object::~Object() 줄 82 C++ [외부 코드] Unigine_x64d.dll!Unigine::UnigineBaseObject::processDeleteQueue() 줄 97 C++ Unigine_x64d.dll!Engine::swap() 줄 2911 C++ Unigine_x64d.dll!Engine::iterate() 줄 2453 C++ > KVXmoduleKitD.dll!kvx::video::CUnigineEngine::Present(kvx::video::U_RENDERING_TYPE renderType) 줄 1604 C++ KVXmoduleKitD.dll!kvx::KVXrenderDeviceGo1(kvx::IKVXDevice * pDevice, int bDonotPresent) 줄 1237 C++ OperatorD.dll!CVROperator::Render(int bPrint, CDC * pPrintDC) 줄 670 C++ OperatorD.dll!OPER_Render(void * oper, int bPrint, CDC * pPrintDC) 줄 734 C++ KoviArchiS64D.exe!CVRView::OnPaint() 줄 749 C++ The reason this is difficult to solve is that it doesn't always happen. If I comment out the above code, the problem does not occur. I'm not sure how to approach it. I am attaching the place where the error occurred, so please tell me when the error occurred. thank you Link to comment
silent Posted November 30, 2022 Share Posted November 30, 2022 KOVIAHN Have you tried to check if material parameter or even surface id are really exists in this object? Based only on this small sample code it would be hard to guess what's going on here. If you can replicate this issue on a very simplified test project with only part of your content (or even synthetic cubes) - it would be great. That will allow us to find the root cause of this issue much faster. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
KOVIAHN Posted December 1, 2022 Author Share Posted December 1, 2022 Dear silent I am analyzing the cause of the termination by referring to the unallocated object (an object that has actually been created but has never been rendered). I hope this can be fixed, but I'll try to get back to you if the problem reoccurs. Thank you very much! 1 Link to comment
silent Posted December 1, 2022 Share Posted December 1, 2022 Great, thanks :) How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts