Hello Guest

BGFX shaderc

  • 4 Replies
  • 10243 Views
*

Offline VeAr

  • *
  • 18
BGFX shaderc
« on: August 05, 2018, 17:14:10 »
Hi.

I was experimenting with BGFX, it looks like a promising cross-platform graphics middleware.

My problem is that the LWJGL distribution does not contain the shader compiler, a standalone executable. There are two other tools in BGFX (texture packer, mesh packer), but those are not essential. The shader compiler is needed tho, without it its not possible to convert from the library's proprietary shader format to a runtime format required by the platform.

I found an older version of the executable and managed to compile for DX9, but the compiled shader for DX12 isn't what its supposed to be. I presume i would need a shader compiler matching the BGFX version that is bundled in LWJGL.

I could try to compile it myself, but that is hassle i would rather not do.

Another question is if the bundled BGFX was compiled with specific parameters, as i can't get OpenGL or Vulcan working on windows. OpenGL just crashes, and Vulcan shows a blank window.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: BGFX shaderc
« Reply #1 on: August 05, 2018, 20:38:25 »
My problem is that the LWJGL distribution does not contain the shader compiler, a standalone executable. There are two other tools in BGFX (texture packer, mesh packer), but those are not essential. The shader compiler is needed tho, without it its not possible to convert from the library's proprietary shader format to a runtime format required by the platform.

I found an older version of the executable and managed to compile for DX9, but the compiled shader for DX12 isn't what its supposed to be. I presume i would need a shader compiler matching the BGFX version that is bundled in LWJGL.

I could try to compile it myself, but that is hassle i would rather not do.

LWJGL does not distribute these tools because they're quite large and are supposed to be used offline. You make a good point about the BGFX version though and building them is indeed a hassle. I'll see what I can do. They won't be added to the bgfx artifacts, but you'll be able to download them, using the LWJGL website's file browser for example.

Another question is if the bundled BGFX was compiled with specific parameters, as i can't get OpenGL or Vulcan working on windows. OpenGL just crashes, and Vulcan shows a blank window.

Nope. You can examine the build script here. The OpenGL backend works fine for me on Windows (the HelloBGFX sample in the LWJGL 3 repository at least). The Vulkan backend is not supported yet, see #274 for more information.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: BGFX shaderc
« Reply #2 on: August 06, 2018, 09:52:01 »
Builds of bgfx tools are now available. For example, Windows x64 binaries can be downloaded from: https://www.lwjgl.org/browse/nightly/windows/x64/bgfx-tools

*

Offline VeAr

  • *
  • 18
Re: BGFX shaderc
« Reply #3 on: August 06, 2018, 10:01:57 »
Builds of bgfx tools are now available. For example, Windows x64 binaries can be downloaded from: https://www.lwjgl.org/browse/nightly/windows/x64/bgfx-tools

Thanks a lot! I appreciate the effort you are putting into LWJGL very much.

Re: BGFX shaderc
« Reply #4 on: February 21, 2019, 23:01:50 »
Just wanted to add a thank you for this! Very useful to include these... I'd gone through with building my own from a separate raw copy of the bgfx project - but it's much better to have these included, known to be built against the correct version of BGFX that lwjgl includes. Appreciate the effort, thanks.