From e295cdda4dd06574b4b0f03ff6dbec5658f803f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 26 Apr 2014 20:18:17 -0700 Subject: [PATCH] Updated README. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 88865873..18054b1b 100644 --- a/README.md +++ b/README.md @@ -394,6 +394,20 @@ preprocessor to transform GLSL like language syntax into HLSL. This technique has certain drawbacks, but overall it's simple and allows quick authoring of cross-platform shaders. +Some differences between bgfx's shaderc flavor of GLSL and regular GLSL: + + - No `bool/int` uniforms, all uniforms must be `float`. + - Attributes and varyings can be accessed only from `main()` function. + - Must use `SAMPLER2D/3D/CUBE/etc.` macros instead of `sampler2D/3D/Cube/etc.` + tokens. + - Must use `vec2/3/4_splat()` instead of `vec2/3/4()`. + - Must use `mul(x, y)` when multiplying vectors and matrices. + - Must use `varying.def.sc` to define input/output semantic and precission + instead of using `attribute/in` and `varying/in/out`. + - `$input/$output` tokens must appear at the begining of shader. + +For more info see [shader helper macros](https://github.com/bkaradzic/bgfx/blob/master/src/bgfx_shader.sh). + ### Texture Compiler (texturec) This tool doesn't currently exist. To produce DDS, KTX or PVR textures use: