Implementing BGFX as a driver...

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.

Re: Implementing BGFX as a driver...

Postby AReichl » Thu Oct 20, 2016 6:33 am

I have problem accessing the repository.
There is only
https://gitlab.com/JFT/Irrlicht_extended.git
but that's for Irrlicht itself.
For Irrlicht-bgfx i tried
https://gitlab.com/JFT/Irrlicht_extended.git/tree/bgfx
but with no success.
AReichl
 
Posts: 230
Joined: Wed Jul 13, 2011 2:34 pm

Re: Implementing BGFX as a driver...

Postby JFT90 » Thu Oct 20, 2016 8:25 am

To pull the bgfx branch you just do:
cpp Code: Select all
 
git clone https://gitlab.com/JFT/Irrlicht_extended.git
git checkout bgfx
 

maybe you need to use one more
cpp Code: Select all
 
git pull
 

after switching to the bgfx branch - normally its not necessary if you have a freshly cloned version.

If we use a shader inside this version of Irrlicht inside a BGFX, will it be working, or miss some details? Have you made an example to launch the BGFX portion of this modified Irrlicht?

For first tests just try to build and launch the HelloWorld-Example. I didn't adapt the makefile for it yet, so expect some linker errors. Should be easily fixed by adding -lbgfxRelease to the ldflags.
For shaders have a look at 'source/Irrlicht/bgfx_shader'. Shaderfiles for bgfx are written in shaderc - it's very similar to glsl.
By using the shaderc tool from bgfx (will be compiled with the bgfx library) you can compile your shaderc (we named them *.sc) files to a binary glsl/hlsl/metal shader header.
Also have a look here: https://bkaradzic.github.io/bgfx/tools.html

For Windows builds try the Codeblocks or VisualStudio14 Project - for Mingw you maybe need to build bgfx yourself first by running
cpp Code: Select all
make mingw-gcc-release32
inside the bgfx folder.
I will add compiled bgfxlibraries for mingw to the lib folder when I am back home later.

If you add CEGUI to the project will it be accessible by others?


CEGUI is used in a project I am working on at the moment. This project is also the reason we decided to add bgfx to irrlicht, since we wanted support for newer versions of DirectX/OpenGL and the drawcall sorting of bgfx is also quite attractive.
We are not planning to add CEGUI directly to the Irrlicht_extended project. But using CEGUI is quite simple with Irrlicht (once you succesfully compiled it^^): http://static.cegui.org.uk/docs/0.8.7/rendering_tutorial.html
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
JFT90
 
Posts: 17
Joined: Sun Jan 03, 2016 6:53 pm

Re: Implementing BGFX as a driver...

Postby AReichl » Fri Oct 21, 2016 7:24 am

Still does not work.
"git checkout bgfx" says not a valid repository.
AReichl
 
Posts: 230
Joined: Wed Jul 13, 2011 2:34 pm

Re: Implementing BGFX as a driver...

Postby JFT90 » Fri Oct 21, 2016 11:25 am

You need to run 'git checkout bgfx' inside the Irrlicht_extended folder you created with 'git clone...'

I forgot the cd command in my post before - so the full command sequence would be:
cpp Code: Select all
 
git clone https://gitlab.com/JFT/Irrlicht_extended.git
cd Irrlicht_extended
git checkout bgfx
 
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
JFT90
 
Posts: 17
Joined: Sun Jan 03, 2016 6:53 pm

Re: Implementing BGFX as a driver...

Postby JFT90 » Sun Jul 23, 2017 7:46 pm

We have added support for compute shaders and instancing.
Also we decided to give users the ability to access some bgfx features more or less directly.
Checkout the files in the include/ directory:
IBgfxBuffer.h
IBgfxManipulator.h
IComputeShader.h

We know thats not really nice as other drivers won't be able to use it, but Bgfx offers OpenGl, DirectX, Metal and (hopefully) soon Vulkan anyway...

As there is never enough time and other projects to work on as well, adding new features plus fixing problems will probably take some time.
So if anyone is interested in adding more features of bgfx to Irrlicht or in helping bugs (we expect there are many) we would appreciate it ;)
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
JFT90
 
Posts: 17
Joined: Sun Jan 03, 2016 6:53 pm

Re: Implementing BGFX as a driver...

Postby robmar » Mon Aug 14, 2017 10:39 am

Hi, just wanted to ask if this can work with 1.7.3 without too much work?

Does this driver support the current shaders, for transparency, metal effect, etc?
robmar
 
Posts: 991
Joined: Sun Aug 14, 2011 11:30 pm

Re: Implementing BGFX as a driver...

Postby JFT90 » Tue Aug 15, 2017 2:38 pm

Hmmm... It should be possible to add the bgfx-driver to 1.7.3 without too much work
You would need all the files containing *Bgfx* from source and probably should run a diff between the two versions
to see the changes made to all Driver related parts.

The driver supports anything as long as you write the shaders yourself - we didn't implement all the standard effects available in other drivers,
because we didn't need them (yet) and usually we need more customized shaders for our projects anyway.
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
JFT90
 
Posts: 17
Joined: Sun Jan 03, 2016 6:53 pm

Re: Implementing BGFX as a driver...

Postby robmar » Thu Aug 17, 2017 11:16 am

Okay thanks, and how is the efficiency of the Bgfx driver, is there any extra overhead compared to the inbuilt DX9?
robmar
 
Posts: 991
Joined: Sun Aug 14, 2011 11:30 pm

Re: Implementing BGFX as a driver...

Postby JFT90 » Tue Aug 29, 2017 5:17 pm

I can't test the inbuilt DX9 vs Bgfx DX9 at the moment - Only have a Linux Laptop were I am right now.
The author of Bgfx says there is no big overhead: https://github.com/bkaradzic/bgfx/issues/631

In our cross-platform project we noticed significant fps improvements (40%) using bgfx instead of the inbuilt OpenGL driver.

If you want to run a benchmark - I can try to help you.
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
JFT90
 
Posts: 17
Joined: Sun Jan 03, 2016 6:53 pm

Re: Implementing BGFX as a driver...

Postby robmar » Sat Sep 16, 2017 8:22 am

Okay, any idea of the improvement of Bgfx compared to DX9?

I'd love to tun a benchmark, so any help would be appreciated
robmar
 
Posts: 991
Joined: Sun Aug 14, 2011 11:30 pm

Re: Implementing BGFX as a driver...

Postby JFT90 » Wed Sep 20, 2017 12:47 pm

I have no Idea how good bgfx performs with dx9.

Do you have an example you'd like to run the benchmark on?
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
JFT90
 
Posts: 17
Joined: Sun Jan 03, 2016 6:53 pm

Re: Implementing BGFX as a driver...

Postby ikam » Sun Sep 24, 2017 6:20 am

Nice job JFT90.
I'll use your implementation
ikam
 
Posts: 46
Joined: Sun Jun 24, 2007 4:46 pm
Location: France

Previous

Return to Open Discussion and Dev Announcements

Who is online

Users browsing this forum: No registered users and 1 guest