BGFX shaderc

Started by VeAr, August 05, 2018, 17:14:10

Previous topic - Next topic

VeAr

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.

spasi

Quote from: VeAr on August 05, 2018, 17:14:10My 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.

Quote from: VeAr on August 05, 2018, 17:14:10Another 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.

spasi

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

VeAr

Quote from: spasi 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

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

mcslee

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.