Jump to content

Search the Community

Showing results for tags 'C++'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Launching the game via IDE

    When I launch the game through the IDE, I only see a black screen instead of the game, but I can open the console. However, if I launch the game normally (not through the IDE), everything works fine. What steps should I take to resolve this issue?
  2. Hello there, I have recently started working on a project using the UNIGINE engine; and I am aiming to develop a large scale; open world environment. My main focus is on optimizing scene management to ensure smooth performance across various hardware configurations. I have a few specific questions and would greatly appreciate any advice or best practices you can share; especially from those with experience in similar projects. What are the most effective methods for implementing spatial partitioning in UNIGINE? I understand that Octrees and Quadtrees are common approaches; but are there any specific considerations or optimizations unique to UNIGINE that I should be aware of? How does UNIGINE handle LOD for large environments; and what are the best practices for managing LOD transitions to minimize performance overhead and visual popping? With a large number of assets and textures; efficient memory management becomes crucial. Are there any recommended strategies for asset streaming or dynamic loading/unloading in UNIGINE to keep memory usage in check? In an open world scenario; physics calculations can be quite intensive. What techniques do you recommend for optimizing physics in UNIGINE; particularly for objects that are far from the player or outside the current view frustum? Also, I have gone through this post; https://developer.unigine.com/forum/topic/6449-best-way-to-run-ccsp-custom-async-tasks/ which definitely helped me out a lot. I am also using a mix of UNIGINE script and C++ for various parts of the project. Are there any tips for efficiently managing the interaction between UNIGINE script and C++ code; particularly to avoid performance bottlenecks? Thank you in advance for your assistance and help.
  3. Добрый день! Почему-то не получается сблендить анимацию. Очень долго пытался разобраться в чем дело, так и не обнаружил проблемы. Вроде все по гайдам делал, но все равно анимации не смешиваются: всегда воспроизводится только одна. Подскажите, что не так делаю? Вот мой код: #include "AnimationState.h" REGISTER_COMPONENT(AnimationState); void AnimationState::Init() { const char *Idle = Unigine::FileSystem::getGUID(IdleAnim.getRaw()).getFileSystemString(); const char *Walk = Unigine::FileSystem::getGUID(WalkAnim.getRaw()).getFileSystemString(); // const char *RWalk = Unigine::FileSystem::getGUID(R_WalkAnim.getRaw()).getFileSystemString(); // const char* Run = Unigine::FileSystem::getGUID(RunAnim.getRaw()).getFileSystemString(); MainCharacter = Unigine::checked_ptr_cast<Unigine::ObjectMeshSkinned>(node); MainCharacter->setNumLayers(2); int IdleNum = MainCharacter->addAnimation(Idle); int WalkNum = MainCharacter->addAnimation(Walk); // int R_WalkNum = MainCharacter->addAnimation(RWalk); // int RunNum = MainCharacter->addAnimation(Run); MainCharacter->setAnimation(0, IdleNum); MainCharacter->setAnimation(1, WalkNum); // MainCharacter->setAnimation(2, WalkNum); // MainCharacter->setAnimation(3, R_WalkNum); // MainCharacter->setAnimation(4, RunNum); } void AnimationState::Update() { MainCharacter->setFrame(0, Unigine::Game::getTime() * 25.0f); MainCharacter->setFrame(1, Unigine::Game::getTime() * 25.0f); // MainCharacter->setFrame(2, Unigine::Game::getTime() * 30); // MainCharacter->setFrame(3, Unigine::Game::getTime() * 30); // MainCharacter->setFrame(4, Unigine::Game::getTime() * 30); if (Unigine::Input::isKeyPressed(Unigine::Input::KEY_V)) { Weight = Unigine::Math::clamp(Weight + Unigine::Game::getIFps(), 0.0f, 1.0f); } if (Unigine::Input::isKeyPressed(Unigine::Input::KEY_C)) { Weight = Unigine::Math::clamp(Weight - Unigine::Game::getIFps(), 0.0f, 1.0f); } MainCharacter->lerpLayer(0,0,1,Weight); Unigine::Console::message("Weight is: %f \n", Weight); }
  4. I want to implement two windows so that only UI is displayed on one side of the main window and the other side. However, the AppWall plug-in allows one camera to output to two monitors. I want to know how to use AppWall to output UI-only windows and main screens. The version is using version 2.4.1
  5. Работаю над собственным рендерингом UI. У меня есть вектор структур, которые содержат вершины, индексы и TexturePtr. И рендерю я всё это, как в примере ImGui (как в ImGuiImpl::draw_callback) - та же идея задавать RenderState, залить всё в меш, затем внутри render_target->enable/disable в цикле задавать текстуру для материала и рендерить меш с оффсетом по вершинам и индексам, а затем идёт точно такой же код, как и в примере, ни капельки не изменнёный. Я понимаю, что этого может быть мало, поэтому если надо, могу подробнее показать. У меня после одного такого прохода функции перестают работать текстуры. Поэтому я снарядился дебаггером и выяснил, что с умным указателем всё в порядке - рефкаунт в порядке, с указателем внутри тоже действий не было, под ним осталась Texture/APIInterface. А вот с объектом внутри APIInterface, в моём случае, с D3D11Texture произошло нехорошее - оно удалилось и стало NULL. Дальше дебаггером я выяснил, что при вызове Engine::swap(), данная текстура/данный объект очищается и вызывается деструктор. Когда я начал отслеживать текстуру внутри ImGui, то там такой подставы не произошло. В чём причина и как это пофиксить?
  6. Hello First of all, thank you for providing such a great sample. //Importing Models Directly to Memory https://developer.unigine.com/en/docs/2.13/code/usage/custom_import_processor/index?rlang=cpp I have a question. Through the Importing Models Directly to Memory method, an accurate mesh shape could be imported. But the part about animation import is not at all I didn't know... Is there no separate guide document?? I am attaching a simple sample project that I am currently testing. FBXAnimation.zip
  7. Hello Unigine :) I’m trying to use Leap Motion in Unigine 2.11.0 but I have a rotate problem when I catch object, it rotate suddenly I want to get rid of sudden rotation and make it natural I tried to use offset but it rotate weird Video 로테이션 문제.mp4 Code update() { if(grip = True) { objectRotation->setRotation(handRotation); // I tried this one, but it rotate weird // offset = objectRotation - handRotation; // objectRotation->setRotation(handRotation + offset).normarlize()); } } in my environment I’m using: Varjo VR-2 (use more) & VR-3 Unigine 2.11.0 Leap motion 4.1.0 (I can’t change my environment) Any help would be appreciated Thank you :D
  8. Добрый день. Из документации понял, что для записи сгенерированных данных в картинку карты высот в классе Image есть методы: set2D () и перегруженный setPixels (). С первым, благодаря примеру, всё более менее понятно. Со вторым возникли трудности. Создаю файл: image->create2D(lmapTileResolutionX, lmapTileResolutionY, Image::FORMAT_RGBA8); Генерирую и заполняю массив чаров: heightSourceArray = new unsigned char [lmapTileResolutionX * lmapTileResolutionY]; heightSourceArray i = (rand())%255; Вызываю метод image->setPixels(heightSourceArray); В режиме дебага вылетает с необработанным исключением 0x00007FFCDCB3DB9E (ucrtbase.dll) . Так как других ошибок дебагер не выдаёт, идеи куда смотреть закончились. С Уважением, Константин.
  9. Thoughts on Testing

    Hello Folks, I would be interested in experiences with testing and Unigine, especially for larger projects. What kind of toolchain do you use for continuous integration and how do you unit test? Interacting with the Unigine API often needs Unigine to be initialized which makes tests tedious. Do you use some kind of mocking? Do you test your rendered output? How do you compare test results and expected outputs? I would guess pixelwise comparison can be achieved seldomly. I'm new to both testing in C++ and Unigine and would appreciate any input on this topic. Kind regards
  10. Добрый день. Не могли бы вы уточнить, что передаётся параметрами (creator, images, x, y) в функцию, особенно интересуют последние инты. И насколько понимаю, в примере опечатка и должен передаваться указатель LandscapeImagesPtr на картинку. // callback function implementing certain actions to be performed on creating a landscape layer map file void CreateFile(LandscapeMapFileCreatorPtr creator, LandscapeImages images, int x, int, y) Зы: Плюсы учу параллельно с движком, поэтому вопросы могут быть совсем дилетантскими, с моей колокольни это пока не видно. С Уважением Константин.
  11. Добрый день. Не могу найти в коде вызов системного меню по клавише Esc., чтобы выпилить из проекта или модифицировать под свои нужды.
  12. In my game I need something that moves through the world and can collide with static surfaces but does not simulate physics and is move manually through code. other game engines refer to this as a kinematic collider. This is normally done to create player controllers which need to have their physics implemented manually. C++ examples would be much appreciated.
  13. diffrence between C# and C++ on programming ?

    hey everybody , i`m an indie game developer and i been working with unity engine and c# for about 4 years. and i have good understanding of c# and it`s related API. but when i`m migrated to Unigine i find out that it`s support both C# and C++ and apart from they`re differences on syntax or structure or memory and thread management is there any differences on using each one on Unigine? i mean differences on performances does using C++ on unigine makes our game better and faster ? or something else ? any quote will be so appreciated .... thanks
  14. Hi Unigine Team, First : I must to say you , Thank you so much for public release unigine game engine , I used a bit unigine , this engine is amazing & awesome... Second : Big game dev team or small game dev team can make open world game or Big game with C# or C++ in unigine? Which Language With API Complete in Unigine? C# or C++? Three : Is it possible tell me, which games or simulate projects made with unigne website address? Sincerely Ahmad Karami A Teacher/Book author/Test engineer/Solo GameDev
  15. I want to move an object to fill the screen. Similar to Move to camera in the editor. How should I implement it? Please help me
  16. tracker api calls

    Hi are there functions to load and control track files from the c++ side (can't find anything in the docs)? Best
  17. [SOLVED] Load RAW DXT1 texture

    Hello, I try to load a RAW texture that I have in DTX1 format. I don't found a way to load a RAW texture. I try to load as image but log an error loading int format = ::Unigine::Image::FORMAT_DXT1; ::Unigine::ImagePtr image = ::Unigine::Image::create(); image->create2D(textureSize, textureSize, format); const ::Unigine::Ptr<::Unigine::Blob> stream = ::Unigine::Blob::create(); stream->write(textureData, textureLen); // textureData=RAW DTX1 Buffer, textureLen=size image->load(stream->getStream()); /roberto
  18. About a SSLSocket pluging

    Hello Unigine ... I have 3 problems using SSLSocket Using Unigine script creating a client it don't pass the Handshake with a RSS Feed server The plugin sample ssl_socket_01.cpp, is using tls 1.0 or 1.1 that are deprecable, I try to load my own private key and don't load. How I can use this plugin from C++ if I don't found the interface?. Expanding the questions.... Problem 1 I trying to create a single client and down some RSS feed sample. This client connect but fail on the handshacke. int init() { #ifdef HAS_SSL_SOCKET log.message("ssl socket\n"); socket = new SSLSocket(); // https://www.feedforall.com/sample.xml socket.open("www.feedforall.com", 443); if (socket.connect()) { log.message("Is Connected\n"); if(socket.getHandshake()) { log.message("Handshake OK\n"); stream = socket.getStream(); if (stream!=NULL) { log.message("Stream is OK\n"); // socket.block(); stream.printf("GET /sample.xml HTTP/1.1\r\nHost: www.feedforall.com\r\nUser-Agent: Unigine\r\n\r\n"); if (stream.isAvailable()) { log.message("isAvailable OK\n"); } else { log.message("isAvailable not data\n"); } log.message(stream.gets()); } else { log.message("Stream is NULL"); } } else { log.message("Handshake FALSE\n"); } } else { log.message("Not is Is Connected\n"); } #else log.message("SSLSocket plugin is not loaded"); #endif return 1; } Problem 2 For Other place I test your server application and this work. But I used your Private key and certificate. The browser says that is using TLS 1.0 or TLS 1.1 that are deprecable. Then I try to use my own web site private key and certificate. This load the certificate correctly but the Private key fail loading that. void create() { socket = new SSLSocket(); socket.open(4433); socket.bind(); socket.listen(10); socket.nonblock(); socket.load(SSL_SOCKET_RSA_KEY,fullPath("ssl/lynza/private_key.pem")); // Fail load this, this load fine with OpenSSL socket.load(SSL_SOCKET_X509_CERT,fullPath("ssl/lynza/certificate.pem")); // certificate load fine. //socket.load(SSL_SOCKET_RSA_KEY,fullPath("ssl/private_key.pem")); //socket.load(SSL_SOCKET_X509_CERT,fullPath("ssl/certificate.pem")); } Unigine~# config_readonly 1 && world_load "SSLServerTest" Script loading "core/unigine.usc" 9ms Loading "core/locale/unigine.locale" dictionary 1ms Script loading "SSLServerTest.cpp" 9ms World loading "SSLServerTest.world" 102ms SSLSocket::load(): can't load certificate from "ssl/lynza/private_key.pem" file -269 ----Load cache textures---- Cache textures loaded 94 (62ms) Problem 3 /Roberto
  19. I try to recreate a shader like the sample on https://learnopengl.com/Advanced-OpenGL/Geometry-Shader on the sample is use a vertex point as geometry in. Using UUSL the GEOM_TYPE_IN. How I can put a POINT or a Vertex?, for now my two valid options are GEOM_TYPE_IN(LINE_IN) or GEOM_TYPE_IN(TRIANGLE_IN) I try parameters like VERTEX_IN, POINT_IN etc but all of then give me "error X3000: unrecognized identifier" VERTEX_IN or POINT_IN In fact if you do a search on all your documentation for GEOM_TYPE_IN shader definition don't appear nothing. The only reference to the LINI_IN or TRIANGLE_IN appear on the https://developer.unigine.com/en/docs/2.9/code/uusl/semantics?rlang=cpp under the "Geometry Shader Semantics#" section. This is the shader sample from the web site, were for each vertex IN emit 5 vertex OUT as triangle strip #version 330 core layout (points) in; layout (triangle_strip, max_vertices = 5) out; void build_house(vec4 position) { gl_Position = position + vec4(-0.2, -0.2, 0.0, 0.0); // 1:bottom-left EmitVertex(); gl_Position = position + vec4( 0.2, -0.2, 0.0, 0.0); // 2:bottom-right EmitVertex(); gl_Position = position + vec4(-0.2, 0.2, 0.0, 0.0); // 3:top-left EmitVertex(); gl_Position = position + vec4( 0.2, 0.2, 0.0, 0.0); // 4:top-right EmitVertex(); gl_Position = position + vec4( 0.0, 0.4, 0.0, 0.0); // 5:top EmitVertex(); EndPrimitive(); } void main() { build_house(gl_in[0].gl_Position); } /roberto
  20. I try to do some shaders but I don't found includes or shaders using on the engine. for sample if you open "evaluation_sim_windows_2.9.0.2\data\core\materials\default\mesh\mesh_base.basemat" this include many shaders as.. vertex="core/shaders/mesh/transparent/ambient.shader" fragment="core/shaders/mesh/transparent/ambient.shader" vertex="core/shaders/mesh/transparent/lights.shader" fragment="core/shaders/mesh/transparent/lights.shader"/> vertex="core/shaders/mesh/opacity/deferred.shader" fragment="core/shaders/mesh/opacity/deferred.shader"/> .... But this don't appear on all the SDK, include in the generate project, the folder "core/shaders" don't appear too. Now if you do a search for *.shader you can found some samples, but they have a include that I don't found too. #include <core/shaders/mesh/common/common.h> #ifdef VERTEX #include <core/shaders/mesh/common/vertex.h> #elif FRAGMENT #include <core/shaders/mesh/common/fragment.h> #endif This are into the "core/shader/" folder too /roberto
  21. I create a plugin where I want to include a new 3d object. For my 3dObject I inherited from ObjectExternBase class My3dObject: public Unigine::ObjectExternBase { public: template <class> friend class Unigine::Ptr; static void release_ptr(My3dObject *p); { delete p; } static Unigine::Ptr<My3dObject> create(); { Unigine::Ptr<My3dObject> ptr = Unigine::Ptr<My3dObject>(new My3dObject()); return ptr; } virtual int getClassID() override; virtual int getNumSurfaces() override; virtual const char *getSurfaceName(int surface) override; virtual const ::Unigine::BoundBox &getBoundBox(int surface) override; virtual const ::Unigine::BoundSphere &getBoundSphere(int surface) override; virtual const ::Unigine::BoundBox& getBoundBox() override; virtual const ::Unigine::BoundSphere& getBoundSphere() override; ... int MyPlugin::init() { int id = Unigine::Interpreter::addGroup("MyGroup"); Unigine::ExternClass<My3dObject> *My3dObj = Unigine::MakeExternClass<My3dObject>(); Unigine::Interpreter::addExternClass("My3dObject", My3dObj, id); this->my3dObj = My3dObject::create(); this->my3dObj.get()->release(); Unigine::Editor::get()->addNode(this->my3dObj.get()->getNode(), true); ... After load the plugin in the "word tree" appear the node "ObjectExtern", but if I select this raise an exception Unhandled exception at 0x00007FF88046E91E (ucrtbase.dll) in Editor_x64d.exe: Fatal program exit requested. Exist some sample that show how I can add My3dObject to the editor from a plugin. /Roberto
  22. [SOLVED] The Socket is blocking

    Hi I play with Socket class and I been tried several scenarios. The class blocks even in unblocking mode. For sample: 1-The function Socket->gets() is blocking, return only when the remote server close the connection returned all receive as string. Include if you put it as nonblock() the socket. 2-If you use the function Socket->read(...) if the buffer is bigger that the receive Data it's pass right return the the data, but if buffer pass in Socket->read is smaller that the data receive then the second time that you try to read the rest of the data, this will blocking the thread too. Some of this scenarios I expose in the UnitTest attached Some snippet of the attach are here ----------------------------------------------------------------------------------------------------------------- TEST_METHOD(SocketClientTrial) { Ptr<Socket> socket = Socket::create(Socket::SOCKET_STREAM); if (socket->open("localhost", Port)) { if (socket->connect()) { // Pass Ok /* char tmp[100]; int len = socket->read(tmp, 49 - 34); // <== Ok, tmp[len] = 0; Assert::AreEqual(tmp, "I am the server"); */ // NO PASS, IS BLOKING /* char tmp[100]; int len = socket->read(tmp, 5); // <= OK len = socket->read(&tmp[5], 100-5); // <= BLOKING HERE, THE SECOND TIME tmp[len+5] = 0; Assert::AreEqual(tmp, "I am the server"); */ String res = socket->gets(); // <= BLOKING HERE TOO Assert::AreEqual(res, "I am the server"); .... socket->listen(10); // Server socket->nonblock(); <-- using noblock parameter Ptr<Socket> asock = Socket::create(Socket::SOCKET_STREAM); while (1) { if (socket->accept(asock)) { asock->puts("I am the server"); String res = asock->gets(); // <= BLOKING HERE .... ----------------------------------------------------------------------------------------------------------------------------------------------- /Roberto Socket01Trial.cpp
  23. About Web Request

    Hi I have not found any class that allows me to do a WebRequest. There is some way or is planning to create some class allow make Web Request. Thank you...
  24. Hi, I am using Unigine::Image to load tga files with rgb and rgba channels. The getFormat() does always return rgba8. How do I determine the correct number/format of color channels? Regards Sebastian
  25. Qt DirectX and Unigine

    Hi, we are using opengl at the moment for our project with a QOpenGLWidget which is working fine with the Qt composition of QWidget layers, which have transparency, on each other. We want to use directx because of some shader bugs ,which are not solved in opengl yet, and performance improvement. I also managed to get unigine working with directx but I can not overlay the used QWidget with any other QWidget based elements which have transparency. There is no blending in this case and the Unigine scene will not be visible. Do you already have a solution which works with the way Qt composites its UI elements and DirectX or is anything like that planned in the near future? Regards, Sebastian
×
×
  • Create New...