Jump to content

Coherent UI plugin (HTML5 renderer)


photo

Recommended Posts

Hi Manuel,

 

Ok, it works, my fault.
No need of libdbus.so.0, I forgot to put the "Linux" folder near the CoherentUiSample binary when I'm running the example ..
 
Just one more thing, events are not working .. is it normal ? Do you have an updated version ?
 
And even if everybody is not interested in a mobile version, we are  ;)
 
Thanks,
Christophe
Link to comment
  • 2 weeks later...

You must use it like:

    <script type="text/javascript">
        function HelloWorld()
        {
                $("body").append("text");
        }
        engine.on("HelloWorld", HelloWorld);
    </script>

After that the event is triggered. :)

Link to comment

In update statement for mouse (0,0 is the offset):

            if(view != NULL)
            {
                view.InjectMouse(0,0);
            }
            else
            {
                view = createCoherentUIViewIfNull(view, 1, "coui://html/loading.html", engine.app.getWidth(), engine.app.getHeight(), 1);
            }

Keyboard:

 

Init

// Forward input
        engine.gui.setKeyPressCallback("ROAClient::setKeyPress");
        engine.controls.setKeyReleaseCallback("ROAClient::setKeyRelease");

 

Somewhere else


    int setKeyPress(int _key)
    {
        view.InjectKeyPress(_key);
        return 0;
    }

    int setKeyRelease(int _key)
    {
        view.InjectKeyRelease(_key);
        return 0;
    }
Link to comment
  • 5 months later...
  • 4 months later...

In case anyone has been waiting, it looks like the original post has been edited to include the latest Coherent UI 2.x plugin that works with the latest Beta SDK:


 


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.

Link to comment
  • 2 months later...

Hey guys,

 

We've recently released our new product, Coherent GT, designed for high-perf HTML UI.

 

I added the "CoherentGT_Alpha1.zip" which is the initial version of the plugin, compatible with Unigine 2.x. If you want to try it out, you can request a trial from this link for the Coherent GT SDK.

 

The major difference between Coherent UI and Coherent GT is that we've decided to split the previous product since it was increasingly difficult to support both in-game browser and high-performance UI features in the same package. Coherent UI will be aimed mostly towards creating an in-game browser, supporting the latest web standards and features such as WebRTC, WebGL, plugin support, video playback (e.g. YouTube) and such. GT, on the other hand is a completely in-process, lightweight HTML renderer, with synchronous JavaScript that provides more straightforward communication between the app and UI and tackles the issues of the multiprocess architecture of Coherent UI, when you need to create complex and demanding user interfaces that require immediate updates.

 

The API is very much alike in both UI and GT so if you have used Coherent UI, you'll be familiar with the GT API as well.

 

The current Alpha1 version of the plugin is tested only on Windows and supports the D3D11 and OpenGL renderers. The plugin code requires a C++11 compiler (or at least one with std::function/std::bind) and is adapted for the Coherent GT 1.0.2 SDK.

 

As always, if you have any feedback please share it.  :)

Link to comment
  • 3 weeks later...

We are having some trouble with the CoherentUIView Resize function. We are getting resize events properly and the function is running with lots of resource loading and unloading but the page does not resize to match the coordinates given. 

 

Is it possible that a new view is being drawn underneath the first one? Or is there something else going on here?

Link to comment

Hey Taylor,

 

I just tested a simple resize upon keypress and it worked fine. The only exception I found was when using D3D11 with shared textures where the resize was OK, but the texture wasn't stretched properly on the target object/WidgetSprite. I'll take a look at that later.

 

Is this what you're seeing or you're talking about something different?

Link to comment

We are using the Resize function under CoherentUIView, exposed like this: couiView->addFunction( "Resize", &CoherentUIView::Resize );

 

And then to get the resize event, we do 

if ( engine.app.getHeight() != viewHeight || engine.app.getWidth() != viewWidth ) {
log.message( "RESIZED\n" );
viewWidth = engine.app.getWidth();
viewHeight = engine.app.getHeight();
view.Resize( viewWidth, viewHeight );
}

 

Which does stretch the texture slightly when you're sizing down, but not up. It seems we're missing a step, any ideas?

Link to comment

What OS and renderer are you using?

 

I fixed the bug in the D3D11 implementation when using shared textures (the default option) that I saw.

 

If you're having the problem with D3D11, please use the attached file and see if that fixes your issue.

 

I've also added updated versions for both UI and GT in the first post with some resizing code in the sample.

D3D11SurfaceHelper.cpp

Link to comment

We have it working now! Just needed to set the width and the height of the WidgetSprite that the view was on.

 

So everything looks good, but now we are getting a lot of crashes! Both on manual resizing (dragging from the bottom right corner) and from maximizing the window (double clicking on the title bar or clicking on the maximize button in the top right). I can't seem to get a reliable reproduction but a manual resize has around a 30% chance of crashing while maximizing has a 90% chance of crash.

 

Not sure if it's related, but we are seeing two CreateSurface view-listener events and two DestroySurface view-listener events when we do successfully resize.

Link to comment

Can you please open a ticket in our support system so we can track that - just email support@coherent-labs.com . You can add the relevant call stack and repro details (in a small sample app if possible).

 

Generally if you're resizing and resetting the graphics device (like the default implementation in the stock menu that you bring up with `Esc`) you need to tear down all the views since the rendering cannot be simply detached. You can also take a look at the sample, I added some code for resetting materials and WidgetSprites when the gfx device is recreated.

 

As for the Create/Destroy surface calls - it's correct to have 2 of each, since we're using double-buffering and you need to create 2 surfaces.

Link to comment
×
×
  • Create New...