MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 2261
Send PM
Re: Converting CG and GLSL shader types to BGFX??
08/02/16 11:11 AM


> How difficult is it to convert existing CG or GLSL based shaders (RetroArch) to BGFX
> format?

It depends. If you pull the MAME source code off of Github and look in src/osd/modules/render/bgfx/shaders, you can see what a number of converted shaders from RetroArch look like.

At build time, the BGFX shaders are converted to either GLSL, GLES-compliant GLSL, or HLSL, and then compiled into binaries. As a result of supporting GLES, the shaders supplied to BGFX must meet a handful of requirements, which can make converting shaders a bit of a pain, requiring manual rather than automatic conversion:

- No implicit conversion between scalar and vector types.
- No implicit conversion between boolean and float types.
- No uniforms other than vec4.
- Most syntax favors GLSL tokens over HLSL tokens: vec4 instead of float4, mix instead of lerp, and so on.







Entire thread
Subject Posted by Posted on
* Converting CG and GLSL shader types to BGFX?? lettuce 07/31/16 03:12 PM
. * Re: Converting CG and GLSL shader types to BGFX?? SoltanGris42  08/04/16 02:33 AM
. * Re: Converting CG and GLSL shader types to BGFX?? Jezze  08/04/16 10:23 PM
. * Re: Converting CG and GLSL shader types to BGFX?? B2K24  03/17/17 07:50 AM
. * Early partially broken test version of crt-easymode-halation SoltanGris42  08/03/16 10:22 AM
. * Re: Converting CG and GLSL shader types to BGFX?? MooglyGuy  08/02/16 11:11 AM
. * Re: Converting CG and GLSL shader types to BGFX?? lettuce  08/01/16 10:05 PM
. * Re: Converting CG and GLSL shader types to BGFX?? SoltanGris42  08/01/16 02:56 AM
. * Aye. That is awful pre-tty. (nt) Traso  08/02/16 10:03 PM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 391 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 7587