Search the Community
Showing results for tags 'Gui'.
-
Is it possible to use materials or particle effects or something like that on gui elements? For example, apply a material when an event occurs.
-
Hi everyone, I started make video tutorials for Unigine 2.11.0.1 , You can see & use , This is my playlist about unigine, and I hope useful for you. Get started with 8 hours of free video tutorials full of tips you want. Playlist 1 Playlist 2 With respect Ahmad Karami a computer teacher/ author book / test engineer / solo game developer
- 8 replies
-
- 1
-
- ahmad karami
- unigine
-
(and 94 more)
Tagged with:
- ahmad karami
- unigine
- unigine2
- unigine editor 2
- tutorials
- video
- material
- objects
- terrain
- time
- lighting
- scripting
- advanced tutorial
- full tutorial
- download unigine
- install unigine
- setup unigine
- c sharp
- showcase
- demo
- help
- decal
- water
- sea
- ocean
- import
- hackathon
- build project
- particle
- particle system
- all settings
- collision
- physics
- physic
- physics ocean
- fog
- flower
- grass
- time of day
- day
- night
- wind
- field spacers
- fieldshoreline
- field shore line
- trigger
- destructible mesh
- code
- distance two object
- animation
- animation loop
- cloudlayer
- cloud
- clouds
- time lapse
- vr
- panorama
- render settings
- dof
- ray tracing
- global illumination
- cpp
- c-sharp
- examples
- text
- 3d text
- show
- hide
- message
- light
- point light
- spot light
- area light
- cloth
- clutter
- clothbody
- cloth body
- ripple effect
- gui
- ui
- sound
- soundsource
- sound sources
- audio
- sky
- field
- volume
- volumebox
- materials
- node
- water mesh
- water_base
- water pool
- احمد کرمی
- احمد کرمی بوکانی
- پدر علم بازی سازی
-
I'm attempting to simulate an AR monocle, in a VR environment. I understand that GUI cannot be rendered in VR normally, so I am using a world space ObjectGUI. The problem I am having is this: I can't seem to be able to get the ObjectGUI to stick to the user's field of view. I also need to render the GUI to only one eye, but I haven't looked into that yet. I've tried: • Setting the ObjectGUI as a child of the camera. • Moving the ObjectGUI to camera position on update, using a C# script: ui.WorldPosition = cam.WorldPosition + offset; • Moving the ObjectGUI to camera position, alternative method: camera.GetDirectionFromScreen(out var p0, out var p1, 0.5f, 0.5f, 16f / 9); var dir = (p1 - p0).Normalized; ui.WorldPosition = p0 + dir * distance; • There is mention of an "Attach to HMD" property, here: https://developer.unigine.com/en/docs/2.13/start/vr/?rlang=cpp&words=hmd#attach_to_hmd However, there is no such file in my project, and I couldn't find a way to get it. All my attempts ended up moving the ObjectGUI in front of the camera object before accounting for the HMD position (at the player's feet). I've read in the documentation that "camera is not a node". Does this mean I can't get the VR camera's transform information? Surely there must be a way. Any help would be appreciated.
-
Hi, Using V2.12.0.2 C# Components i am not able to get the same results from GuiObject as from adding object to Gui.Get() What am i doing wrong? Clean test project is attached. PS: What where the 2 folders you needed to debug project? unigine_UI_Test_Project.zip
-
Hi, when multiple ObjectGui Objects are visible in my viewport the click event will not be executed anymore or very sporadic when I click on a widget which has a callback function. When only one ObjectGui is visible it works fine. Is this a bug or did I miss something. Thank you for your help. Sebastian
-
Hi, I would like to be able to set a node (and its childern ) visible/hide it with a click of a gui button (VR Tempalte, GuiSample). I have two buttons; one for hiding/one for setting it visible again: void GuiSample::icon_furniture_hide() { NodePtr node = Editor::get()->getNodeByName("furniture"); } void GuiSample::icon_furniture_show() { NodePtr node = Editor::get()->getNodeByName("furniture"); } Can I use the getNodeByName method here? Colud you please help me on finishing these methods? Thanks!
- 13 replies
-
- nodes
- setvisible
-
(and 4 more)
Tagged with:
-
Hi, I'm trying to create two-windowed application by using AppWall Plugin in c++ side. Both windows contain only GUI elements (i implement my methods in System logic). 1 - I get GuiPtr for each monitor. Interpreter *interpreter = (Interpreter*)Engine::get()->getSystemInterpreter(); Reflection PLUGIN_reflection(interpreter, Variable("engine.wall")); //make sure that you have AppWall loaded here Variable res = PLUGIN_reflection.callExternFunction("getGui", Variable(0), Variable(0)); gui_lecture = res.getGui(interpreter); res = PLUGIN_reflection.callExternFunction("getGui", Variable(1), Variable(0)); gui_editor = res.getGui(interpreter); 2 - I place widgets in appropriate GUI This GUI overlaps standard GUI elements, such as ESC-menu, mouse cursor, console, etc, so i can't act with it. What i'm doing wrong? Thank you.
-
Я хочу увеличить высоту кнопок WidgetButton за счет добавления отступов сверху и снизу. Наиболее подходящим методом для меня показалась установка свойств setFontVSpacing и setFontVOffset. _btn->setFontVSpacing(10); _btn->setFontVOffset(5); В целом вид кнопки меня устраивает, но вот после установки setFontVSpacing, появляются проблемы с toolTip, рамки которого немного уезжают, что показано на изображение.
-
Hi, At the last time I make a few tests about implementing Coherent GT GUI framework into Unigine (just display layer). This is just prototype, needs refactoring (especially see header file) and maybe some optimize. It's not documented anywhere, so I would like to share with it: AppWorldLogic.h: #include <RenoirBackends/dx11backend/Dx11Backend.h> #include "ResourceFileHandler.h" #include <Coherent/UIGT/UISystem.h> #include <Coherent/UIGT/View.h> #include <Coherent/UIGT/IDiskCache.h> #include <Coherent/UIGT/ResourceHandler.h> #include <Coherent/UIGT/LicenseGT.h> #include <Coherent/UIGT/UISystemListener.h> #include <Coherent/UIGT/ViewInfo.h> #include <UnigineLogic.h> #include <UnigineStreams.h> #include "UnigineEngine.h" #include "UnigineGui.h" #include "UnigineWidgets.h" #include "UnigineEditor.h" #include "UnigineTextures.h" #include "UnigineApp.h" #include "UnigineMaterials.h" #include <windows.h> #if !defined(WIN32_LEAN_AND_MEAN) #define WIN32_LEAN_AND_MEAN #endif #if !defined(NOMINMAX) #define NOMINMAX #endif #if defined(COHERENT_PLATFORM_DURANGO) #include <d3d11_x.h> #else #include <d3d11.h> #endif #include <d3d11_1.h> #include "RenoirBackends/Common/Types.h" #include "RenoirBackends/Common/ComHelpers.h" #include <cassert> #if defined(COHERENT_SUPPORT_VS2013) #ifdef COHERENT_EXPORT #define COHERENT_RENDERERBACKEND_API __declspec(dllexport) #else #define COHERENT_RENDERERBACKEND_API __declspec(dllimport) #endif #endif using namespace Unigine; class AppWorldLogic : public Unigine::WorldLogic { int createdHUD = false; Coherent::UIGT::UISystem* system; Coherent::UIGT::View* view; Coherent::UIGT::ViewRenderer* viewRenderer; Coherent::UIGT::UISystemRenderer* systemRenderer; Coherent::UIGT::NativeRenderTarget rt; FileResourceHandler fileHandler; ID3D11Device* device; renoir::Dx11Backend* backend; WidgetSpritePtr hud; Engine* engine; Editor* editor; WidgetLabelPtr widget_label; TexturePtr my_texture; TexturePtr my_texture_ds; ID3D11DepthStencilView* DSV; ID3D11RenderTargetView* TextureRTV; NodePtr cube; public: AppWorldLogic(); virtual ~AppWorldLogic(); virtual int init(); virtual int update(); virtual int render(); virtual int flush(); virtual int shutdown(); virtual int destroy(); virtual int save(const Unigine::StreamPtr &stream); virtual int restore(const Unigine::StreamPtr &stream); void createHUDWidgetSprite(); void createLabel(); void createDSTexture(); int SetWidgetSpriteTexture(Unigine::WidgetSpritePtr sprite); }; AppWorldLogic.cpp: void AppWorldLogic::createHUDWidgetSprite() { GuiPtr gui = Gui::get(); hud = WidgetSprite::create(gui); hud->setPosition(0, 0); hud->setWidth(1600); hud->setHeight(900); hud->setLayerBlendFunc(0, Gui::BLEND_ONE, Gui::BLEND_ONE_MINUS_SRC_ALPHA); gui->addChild(hud->getWidget(), Gui::ALIGN_OVERLAP); } void AppWorldLogic::createLabel() { // getting a pointer to the system GUI GuiPtr gui = Gui::get(); // creating a label widget and setting up its caption widget_label = WidgetLabel::create(gui, "Label text"); // setting a tooltip widget_label->setToolTip("This is a label"); // rearranging label size widget_label->arrange(); // setting label position widget_label->setPosition(10, 10); // adding created label widget to the system GUI gui->addChild(widget_label->getWidget(), Gui::ALIGN_OVERLAP | Gui::ALIGN_FIXED); } void AppWorldLogic::createDSTexture() { my_texture_ds = Texture::create(); const int width = int(view->GetWidth()); const int height = int(view->GetHeight()); int flags = Unigine::Texture::FILTER_LINEAR | Unigine::Texture::USAGE_RENDER; my_texture_ds->create2D(width, height, Unigine::Texture::FORMAT_RGBA8, flags); } int AppWorldLogic::SetWidgetSpriteTexture(Unigine::WidgetSpritePtr sprite) { my_texture = Texture::create(); const int width = int(view->GetWidth()); const int height = int(view->GetHeight()); int flags = Unigine::Texture::FILTER_LINEAR | Unigine::Texture::USAGE_RENDER; my_texture->create2D(width, height, Unigine::Texture::FORMAT_RGBA8, flags); sprite->setRender(my_texture); return 1; } int AppWorldLogic::init() { // Write here code to be called on world initialization: initialize resources for your world scene during the world start. /// Configure the System settings in a Coherent::UIGT::SystemSettings variable. /// Only set a debugger port for debugging purposes everything else is /// by default. //! [System] Coherent::UIGT::SystemSettings settings; settings.DebuggerPort = 19999; system = InitializeUIGTSystem(COHERENT_UI_GT_LICENSE, settings, Coherent::LoggingGT::Info); //! [System] /// Configure the View settings in a Coherent::UIGT::ViewInfo variable. /// Create the FileResourceHandler if you want to work with "coui" resources. /// Set the full path to the html document you want to load. /// Create the View using the System->CreateView. //! [View] const char* resourcePath = "coui://uiresources/minRes/MainUI.html"; Coherent::UIGT::ViewInfo info; info.Width = 1600; info.Height = 900; info.IsTransparent = true; info.ResourceHandlerInstance = &fileHandler; /// Required for resources loaded via the coui:// protocol to work view = system->CreateView(info, resourcePath); //! [View] createHUDWidgetSprite(); createLabel(); SetWidgetSpriteTexture(hud); createDSTexture(); /// Create and initialize the rendering backend for DirectX11 /// You can use your own backend if it inherits from the RendererBackend interface. ////! [Backend] device = static_cast<ID3D11Device*>(Unigine::App::get()->getD3D11Device()); backend = new renoir::Dx11Backend(device, false); backend->InitializeStaticResources(); ////! [Backend] /// Create the System Renderer using the system->CreateRenderer method and the backend. //! [SystemRenderer] systemRenderer = system->CreateRenderer(backend, backend); //! [SystemRenderer] ///// Create the View Renderer using the systemRenderer->CreateViewRenderer method and ///// the textures from the DirectX initialization. ////! [ViewRenderer] DSV = static_cast<ID3D11DepthStencilView*>(my_texture->getD3D11DepthStencilView()); TextureRTV = static_cast<ID3D11RenderTargetView*>(my_texture->getD3D11RenderTargetView()); rt.Texture = TextureRTV; rt.DepthStencilTexture = DSV; viewRenderer = systemRenderer->CreateViewRenderer(view, rt, view->GetWidth(), view->GetHeight(), 1); ////! [ViewRenderer] Materials *materials = Materials::get(); MaterialPtr m = materials->findMaterial("mesh_base"); int num = m->findTexture("albedo"); m->setTexture(num, my_texture); return 1; } // start of the main loop int AppWorldLogic::update() { // Write here code to be called before updating each render frame: specify all graphics-related functions you want to be called every frame while your application executes. ////! [Loop] ///// Advances the timers of the UI. Should be called each frame. system->Advance(); ///// Layouts the content of the page. You should call this method each frame ///// after calling Advance on the UI system unsigned frameId = view->Layout(); ///// Paints the View in the user supplied texture when using hardware ///// rendering. viewRenderer->Paint(frameId); return 1; } int AppWorldLogic::render() { // The engine calls this function before rendering each render frame: correct behavior after the state of the node has been updated. return 1; } int AppWorldLogic::flush() { // Write here code to be called before updating each physics frame: control physics in your application and put non-rendering calculations. // The engine calls flush() with the fixed rate (60 times per second by default) regardless of the FPS value. // WARNING: do not create, delete or change transformations of nodes here, because rendering is already in progress. return 1; } // end of the main loop int AppWorldLogic::shutdown() { // Write here code to be called on world shutdown: delete resources that were created during world script execution to avoid memory leaks. return 1; } int AppWorldLogic::destroy() { // Write here code to be called when the video mode is changed or the application is restarted (i.e. video_restart is called). It is used to reinitialize the graphics context. ///// The order of resource destruction is really important! ////! [Destruction] viewRenderer->Destroy(); viewRenderer = nullptr; view->Destroy(); view = nullptr; systemRenderer->Destroy(); systemRenderer = nullptr; system->Uninitialize(); system = nullptr; ////! [Destruction] return 1; } Also you will need a ResourceFileHandler.h file that come and for e.g. dx11backend project from CoherentGT (I can't share it here because of license agreement). For work it needs an object witrh "mesh_base" material at scene. Also it needs minRes files from sample delivered with CoherentGT in data folder. It will display a Coherent GUI at the screen and at object in scene.
-
Hi, At the last time I make a few tests about implementing NoesisGUI GUI framework into Unigine (just display layer and mouse movement and left button down). This is just prototype, needs refactoring (especially see header file) and maybe some optimize. It's not documented anywhere, so I would like to share with it: AppWorldLogic.h: #include <NoesisGUI.h> #include "D3D11RenderDevice.h" #include <windows.h> #define WIN32_LEAN_AND_MEAN #include <d3d11.h> #include <UnigineApp.h> #include <UnigineTextures.h> #include <UnigineGame.h> #include <UnigineMaterial.h> #include <UnigineMaterials.h> #include <UnigineLogic.h> #include "UnigineWidgets.h" #include "UnigineGui.h" #include "UnigineTextures.h" using namespace Noesis; using namespace Unigine; class AppWorldLogic : public Unigine::WorldLogic { public: Noesis::Core::Ptr<RenderDevice> device; Noesis::Core::Ptr<VGContext> context; ID3D11Device* pDevice; ID3D11DeviceContext* pContext; ID3D11RenderTargetView* pTexNoesisRTV; Noesis::IRenderer* renderer; ID3D11RenderTargetView* ppOldRtv = nullptr; ID3D11DepthStencilView* ppOldDsv = nullptr; Noesis::Core::Ptr<Noesis::IView> g_XamlView; Noesis::Core::Ptr<FrameworkElement> xaml; Unigine::TexturePtr pTexNoesisPtr; Game *game; WidgetSpritePtr hud; TexturePtr my_texture; WidgetLabelPtr widget_label; void createLabel(); void createHUDWidgetSprite(); int SetWidgetSpriteTexture(Unigine::WidgetSpritePtr sprite); bool is_click = false; AppWorldLogic(); virtual ~AppWorldLogic(); virtual int init(); virtual int update(); virtual int render(); virtual int flush(); virtual int shutdown(); virtual int destroy(); virtual int save(const Unigine::StreamPtr &stream); virtual int restore(const Unigine::StreamPtr &stream); }; AppWorldLogic.cpp: #include <NoesisGUI.h> #include "D3D11RenderDevice.h" #include "AppWorldLogic.h" #include <UnigineApp.h> #include <UnigineTextures.h> #include <UnigineGame.h> #include <UnigineMaterial.h> #include <UnigineMaterials.h> using namespace Noesis; // Error handler are invoked for fatal errors. You must never return from here void NoesisErrorHandler(const NsChar* filename, NsSize line, const NsChar* desc, NsBool fatal) { Log::message("Blad noesis %s \n", desc); } int AppWorldLogic::init() { // Write here code to be called on world initialization: initialize resources for your world scene during the world start. Noesis::GUI::Init(NoesisErrorHandler); Noesis::GUI::SetResourceProvider("."); xaml = Noesis::GUI::LoadXaml<FrameworkElement>("PasswordBox.xaml"); g_XamlView = Noesis::GUI::CreateView(xaml.GetPtr()); g_XamlView->SetSize(1600, 900); g_XamlView->SetAntialiasingMode(Noesis::Gui::AntialiasingMode_MSAA); game = Game::get(); Materials *materials = Materials::get(); MaterialPtr m = materials->findMaterial("noesis_mat"); int num = m->findTexture("albedo"); pDevice = static_cast<ID3D11Device*>(Unigine::App::get()->getD3D11Device()); pContext = nullptr; pDevice->GetImmediateContext(&pContext); // Initializes renderer. This could be done in a render thread device = *new Noesis::Render::D3D11RenderDevice(pContext); context = Noesis::GUI::CreateVGContext(device.GetPtr(), Noesis::VGOptions()); g_XamlView->GetRenderer()->Init(context.GetPtr()); renderer = g_XamlView->GetRenderer(); pTexNoesisPtr = Unigine::Texture::create(); pTexNoesisPtr->create2D(1600, 900, Unigine::Texture::FORMAT_RGBA8, Unigine::Texture::USAGE_RENDER); createHUDWidgetSprite(); createLabel(); SetWidgetSpriteTexture(hud); return 1; } void AppWorldLogic::createLabel() { GuiPtr gui = Unigine::Gui::get(); widget_label = WidgetLabel::create(gui, "Label text"); widget_label->setToolTip("This is a label"); widget_label->arrange(); widget_label->setPosition(10, 10); gui->addChild(widget_label->getWidget(), Unigine::Gui::ALIGN_OVERLAP | Unigine::Gui::ALIGN_FIXED); } int AppWorldLogic::SetWidgetSpriteTexture(Unigine::WidgetSpritePtr sprite) { my_texture = Unigine::Texture::create(); const int width = int(800); const int height = int(600); int flags = Unigine::Texture::FILTER_LINEAR | Unigine::Texture::USAGE_RENDER; my_texture->create2D(width, height, Unigine::Texture::FORMAT_RGBA8, flags); sprite->setRender(pTexNoesisPtr); return 1; } void AppWorldLogic::createHUDWidgetSprite() { GuiPtr gui = Unigine::Gui::get(); hud = WidgetSprite::create(gui); hud->setPosition(0, 0); hud->setWidth(1600); hud->setHeight(900); hud->setLayerBlendFunc(0, Unigine::Gui::BLEND_ONE, Unigine::Gui::BLEND_ONE_MINUS_SRC_ALPHA); gui->addChild(hud->getWidget(), Unigine::Gui::ALIGN_OVERLAP); } // start of the main loop int AppWorldLogic::update() { // Write here code to be called before updating each render frame: specify all graphics-related functions you want to be called every frame while your application executes. int mouseX = App::get()->getMouseX(); int mouseY = App::get()->getMouseY(); g_XamlView->MouseMove(mouseX, mouseY); if (App::get()->getMouseButtonState(App::BUTTON_LEFT)) { if (!is_click) { g_XamlView->MouseButtonDown(mouseX, mouseY, MouseButton_Left); } } ControlsPtr controls = Game::get()->getPlayer()->getControls(); return 1; } int AppWorldLogic::render() { // The engine calls this function before rendering each render frame: correct behavior after the state of the node has been updated. float ifps = game->getIFps(); if (pContext != nullptr) { ppOldRtv = nullptr; ppOldDsv = nullptr; pContext->OMGetRenderTargets(1, &ppOldRtv, &ppOldDsv); ID3D11RenderTargetView* pTexNoesisRTV = static_cast<ID3D11RenderTargetView*>(pTexNoesisPtr->getD3D11RenderTargetView()); pContext->OMSetRenderTargets(1, &pTexNoesisRTV, nullptr); // Updates view passing global time g_XamlView->Update(ifps); // Performs rendering operations. Note that the renderer associated to a view is intended // to be used in the render thread. In this simple application it is the main thread renderer = g_XamlView->GetRenderer(); // Applies changes to the render tree renderer->UpdateRenderTree(); // Renders offscreen textures. This step must be done before binding the main render target if (renderer->NeedsOffscreen()) { renderer->RenderOffscreen(); } renderer->Render(); pContext->OMSetRenderTargets(1, &ppOldRtv, ppOldDsv); } return 1; } Also you will need for e.g. D3D11RenderDevice.h and D3D11RenderDevice.cpp files that come with NoesisGUI (I can't share it here because of license agreement). For work it needs an object with "noesis_mat" material at scene. Also it needs PasswordBox.xaml file from sample delivered with NoesisGUI in data folder. It will display a Noesis GUI at the screen /xor at object in scene.
-
[NoesisGui] Integration of GuiObject-like feature
bertrand.remondin posted a topic in C++ Programming
Hi everyone, I'm having quite a problem with the integration of Noesis Gui, a UI framework. Here is how it works in a DirectX11 application (it's very similar in OpenGL): Initialize the NoesisGui object and update it each frame (no problem with that) At render time:Set the RenderTargetView Pass a draw call to the NoesisGui object The NoesisGui framework will then render on top of the RenderTargetView, which can be the backbuffer (for HUD elements) or another texture. It is especially usefull to draw UI in 3D scene (in a Unigine::ObjectGui fashion): the texture can be used as ShaderResourceView to texture a mesh. My problem is that I cannot find a correct way to pass that ShaderResourceView to Unigine in order to use it in a 3D scene. I've found this post, showing the integration of Coherent UI but what it does is copying the UI element texture twice so that it can be used as Unigine::Image2D by the engine. That seems dramatically sub-optimal to me and I was hoping I overlooked some part of the documentation that would prevent such manipulation. Is there a better way to perform what I'm trying to achieve? Thanks,- 48 replies
-
Hi all, I removed a post earlier, looking for help with GUI WidgetSpriteVideo GUIobjects, but I've since been experimenting and found it's not quite what i'm looking for. I have been following the WidgetSpriteVideo documentation page in C#, however i can't seem to wrap my head around applying shaders other than to world space objects. I've realized i need to use a screen space Gui object rather than world space. The application is to render a webcam view in over the top of Unigine(in Vr so i will need to separate the two cameras per eye for depth) and use a green screen to mask out areas of the webcam to allow the digital scene to come through( IE the user can see their hands in front of them, with Unigine in the background.) My main requirements are: 1. Bring in the video feed from the camera (in OGV format) and stream it to the GUI. 2. Use a chroma-key/shader to mask off and create transparency in the webcam feed. 3. Do this for two separate cameras and have them render to each eye individually.(or technically hide each one from their opposing eye) If anyone can point me towards the documentation to assist with this, or other references or libraries and plugins, I would be very appreciative.
-
Error loading gui resources at startup stored in .ung file
ivan.cuevas posted a topic in Bug Reports
Hi all, After moving to new Ungine 2.2, I've realized Ungine fails at initialization trying to load gui resources in a folder different from core (by specifying <item name="gui_path" type="string">my_app/gui/</item> in config file) if these resources are packed in a .ung file. I've checked the .ung file by extracting the content and verifying the files are present and without any case variation in their names (they have exactly the same name as Unigine expects). In fact if the files are not archived the engine starts as expected. -
Hi, I am trying to use a WidgetSpriteViewport, but I am finding the results to be very abnormal. WidgetSpriteViewport's camera are using main camera's Modelview and .Projection function . But I have found it's different effect that in different position and functions ,as show blow: First, put it in front of the .update() function ,the result is object is shaking .Please see the file name is First . Second ,put it in end of the .update() function ,the result is object is shaking a little bit and it seems like lost material .Please see the file name is second . As mentioned above ,the situation happened that only use mat4 to change position ,and the object speed very fast (test is 1000 Meters per second).however it is not happen at lower speed . The main camera works fine, but when I set it to the WidgetSpriteViewport, it becomes very abnormal . The camera's position and look direction is changing every update. Thanks
-
Hi, I'm trying to use WidgetSpriteVideo to display video on in-game screen models and it works pretty fine. However, I can't have the video cropped properly. As I show on my screenshot, I'd like the right part of the video not being displayed. I've made some research, found this topic and tried to do the same. Here is the code in which I try to create my WidgetSpriteVideo and attach it to my GuiObject: // gui: Gui of my ObjectGui WidgetHBox container = new WidgetHBox(gui); container.setStencil(1); WidgetSpriteVideo videoSprite = new WidgetSpriteVideo(gui, "MyVideo.ogv", 0); videoSprite.setFlags(GUI_ALIGN_OVERLAP); container.addChild(videoSprite); gui.addChild(container); What am I missing? Thanks, Alexandre.
-
Hi. We are working on Unigine 2.1.1 start version now. We are working GUI Process on only c++. (Not Use Unigine Script) Which headerfile defines WidgetSpriteVideo and WidgetSpriteNode class? please help!!!!!
- 1 reply
-
- gui
- widgetspritevidoe
-
(and 2 more)
Tagged with:
-
Hi there, I recently started playing around with Unigine and made a plugin for Coherent UI, a product by the company I work for. If you haven’t heard of it, it’s basically a high-performance HTML5-compliant renderer based on WebKit. The texture that Coherent UI gives the client can be mapped on anything (e.g. a camera or a 3D model). When mapping on a 3D object the texture has to be copied in the RAM (Unigine::Image), though, I couldn’t find a way to access the material’s texture directly (I don't have the full source). There’s also a huge slowdown caused by Unigine::Image::createMipmaps which I’ll try to avoid in a future version of the plugin. [Edit: This is no longer present in the latest version] The plugin itself is still in very early stage so there are probably a lot of parts that can be done better. At the moment JavaScript interaction and input forwarding are not yet implemented. The plugin allows scripting using Unigine Script through the CoherentUIView object. I’m attaching the plugin and sample code for anyone interested. Here’s some screenshots at the bottom (some UI made with Adobe Edge / CSS3 animation / mapping youtube on a rock). I also made this youtube video to demonstrate the animation done with Edge, it's easier to show than with a still image - http://www.youtube.com/watch?v=YSTNm0Do36E If you have any feedback I’ll be glad to hear it :) Edit (19.10.14): Updated the plugin for Coherent UI 2.x and Unigine 2014-10-06 Edit (18.03.15): Updated the plugin for Coherent UI 2.x and Unigine 2015-02-17 (Unigine 2). Many performance optimizations, especially for D3D11. 3D and HUD views now have the same performance and mipmapping is no longer an issue. The HUD is now drawn using a WidgetSprite so you can manipulate it easily. Edit (03.06.15): Added "CoherentGT_Alpha1.zip" which is the first version of the Coherent GT for Unigine 2 Edit (21.06.15): "CoherentGT_Alpha1.zip" and "Unigine_2.x_CoherentUI_2.x.zip" are now obsolete. Added updated versions with fixed resizing code and sample in "CoherentGT_Unigine2x_150620.zip" and "CoherentUI2x_Unigine2x_150620.zip", respectively. CoherentUIPluginAndSample.zip CoherentUIPluginAndSample_2.x.zip Unigine_2.x_CoherentUI_2.x.zip CoherentGT_Alpha1.zip CoherentGT_Unigine2x_150620.zip CoherentUI2x_Unigine2x_150620.zip
- 37 replies
-
- Coherent UI
- HTML5
-
(and 1 more)
Tagged with:
-
Hi all, my question is about how image scale should be defined in rich text tag. I've tried different versions of the same definition in my .ui file but it always fails as unknown image option. Here is my last code. <?xml version="1.0" encoding="utf-8"?> <ui version="1.0"> <window name="rpci_wnd" export="1" height="539"> <hbox align="expand" background="1"> <label align="expand" width="579"> <text rich="1"> <image src="gui/gui_white.png" scale=%40 color="#00ff00"/>FS4<right/>This is right aligned text</text> </label> </hbox> </window> </ui> Thanks in advance.
-
Hello, I am trying replicate some of the behavior from the gui_06 sample to attach a GuiObject to a node in the world. I have everything in my script set up exactly the same as the example script (including importing and referencing the same material library as the script), but for some reason the label isn't showing up in the main world. Object obj = our_custom_class.rootObject; ObjectGui dragHandle = add_editor(new ObjectGui(2.0f, 2.0f)); dragHandle.setWorldTransform(obj.getTransform()); dragHandle.setBillboard(1); dragHandle.setBackground(0); dragHandle.setMaterial("objects_gui", "*"); // Imported from the sample material library dragHandle.setProperty("surface_base", "*"); dragHandle.setScreenSize(96, 96); Gui gui = dragHandle.getGui(); WidgetLabel label = new WidgetLabel(gui, "Some example text"); label.setFontSize(48); gui.addChild(label); obj.addWorldChild(dragHandle); Thoughts on why my label isn't showing up? Thank you, Andrew
-
I'm curious as to what the longterm roadmap looks like for the GUI system in Unigine. With the advent of some competitors (Unity) integrating a UI editor directly into the engine, it raises questions about the feasibility of doing the something similar with Unigine. Especially since dropping support for Qt but retaining the UI file format. Is this something that's been discussed internally?
-
[SOLVED] Can I use other gui framework than unigine gui?
jinsong.li posted a topic in C++ Programming
I'm developing an application with mfc in windows. My application has its own gui. if I don't want the unigine gui to display or create, what should I do? -
The plugin sample explains pretty clearly how to add new UIs via the plugin tab in the Tools menu, but is there a way I can launch my plugin from the editor toolbar panel without modifying the source code?
-
Hi, I'm trying to use a WidgetSpriteViewport in a appWall gui unsuccessfully. If you use it at the engine.gui it works properly but in a wall gui it not appears. Recently I've modified the appWall to avoid crashes using WidgetSprites at the walls gui. The WidgetSprites works properly but the WidgetSpriteViewports don't appears. I must to do something special or WidgetSpriteViewport are not permitted in a wall guis. Thanks Jose
-
We've just finished evaluating the Coherent UI system using a Unigine plugin supplied by Coherent themselves. Unfortunately the performance of the system is sub-par. Simply loading any page (without displaying it) makes the entire renderer process erratic and if you are then using getImage() / setImageTextureImage() to display the rendered HTML on an object then the framerate of the entire simulation drops to 30 FPS with just a single rotating cube on screen. However we do really like the system, and would like to use it in future titles. What are the chances of Unigine embracing CoherentUI and creating a high-performance plugin?
-
Hi, We have an AppWall 3x1 and when we are trying to insert a WidgetSprite in each wall application crashes with the following message: engine\render\direct3d11\framework\D3D11Gui.cpp:166: Assertion: 'src >= 0 && src < NUM_BLEND_FUNC && "D3D11Gui::set_blend_func(): bad blend src function"' You can reproduce this issue creating a new project from Ungine SDK browser with the following settings: - Launchers: Console script launchers (.bat) with predefined settings Renderer: DirectX11 Monitors: Wall 2x1 - Video Output Monitor wall (AppWall plugin) CHECKED After this step in the "my_project".cpp file, you have to change the init method to this: int init() { PlayerSpectator camera = new PlayerSpectator(); camera.setPosition(Vec3(2.0f,0.0f,1.5f)); camera.setDirection(Vec3(-1.0f,0.0f,-0.5f)); engine.game.setPlayer(camera); forloop(int y = 0; engine.wall.getHeight()) { forloop(int x = 0; engine.wall.getWidth()) { Gui gui = engine.wall.getGui(x,y); WidgetSprite logo = new WidgetSprite(engine.getGui(), "unigine.png"); gui.addChild(logo,GUI_ALIGN_OVERLAP); } } return 1; } What's wrong? Thanks in advance, David García