mame/3rdparty/bgfx/examples/39-assao/uniforms.sh
Julian Sikorski 0837e7451a WIP: sync bgfx, bx and bimg with latest upstream (#5723)
* Sync with bgfx upstream revision b91d0b6

* Sync with bx upstream revision d60912b

* Sync with bimg upstream revision bd81f60

* Add astc-codec decoder

* Rename VertexDecl to VertexLayout

* Rename UniformType enum Int1 to Sampler.

* Add NVN stub

* Fix unused-const-variable error on macOS

* Drop redundant explicit language parameters
buildoptions_cpp are only applied to c++ files and buildoptions_objcpp are only
applied to objective c++ files. As such, hardcoding -x offers no benefit while
preventing overrides (such as one needed by 3rdparty/bgfx/src/renderer_vk.cpp on
macOS) from working.

* Re-introduce -x c++ in places where C code is compiled as C++ to prevent clang from throwing a warning

* Build bgfx as Objective-C++ on macOS
It is needed due to included headers

* Enable Direct3D12 and Vulkan bgfx rendering backends

* Enable building of spirv shaders

* Properly escape /c in cmd call

* Comment out dx12 bgfx renderer

* Honor VERBOSE setting during shaders build

* Only invert hlsl shader XYZ_TO_sRGB matrix for opengl

* Add spirv shaders

* OpenGL ES needs transposed matrix too

* Metal needs transposed matrix as well
2019-10-13 07:50:38 -04:00

43 lines
1.9 KiB
Bash

uniform vec4 u_params[19];
uniform vec4 u_rect;
#define u_viewportPixelSize u_params[0].xy
#define u_halfViewportPixelSize u_params[0].zw
#define u_depthUnpackConsts u_params[1].xy
#define u_ndcToViewMul u_params[2].xy
#define u_ndcToViewAdd u_params[2].zw
#define u_perPassFullResCoordOffset u_params[3].xy
#define u_perPassFullResUVOffset u_params[3].zw
#define u_viewport2xPixelSize u_params[4].xy
#define u_viewport2xPixelSize_x_025 u_params[4].zw
#define u_effectRadius u_params[5].x
#define u_effectShadowStrength u_params[5].y
#define u_effectShadowPow u_params[5].z
#define u_effectShadowClamp u_params[5].w
#define u_effectFadeOutMul u_params[6].x
#define u_effectFadeOutAdd u_params[6].y
#define u_effectHorizonAngleThreshold u_params[6].z
#define u_effectSamplingRadiusNearLimitRec u_params[6].w
#define u_depthPrecisionOffsetMod u_params[7].x
#define u_negRecEffectRadius u_params[7].y
#define u_loadCounterAvgDiv u_params[7].z
#define u_adaptiveSampleCountLimit u_params[7].w
#define u_invSharpness u_params[8].x
#define u_passIndex u_params[8].y
#define u_quarterResPixelSize u_params[8].zw
#define u_patternRotScaleMatrices(i) u_params[9+(i)]
#define u_normalsUnpackMul u_params[14].x
#define u_normalsUnpackAdd u_params[14].y
#define u_detailAOStrength u_params[14].z
#define u_layer u_params[14].w
#define u_normalsWorldToViewspaceMatrix0 u_params[15]
#define u_normalsWorldToViewspaceMatrix1 u_params[16]
#define u_normalsWorldToViewspaceMatrix2 u_params[17]
#define u_normalsWorldToViewspaceMatrix3 u_params[18]
#define SSAO_MAX_TAPS 32
#define SSAO_ADAPTIVE_TAP_BASE_COUNT 5
#define SSAO_ADAPTIVE_TAP_FLEXIBLE_COUNT (SSAO_MAX_TAPS-SSAO_ADAPTIVE_TAP_BASE_COUNT)
#define SSAO_DEPTH_MIP_LEVELS 4
#define SSAO_ENABLE_NORMAL_WORLD_TO_VIEW_CONVERSION 1