Implementing BGFX as a driver...
Re: Implementing BGFX as a driver...
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.
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.
Re: Implementing BGFX as a driver...
To pull the bgfx branch you just do:
maybe you need to use one more
after switching to the bgfx branch - normally its not necessary if you have a freshly cloned version.
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 inside the bgfx folder.
I will add compiled bgfxlibraries for mingw to the lib folder when I am back home later.
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/r ... orial.html
Code: Select all
git clone https://gitlab.com/JFT/Irrlicht_extended.git
git checkout bgfx
Code: Select all
git pull
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.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 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
Code: Select all
make mingw-gcc-release32
I will add compiled bgfxlibraries for mingw to the lib folder when I am back home later.
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.If you add CEGUI to the project will it be accessible by others?
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/r ... orial.html
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
Re: Implementing BGFX as a driver...
Still does not work.
"git checkout bgfx" says not a valid repository.
"git checkout bgfx" says not a valid repository.
Re: Implementing BGFX as a driver...
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:
I forgot the cd command in my post before - so the full command sequence would be:
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)
Re: Implementing BGFX as a driver...
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
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)
Re: Implementing BGFX as a driver...
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?
Does this driver support the current shaders, for transparency, metal effect, etc?
Re: Implementing BGFX as a driver...
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.
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)
Re: Implementing BGFX as a driver...
Okay thanks, and how is the efficiency of the Bgfx driver, is there any extra overhead compared to the inbuilt DX9?
Re: Implementing BGFX as a driver...
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.
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)
Re: Implementing BGFX as a driver...
Okay, any idea of the improvement of Bgfx compared to DX9?
I'd love to tun a benchmark, so any help would be appreciated
I'd love to tun a benchmark, so any help would be appreciated
Re: Implementing BGFX as a driver...
I have no Idea how good bgfx performs with dx9.
Do you have an example you'd like to run the benchmark on?
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)
Re: Implementing BGFX as a driver...
Nice job JFT90.
I'll use your implementation
I'll use your implementation
Re: Implementing BGFX as a driver...
I have your code running, Irrlicht + BGFX, but there are problems with the first and some other shaders, probably because I'm using a different GPU to those tested on. Sometimes NVidia code runs the shaders, and AMD fails, or the other way around.
As the shaders are coded into the code files, its not easy to test and fix them.
Could original files for the shaders be provided?
Rather than coding the shader text into the source code, its better to load them from a standard text file, makes testing and fixing so much easier.
As the shaders are coded into the code files, its not easy to test and fix them.
Could original files for the shaders be provided?
Rather than coding the shader text into the source code, its better to load them from a standard text file, makes testing and fixing so much easier.
Re: Implementing BGFX as a driver...
Hey,
original shader files are written in shaderc: https://bkaradzic.github.io/bgfx/tools.html
you can find them in
the *.sc files are the ones you can edit.
To compile them (i assume you have a git-bash shell on windows) just run the shellscript
In our project that uses irrlicht+bgfx I changed the compilation process to produce *.bin files that are loaded on runtime.
You are correct, testing is a lot faster that way. I will change the irrlicht code to load shader *.bin files at runtime as well as soon as I have some time.
Also: If you create an issue at our gitlab page https://gitlab.com/JFT/Irrlicht_extended, we will notice sooner, that something needs to be changed.
PS: Can you give me the error message you get when irrlicht/bgfx fails? In Debug there should be a lot of output.
original shader files are written in shaderc: https://bkaradzic.github.io/bgfx/tools.html
you can find them in
Code: Select all
source/Irrlicht/bgfx_shader/
To compile them (i assume you have a git-bash shell on windows) just run the shellscript
Code: Select all
shaders.sh
You are correct, testing is a lot faster that way. I will change the irrlicht code to load shader *.bin files at runtime as well as soon as I have some time.
Also: If you create an issue at our gitlab page https://gitlab.com/JFT/Irrlicht_extended, we will notice sooner, that something needs to be changed.
PS: Can you give me the error message you get when irrlicht/bgfx fails? In Debug there should be a lot of output.
Irrlicht with bgfx-Driver https://gitlab.com/JFT/Irrlicht_extended (forked from Irrlicht trunk)
Re: Implementing BGFX as a driver...
The calls to load the shaders (2 or 3 of them), failed, I thought it was the AMD shader compiler not happy with the syntax. I've seen this many times where shader code compiles on the NVidia but not on the AMD, usually the code needs minor adjustment.
I´ll take a look at it again soon and try to fix it. Will post on your page.
I´ll take a look at it again soon and try to fix it. Will post on your page.