bgfx/examples/45-bokeh/parameters.sh
elvencache 7f758a06a7
Improve Bokeh example (#2377)
* display bokeh sample pattern, add bokeh shape, improve look

draw sample pattern to texture and display in ui to see number of samples and their arrangment

add bokeh shape controls

remove adhoc 'sqrt' pattern since display makes existing pattern easier to understand and it looks nicer.

switch to floating point color texture and leave lighting results in linear space until after dof is performed. provides better results and bright spots can make more noticeable bokeh shapes.

change default values to use take more samples at reduced resolution so initial experience when loading the sample is better looking image

* update screenshot, minor change to ui

fix height of ui element so scrollbar not required by default layout
update screenshot

* fix typo in texturev

atleast, i'm pretty sure that's a typo don't see a reason to set width twice
2021-02-04 20:28:54 -08:00

29 lines
834 B
Bash

/*
* Copyright 2021 elven cache. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#ifndef PARAMETERS_SH
#define PARAMETERS_SH
// struct PassUniforms
uniform vec4 u_params[13];
#define u_depthUnpackConsts (u_params[0].xy)
#define u_frameIdx (u_params[0].z)
#define u_lobeRotation (u_params[0].w)
#define u_ndcToViewMul (u_params[1].xy)
#define u_ndcToViewAdd (u_params[1].zw)
#define u_blurSteps (u_params[2].x)
#define u_lobeCount (u_params[2].y)
#define u_lobeRadiusMin (u_params[2].z)
#define u_lobeRadiusDelta2x (u_params[2].w)
#define u_samplePattern (u_params[2].y)
#define u_maxBlurSize (u_params[3].x)
#define u_focusPoint (u_params[3].y)
#define u_focusScale (u_params[3].z)
#define u_radiusScale (u_params[3].w)
#endif // PARAMETERS_SH