BLUI Open Source HTML5/JS/CSS HUD/UI

[QUOTE=OceanCom;272473]
Hi,

Is it possible to send from the engine to the javascript code on the webpage?

I need to implement some get methods on the webpage which will gather information from the engine.

You can execute any kind of Javascript on the page, as for composing the string to pass into the execution, that’s something you’d have to do.
However, I will write that up for an improvement! I might be able to get to writing that in the upcoming week.

I filed this enhancement: https://github.com//BLUI/issues/24

Thanks! That would be really helpful :slight_smile:

Wanted to drop by and say congratulations to the Unreal Grant :slight_smile: Well deserved and hope it allows you more time to work on it!

[QUOTE=KRushin;273568]
Wanted to drop by and say congratulations to the Unreal Grant :slight_smile: Well deserved and hope it allows you more time to work on it!

I just woke up to this, and it’s the best news! Thanks to everyone who helped support BLUI. You guys are the reason I was able to keep going.
This will not only help with BLUI, but some upcoming projects as well!

Power to the UE community!

  • Shea

I had to pass on my congratulations. Well done , you truly deserve it.

[QUOTE=paulv2k4;274031]
I had to pass on my congratulations. Well done , you truly deserve it.

Thank you!
I’ll be getting to new features very soon

[QUOTE=OceanCom;272473]
Hi,

Is it possible to send from the engine to the javascript code on the webpage?

I need to implement some get methods on the webpage which will gather information from the engine.

Update on this, it’s in progress!

results in:

55357bef42e5606856b67bed.png

Getting pretty bad performance hits as well on a 4790k and GTX 970. The website http://www.paperjs.org renders fine on Chromium, but the .exe process in UE4 uses one of my cores 100%, and that seems to be where the bottleneck is. Other websites showing off JS canvas things (like Phaser - Examples - Demoscene - Atari Intro) also hit the CPU limit very fast. You’ve set windowless rendering on, but did not touch the framerate setting. Therefore, the framerate of CEF is set to 30FPS. Increasing it does not help at all. I’ve set the framerate to 2FPS, and at each frame of a webpage, the game stutters. This means that the rendering is very, very slow and blocks unreal engine until rendering is done. Windowless rendering does not support GPU acceleration. Turning this off however doesn’t help with the stutter and framerate issues either, though.

I just commented out



parentUI->TextureUpdate(buffer);


And while the process still eats up 100%, there’s no framestutter (although it renders nothing, duh). There is a serious bottleneck in that function.

[QUOTE=Shammah;278568]
Getting pretty bad performance hits as well on a 4790k and GTX 970. The website http://www.paperjs.org renders fine on Chromium, but the .exe process in UE4 uses one of my cores 100%, and that seems to be where the bottleneck is. Other websites showing off JS canvas things (like Phaser) also hit the CPU limit very fast. You’ve set windowless rendering on, but did not touch the framerate setting. Therefore, the framerate of CEF is set to 30FPS. Increasing it does not help at all. I’ve set the framerate to 2FPS, and at each frame of a webpage, the game stutters. This means that the rendering is very, very slow and blocks unreal engine until rendering is done. Windowless rendering does not support GPU acceleration. Turning this off however doesn’t help with the stutter and framerate issues either, though.

I just commented out



parentUI->TextureUpdate(buffer);


And while the process still eats up 100%, there’s no framestutter (although it renders nothing, duh). There is a serious bottleneck in that function.

This is going to be looked into, thanks for the feedback. I will look into possibly running the texture render in another thread as well as looking at the texture update method

I just pinpointed the resource hog closer. It appears that the bottleneck comes from the code you blatantly copied from the VQueloUIPlugin over at https://github.com//VaQuoleUI/blob/master/Source/VaQuoleUIPlugin/Private/VaQuoleUIComponent.cpp.
I commented out the rendering part, and the framerates more than halves and the stutter is immense. The little @TODO mentions it’s not a big deal. Apparantly the copying butchers my framerate on a pretty beastly PC.



		// @TODO This is a bit heavy to keep reallocating/deallocating, but not a big deal. Maybe we can ping pong between buffers instead.
		TArray<uint32> ViewBuffer;
		ViewBuffer.Init(Width * Height);
		FMemory::Memcpy(ViewBuffer.GetData(), buffer, size);

		TextureDataPtr dataPtr = MakeShareable(new TextureData);

		dataPtr->SetRawData(Width, Height, sizeof(uint32), ViewBuffer);

		// Clean up from the per-render
		ViewBuffer.Empty();
		buffer = 0;


[QUOTE=Shammah;278601]
I just pinpointed the resource hog closer. It appears that the bottleneck comes from the code you blatantly copied from the VQueloUIPlugin over at https://github.com//VaQuoleUI/blob/master/Source/VaQuoleUIPlugin/Private/VaQuoleUIComponent.cpp.
I commented out the rendering part, and the framerates more than halves and the stutter is immense. The little @TODO mentions it’s not a big deal. Apparantly the copying butchers my framerate on a pretty beastly PC.



		// @TODO This is a bit heavy to keep reallocating/deallocating, but not a big deal. Maybe we can ping pong between buffers instead.
		TArray<uint32> ViewBuffer;
		ViewBuffer.Init(Width * Height);
		FMemory::Memcpy(ViewBuffer.GetData(), buffer, size);

		TextureDataPtr dataPtr = MakeShareable(new TextureData);

		dataPtr->SetRawData(Width, Height, sizeof(uint32), ViewBuffer);

		// Clean up from the per-render
		ViewBuffer.Empty();
		buffer = 0;


Understand that code was from VaQueloUI, which is also under the MIT license, and I have included said license here:

https://github.com//BLUI/blob/master/CREDITS.md

I am glad your looking into it and Shammah. I thought it was just me who was suffering. Maybe its a nVidia GPU only issue?

[QUOTE=paulv2k4;278619]
I am glad your looking into it and Shammah. I thought it was just me who was suffering. Maybe its a nVidia GPU only issue?

I haven’t had as many issues with my GTX 980 or my Intel Core i7 3820 @ 3.60GHz but I do want to look into efficiency

[QUOTE=;278651]
I haven’t had as many issues with my GTX 980 or my Intel Core i7 3820 @ 3.60GHz but I do want to look into efficiency

Ok. Maybe your i7 is more than powerful enough so you do not see the issue?

Anyway, here’s to hoping you can find something. :):slight_smile:

[QUOTE=paulv2k4;278667]
Ok. Maybe your i7 is more than powerful enough so you do not see the issue?

Anyway, here’s to hoping you can find something. :):slight_smile:

Actually just got a pull from Shammah that removes the allocation and deallocation each redraw, it’s up on the master branch now

The master branch just got updated with a small performance fix. I was able to remove unnecessary memcopy operations. Only one memcopy remains, from the CEF buffer to the texture itself. I’m not sure if I can remove that as well; setting the texture data pointer directly to the given CEF buffer pointer does not seem to work. It’s the only remaining bottleneck concerning texture updates. At 1920x1020, this is about 74MB per memcopy. Calling that each 30FPS is still a big strain I think.

[QUOTE=Shammah;278672]
The master branch just got updated with a small performance fix. I was able to remove unnecessary memcopy operations. Only one memcopy remains, from the CEF buffer to the texture itself. I’m not sure if I can remove that as well; setting the texture data pointer directly to the given CEF buffer pointer does not seem to work. It’s the only remaining bottleneck concerning texture updates. At 1920x1020, this is about 74MB per memcopy. Calling that each 30FPS is still a big strain I think.

I remember trying to do that (using the pointer directly to the CEF buffer) quite a while ago when things first started and discovering it didn’t work for some reason. I’m interested in figuring out that hurtle as well.

Another huge bottleneck seems to be off-screen rendering itself: chromiumembedded / cef / wiki / GeneralUsage — Bitbucket

[QUOTE]
With off-screen rendering CEF does not create a native browser window. Instead, CEF provides the host application with invalidated regions and a pixel buffer and the host application notifies CEF of mouse, keyboard and focus events. Off-screen rendering does not currently support accelerated compositing so performance may suffer as compared to a windowed browser.

Been looking into this issue for a little bit, and just committed a new rendering method that will allow more control over the painting.
https://github.com//BLUI/commit/54e7fdfbaf9f39a76ec04706105efe171b2cee10

Eventually looking to only updating regions of the texture that have been redrawn by CEF.

EDIT: This has been merged into mater, as it seems to boost performance

[QUOTE=;275814]
Update on this, it’s in progress!

results in:

55357bef42e5606856b67bed.png

Very nice! Will test it when it’s ready :slight_smile: