├── README
├── jquery
├── development-bundle
│ ├── version.txt
│ ├── demos
│ │ ├── images
│ │ │ ├── calendar.gif
│ │ │ ├── pbar-ani.gif
│ │ │ ├── demo-config-on.gif
│ │ │ ├── icon-docs-info.gif
│ │ │ ├── demo-config-on-tile.gif
│ │ │ ├── demo-spindown-open.gif
│ │ │ └── demo-spindown-closed.gif
│ │ ├── button
│ │ │ ├── index.html
│ │ │ ├── default.html
│ │ │ ├── radio.html
│ │ │ ├── splitbutton.html
│ │ │ ├── checkbox.html
│ │ │ ├── icons.html
│ │ │ └── toolbar.html
│ │ └── slider
│ │ │ ├── default.html
│ │ │ ├── index.html
│ │ │ ├── rangemax.html
│ │ │ ├── rangemin.html
│ │ │ ├── steps.html
│ │ │ ├── slider-vertical.html
│ │ │ ├── range.html
│ │ │ ├── range-vertical.html
│ │ │ ├── hotelrooms.html
│ │ │ ├── multiple-vertical.html
│ │ │ ├── colorpicker.html
│ │ │ └── tabs.html
│ ├── themes
│ │ ├── base
│ │ │ ├── jquery.ui.base.css
│ │ │ ├── images
│ │ │ │ ├── ui-icons_222222_256x240.png
│ │ │ │ ├── ui-icons_2e83ff_256x240.png
│ │ │ │ ├── ui-icons_454545_256x240.png
│ │ │ │ ├── ui-icons_888888_256x240.png
│ │ │ │ ├── ui-icons_cd0a0a_256x240.png
│ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png
│ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png
│ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png
│ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png
│ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png
│ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png
│ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png
│ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png
│ │ │ ├── jquery.ui.all.css
│ │ │ ├── jquery.ui.slider.css
│ │ │ ├── jquery.ui.core.css
│ │ │ └── jquery.ui.button.css
│ │ └── ui-darkness
│ │ │ ├── jquery.ui.base.css
│ │ │ ├── images
│ │ │ ├── ui-icons_222222_256x240.png
│ │ │ ├── ui-icons_4b8e0b_256x240.png
│ │ │ ├── ui-icons_a83300_256x240.png
│ │ │ ├── ui-icons_cccccc_256x240.png
│ │ │ ├── ui-icons_ffffff_256x240.png
│ │ │ ├── ui-bg_flat_30_cccccc_40x100.png
│ │ │ ├── ui-bg_flat_50_5c5c5c_40x100.png
│ │ │ ├── ui-bg_glass_20_555555_1x400.png
│ │ │ ├── ui-bg_glass_40_0078a3_1x400.png
│ │ │ ├── ui-bg_glass_40_ffc73d_1x400.png
│ │ │ ├── ui-bg_gloss-wave_25_333333_500x100.png
│ │ │ ├── ui-bg_inset-soft_25_000000_1x100.png
│ │ │ ├── ui-bg_inset-soft_30_f58400_1x100.png
│ │ │ └── ui-bg_highlight-soft_80_eeeeee_1x100.png
│ │ │ ├── jquery.ui.all.css
│ │ │ ├── jquery.ui.slider.css
│ │ │ ├── jquery.ui.core.css
│ │ │ └── jquery.ui.button.css
│ ├── AUTHORS.txt
│ ├── MIT-LICENSE.txt
│ ├── external
│ │ ├── jquery.bgiframe-2.1.2.js
│ │ ├── jquery.cookie.js
│ │ ├── qunit.css
│ │ └── jquery.metadata.js
│ └── ui
│ │ ├── minified
│ │ ├── jquery.ui.mouse.min.js
│ │ ├── jquery.ui.widget.min.js
│ │ └── jquery.ui.core.min.js
│ │ └── jquery.ui.mouse.js
├── css
│ └── ui-darkness
│ │ └── images
│ │ ├── ui-icons_222222_256x240.png
│ │ ├── ui-icons_4b8e0b_256x240.png
│ │ ├── ui-icons_a83300_256x240.png
│ │ ├── ui-icons_cccccc_256x240.png
│ │ ├── ui-icons_ffffff_256x240.png
│ │ ├── ui-bg_flat_30_cccccc_40x100.png
│ │ ├── ui-bg_flat_50_5c5c5c_40x100.png
│ │ ├── ui-bg_glass_20_555555_1x400.png
│ │ ├── ui-bg_glass_40_0078a3_1x400.png
│ │ ├── ui-bg_glass_40_ffc73d_1x400.png
│ │ ├── ui-bg_inset-soft_25_000000_1x100.png
│ │ ├── ui-bg_inset-soft_30_f58400_1x100.png
│ │ ├── ui-bg_gloss-wave_25_333333_500x100.png
│ │ └── ui-bg_highlight-soft_80_eeeeee_1x100.png
└── jquery.cookie.js
├── up.png
├── down.png
├── right.png
├── node_bg.png
├── panel_bg.png
├── scene
├── city
│ ├── black.png
│ ├── blue.jpg
│ ├── green.jpg
│ ├── green.png
│ ├── red.jpg
│ ├── white.png
│ ├── orange.jpg
│ ├── LongWindow.jpg
│ ├── WideWindow.jpg
│ ├── WindoNormal1.jpg
│ ├── WindoDiffuse1.jpg
│ ├── WindoSpecular1.jpg
│ ├── LongWindowNormal.jpg
│ ├── WideWindowNormal.jpg
│ ├── LongWindowSpecular.jpg
│ └── WideWindowSpecular.jpg
├── scene.js
└── simple.shader
├── mix
├── bot.shader
├── top.shader
├── mul.shader
├── max.shader
├── min.shader
├── avg.shader
└── mix.js
├── pass.shader
├── glee
├── schedule.js
├── clock.js
├── error.js
├── keys.js
├── renderbuffer.js
├── picks.js
├── plane.js
├── model.js
├── vector.js
├── cube.js
├── viewpoint.js
├── fbo.js
├── sphere.js
├── resources.js
└── texture.js
├── util.shader
├── normaldepth
├── normal.shader
├── normaldepth.shader
└── normaldepth.js
├── uitest.html
├── sky
├── cube_pass.shader
├── downsample.shader
├── cubemap_convolve.shader
├── display.shader
└── scattering.shader
├── shadow
├── shadow.shader
└── shadow.js
├── multiply.shader
├── util.js
├── main.js
├── $
├── blur
├── blur.shader
└── blur.js
├── census.js
├── style.css
├── statistic.js
└── ssao
├── gp1.shader
├── gpg8.shader
├── gd.backup.shader
├── gd.shader
└── gd.2.backup.shader
/README:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/jquery/development-bundle/version.txt:
--------------------------------------------------------------------------------
1 | 1.8.11
2 |
--------------------------------------------------------------------------------
/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/up.png
--------------------------------------------------------------------------------
/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/down.png
--------------------------------------------------------------------------------
/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/right.png
--------------------------------------------------------------------------------
/node_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/node_bg.png
--------------------------------------------------------------------------------
/panel_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/panel_bg.png
--------------------------------------------------------------------------------
/scene/city/black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/black.png
--------------------------------------------------------------------------------
/scene/city/blue.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/blue.jpg
--------------------------------------------------------------------------------
/scene/city/green.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/green.jpg
--------------------------------------------------------------------------------
/scene/city/green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/green.png
--------------------------------------------------------------------------------
/scene/city/red.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/red.jpg
--------------------------------------------------------------------------------
/scene/city/white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/white.png
--------------------------------------------------------------------------------
/scene/city/orange.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/orange.jpg
--------------------------------------------------------------------------------
/scene/city/LongWindow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/LongWindow.jpg
--------------------------------------------------------------------------------
/scene/city/WideWindow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/WideWindow.jpg
--------------------------------------------------------------------------------
/scene/city/WindoNormal1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/WindoNormal1.jpg
--------------------------------------------------------------------------------
/scene/city/WindoDiffuse1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/WindoDiffuse1.jpg
--------------------------------------------------------------------------------
/scene/city/WindoSpecular1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/WindoSpecular1.jpg
--------------------------------------------------------------------------------
/scene/city/LongWindowNormal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/LongWindowNormal.jpg
--------------------------------------------------------------------------------
/scene/city/WideWindowNormal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/WideWindowNormal.jpg
--------------------------------------------------------------------------------
/scene/city/LongWindowSpecular.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/LongWindowSpecular.jpg
--------------------------------------------------------------------------------
/scene/city/WideWindowSpecular.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/scene/city/WideWindowSpecular.jpg
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/calendar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/calendar.gif
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/pbar-ani.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/pbar-ani.gif
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-icons_4b8e0b_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-icons_4b8e0b_256x240.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-icons_a83300_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-icons_a83300_256x240.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-icons_cccccc_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-icons_cccccc_256x240.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/demo-config-on.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/demo-config-on.gif
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/icon-docs-info.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/icon-docs-info.gif
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/jquery.ui.base.css:
--------------------------------------------------------------------------------
1 | @import url("jquery.ui.core.css");
2 | @import url("jquery.ui.button.css");
3 | @import url("jquery.ui.slider.css");
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_flat_30_cccccc_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_flat_30_cccccc_40x100.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_flat_50_5c5c5c_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_flat_50_5c5c5c_40x100.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_glass_20_555555_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_glass_20_555555_1x400.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_glass_40_0078a3_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_glass_40_0078a3_1x400.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_glass_40_ffc73d_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_glass_40_ffc73d_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/demo-config-on-tile.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/demo-config-on-tile.gif
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/demo-spindown-open.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/demo-spindown-open.gif
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/jquery.ui.base.css:
--------------------------------------------------------------------------------
1 | @import url("jquery.ui.core.css");
2 | @import url("jquery.ui.button.css");
3 | @import url("jquery.ui.slider.css");
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/images/demo-spindown-closed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/demos/images/demo-spindown-closed.gif
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_inset-soft_25_000000_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_inset-soft_25_000000_1x100.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png
--------------------------------------------------------------------------------
/jquery/css/ui-darkness/images/ui-bg_highlight-soft_80_eeeeee_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/css/ui-darkness/images/ui-bg_highlight-soft_80_eeeeee_1x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-icons_454545_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-icons_454545_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-icons_888888_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-icons_888888_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-icons_4b8e0b_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-icons_4b8e0b_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-icons_a83300_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-icons_a83300_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-icons_cccccc_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-icons_cccccc_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_flat_30_cccccc_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_flat_30_cccccc_40x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_flat_50_5c5c5c_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_flat_50_5c5c5c_40x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_glass_20_555555_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_glass_20_555555_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_glass_40_0078a3_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_glass_40_0078a3_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_glass_40_ffc73d_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_glass_40_ffc73d_1x400.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_inset-soft_25_000000_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_inset-soft_25_000000_1x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/images/ui-bg_highlight-soft_80_eeeeee_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pyalot/WebGL-City-SSAO/HEAD/jquery/development-bundle/themes/ui-darkness/images/ui-bg_highlight-soft_80_eeeeee_1x100.png
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/jquery.ui.all.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI CSS Framework 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Theming
9 | */
10 | @import "jquery.ui.base.css";
11 | @import "jquery.ui.theme.css";
12 |
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/jquery.ui.all.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI CSS Framework 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Theming
9 | */
10 | @import "jquery.ui.base.css";
11 | @import "jquery.ui.theme.css";
12 |
--------------------------------------------------------------------------------
/mix/bot.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D op1, op2;
17 | varying vec2 uv;
18 |
19 | void main(void){
20 | gl_FragColor = texture2D(op2, uv);
21 | }
22 |
--------------------------------------------------------------------------------
/mix/top.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D op1, op2;
17 | varying vec2 uv;
18 |
19 | void main(void){
20 | gl_FragColor = texture2D(op1, uv);
21 | }
22 |
--------------------------------------------------------------------------------
/mix/mul.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D op1, op2;
17 | varying vec2 uv;
18 |
19 | void main(void){
20 | gl_FragColor = texture2D(op1, uv) * texture2D(op2, uv);
21 | }
22 |
--------------------------------------------------------------------------------
/mix/max.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D op1, op2;
17 | varying vec2 uv;
18 |
19 | void main(void){
20 | gl_FragColor = max(texture2D(op1, uv), texture2D(op2, uv));
21 | }
22 |
--------------------------------------------------------------------------------
/mix/min.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D op1, op2;
17 | varying vec2 uv;
18 |
19 | void main(void){
20 | gl_FragColor = min(texture2D(op1, uv), texture2D(op2, uv));
21 | }
22 |
--------------------------------------------------------------------------------
/mix/avg.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D op1, op2;
17 | varying vec2 uv;
18 |
19 | void main(void){
20 | gl_FragColor = (texture2D(op1, uv) + texture2D(op2, uv))/2.0;
21 | }
22 |
--------------------------------------------------------------------------------
/pass.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 v_texcoord;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | v_texcoord = texcoord;
13 | }
14 |
15 | fragment: depthutil
16 | varying vec2 v_texcoord;
17 | uniform sampler2D source;
18 | void main(void){
19 | vec4 src = texture2D(source, v_texcoord);
20 | gl_FragColor = vec4(src.rgb, 1.0);
21 | }
22 |
--------------------------------------------------------------------------------
/glee/schedule.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.prototype.schedule = function(onrun){
6 | var last = new Date().getTime();
7 | var request = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
8 |
9 | var step = function(){
10 | request(step);
11 | var current = new Date().getTime();
12 | var delta = current-last;
13 | delta = Math.max(1, Math.min(delta, 500));
14 | last = current;
15 | onrun(delta/1000, current);
16 | }
17 | request(step);
18 | };
19 |
--------------------------------------------------------------------------------
/util.shader:
--------------------------------------------------------------------------------
1 | vec2 encode_normal(vec3 normal)
2 | {
3 | float f = sqrt(8.0*normal.z+8.0);
4 | return normal.xy / f + 0.5;
5 | }
6 |
7 | vec2 encode_depth(vec3 position){
8 | float depth = (length(position)-near)/far;
9 | depth = depth*255.0*255.0;
10 | return vec2(
11 | mod(depth, 255.0)/255.0,
12 | floor(depth/255.0)/255.0
13 | );
14 | }
15 |
16 | vec3 decode_normal(vec2 enc)
17 | {
18 | vec2 fenc = enc*4.0-2.0;
19 | float f = dot(fenc,fenc);
20 | float g = sqrt(1.0-f/4.0);
21 | return vec3(fenc*g, 1.0-f/2.0);
22 | }
23 |
24 | float decode_depth(vec2 src){
25 | float depth = src.x/255.0+src.y;
26 | return depth*far+near;
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button Demos
6 |
7 |
8 |
9 |
10 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/normaldepth/normal.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position, normal;
7 | varying vec3 v_normal, v_position;
8 | uniform mat4 proj, view;
9 |
10 | void main(void) {
11 | gl_Position = proj * view * vec4(position, 1.0);
12 | v_normal = normal;
13 | v_position = position;
14 | }
15 |
16 | fragment:
17 | varying vec3 v_normal, v_position;
18 | uniform mat3 view_rot;
19 | uniform mat4 view;
20 | uniform float near, far;
21 |
22 | void main(void){
23 | vec3 normal = normalize(v_normal);
24 | gl_FragColor = vec4((normal+1.0)*0.5, 1.0);
25 | }
26 |
--------------------------------------------------------------------------------
/glee/clock.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.prototype.FPS = function(params){
6 | var counts = [];
7 | var count = 0;
8 | var last = (new Date()).getTime();
9 |
10 | this.tick = function(){
11 | count += 1;
12 | }
13 |
14 | setInterval(function(){
15 | var now = (new Date()).getTime();
16 | var delta = now - last;
17 | last = now;
18 | var fps = (1000*count)/delta;
19 | count = 0;
20 | counts.push(fps);
21 | while(counts.length > params.average_over){
22 | counts.shift();
23 | }
24 | var avg = 0;
25 | for(var i=0; i.
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | var gl = glee.gl;
7 | glee.checkError = function(description){
8 | var code = gl.getError();
9 | switch(code){
10 | case gl.NO_ERROR:
11 | return;
12 | case gl.OUT_OF_MEMORY:
13 | throw 'Out of Memory: ' + description
14 | case gl.INVALID_ENUM:
15 | throw 'Invalid Enum: ' + description
16 | case gl.INVALID_OPERATION:
17 | throw 'Invalid Operation: ' + description
18 | case gl.INVALID_FRAMEBUFFER_OPERATION:
19 | throw 'Invalid Framebuffer Operation: ' + description
20 | case gl.INVALID_VALUE:
21 | throw 'Invalid Value: ' + description
22 | }
23 | }
24 | });
25 |
26 |
--------------------------------------------------------------------------------
/glee/keys.js:
--------------------------------------------------------------------------------
1 | Glee.prototype.Keys = function(){
2 | var keymap = ({
3 | 87: 'w',
4 | 65: 'a',
5 | 83: 's',
6 | 68: 'd',
7 | 81: 'q',
8 | 69: 'e',
9 | 37: 'left',
10 | 39: 'right',
11 | 38: 'up',
12 | 40: 'down',
13 | 13: 'enter',
14 | 27: 'esc',
15 | 32: 'space',
16 | 8: 'backspace',
17 | 16: 'shift',
18 | 17: 'ctrl',
19 | 18: 'alt',
20 | 91: 'start',
21 | 0: 'altc',
22 | 20: 'caps',
23 | 9: 'tab',
24 | 49: 'key1',
25 | 50: 'key2',
26 | 51: 'key3',
27 | 52: 'key4'
28 | });
29 |
30 | var self = this;
31 |
32 | $(document).keydown(function(event){
33 | self[keymap[event.which]] = true;
34 | });
35 |
36 | $(document).keyup(function(event){
37 | self[keymap[event.which]] = false;
38 | });
39 |
40 | };
41 |
--------------------------------------------------------------------------------
/uitest.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 | Test
20 | Test
21 |
22 |
23 |
--------------------------------------------------------------------------------
/jquery/development-bundle/AUTHORS.txt:
--------------------------------------------------------------------------------
1 | jQuery UI Authors (http://jqueryui.com/about)
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | and logs, available at http://github.com/jquery/jquery-ui
6 |
7 | Brandon Aaron
8 | Paul Bakaus (paulbakaus.com)
9 | David Bolter
10 | Rich Caloggero
11 | Chi Cheng (cloudream@gmail.com)
12 | Colin Clark (http://colin.atrc.utoronto.ca/)
13 | Michelle D'Souza
14 | Aaron Eisenberger (aaronchi@gmail.com)
15 | Ariel Flesler
16 | Bohdan Ganicky
17 | Scott González
18 | Marc Grabanski (m@marcgrabanski.com)
19 | Klaus Hartl (stilbuero.de)
20 | Scott Jehl
21 | Cody Lindley
22 | Eduardo Lundgren (eduardolundgren@gmail.com)
23 | Todd Parker
24 | John Resig
25 | Patty Toland
26 | Ca-Phun Ung (yelotofu.com)
27 | Keith Wood (kbwood@virginbroadband.com.au)
28 | Maggie Costello Wachs
29 | Richard D. Worth (rdworth.org)
30 | Jörn Zaefferer (bassistance.de)
31 |
--------------------------------------------------------------------------------
/sky/cube_pass.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 |
8 | void main(void) {
9 | gl_Position = vec4(position, 1.0);
10 | }
11 |
12 | fragment:
13 | uniform vec2 viewport;
14 | uniform mat4 inv_proj;
15 | uniform mat3 inv_view_rot;
16 | uniform samplerCube source;
17 |
18 | vec3 get_world_normal(){
19 | vec2 frag_coord = gl_FragCoord.xy/viewport;
20 | frag_coord = (frag_coord-0.5)*2.0;
21 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
22 | vec3 eye_normal = normalize((inv_proj * device_normal).xyz);
23 | vec3 world_normal = normalize(inv_view_rot*eye_normal);
24 | return world_normal;
25 | }
26 |
27 | void main(void){
28 | vec3 normal = get_world_normal();
29 | vec4 color = textureCube(source, normal);
30 | gl_FragColor = vec4(color.rgb, 1.0);
31 | }
32 |
--------------------------------------------------------------------------------
/shadow/shadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position, normal;
7 | attribute vec2 texcoord;
8 | varying vec3 v_position;
9 | uniform mat4 proj, view;
10 |
11 | void main(void) {
12 | gl_Position = proj * view * vec4(position, 1.0);
13 | v_position = (view * vec4(position, 1.0)).xyz;
14 | }
15 |
16 | fragment:
17 | uniform float near, far;
18 | varying vec3 v_position;
19 |
20 | vec4 pack(){
21 | float depth = (v_position.z - near)/(far-near);
22 | float depth1 = depth*255.0*255.0;
23 | float depth2 = (depth*depth)*255.0*255.0;
24 | return vec4(
25 | mod(depth1, 255.0)/255.0,
26 | floor(depth1/255.0)/255.0,
27 | mod(depth2, 255.0)/255.0,
28 | floor(depth2/255.0)/255.0
29 | );
30 | }
31 |
32 | void main(void){
33 | gl_FragColor = pack();
34 | }
35 |
--------------------------------------------------------------------------------
/mix/mix.js:
--------------------------------------------------------------------------------
1 | mix = {
2 | root: 'mix',
3 | shaders: {
4 | avg: 'avg.shader',
5 | min: 'min.shader',
6 | max: 'max.shader',
7 | top: 'top.shader',
8 | bot: 'bot.shader',
9 | mul: 'mul.shader',
10 | },
11 | init: function(glee, params){
12 | var self = this;
13 |
14 | this.result = new glee.Texture({
15 | width: glee.width,
16 | height: glee.height,
17 | });
18 |
19 | this.processor = new glee.Processor({
20 | fbo: params.fbo,
21 | result: this.result,
22 | shader: this.shaders[$('input[name=combine]:checked').val()],
23 | samplers: {}
24 | });
25 | $('input[name=combine]').change(function(){
26 | self.processor.shader = self.shaders[$(this).val()];
27 | });
28 | },
29 | set_ops: function(op1, op2){
30 | this.processor.samplers.op1 = op1;
31 | this.processor.samplers.op2 = op2;
32 | },
33 | render: function(){
34 | this.processor.render();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/multiply.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 v_texcoord;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | v_texcoord = texcoord;
13 | }
14 |
15 | fragment: depthutil
16 | varying vec2 v_texcoord;
17 | uniform sampler2D source, occlusionmap;
18 | float far = 1.0;
19 | float near = 0.0;
20 |
21 | vec3 decode_normal(vec2 enc)
22 | {
23 | vec2 fenc = enc*4.0-2.0;
24 | float f = dot(fenc,fenc);
25 | float g = sqrt(1.0-f/4.0);
26 | return vec3(fenc*g, 1.0-f/2.0);
27 | }
28 |
29 | float decode_depth(vec2 src){
30 | float depth = src.x/255.0+src.y;
31 | return depth*far+near;
32 | }
33 |
34 | void main(void){
35 | vec3 color = texture2D(source, v_texcoord).rgb;
36 | vec4 occlusion = texture2D(occlusionmap, v_texcoord);
37 | gl_FragColor = vec4(color*occlusion.a, 1.0);
38 | }
39 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Default functionality
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
32 |
33 |
The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider Demos
6 |
7 |
8 |
9 |
10 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button - Default functionality
6 |
7 |
8 |
9 |
10 |
11 |
12 |
18 |
19 |
20 |
21 |
22 |
23 |
A button element
24 |
25 |
26 |
27 |
An anchor
28 |
29 |
30 |
31 |
32 |
33 |
34 |
Examples of the markup that can be used for buttons: A button element, an input of type submit and an anchor.
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/radio.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button - Radios
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
31 |
32 |
33 |
34 |
35 |
A set of three radio buttons transformed into a button set.
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/jquery.ui.slider.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Slider 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Slider#theming
9 | */
10 | .ui-slider { position: relative; text-align: left; }
11 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
12 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
13 |
14 | .ui-slider-horizontal { height: .8em; }
15 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
16 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
17 | .ui-slider-horizontal .ui-slider-range-min { left: 0; }
18 | .ui-slider-horizontal .ui-slider-range-max { right: 0; }
19 |
20 | .ui-slider-vertical { width: .8em; height: 100px; }
21 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
22 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
23 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
24 | .ui-slider-vertical .ui-slider-range-max { top: 0; }
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/jquery.ui.slider.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Slider 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Slider#theming
9 | */
10 | .ui-slider { position: relative; text-align: left; }
11 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
12 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
13 |
14 | .ui-slider-horizontal { height: .8em; }
15 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
16 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
17 | .ui-slider-horizontal .ui-slider-range-min { left: 0; }
18 | .ui-slider-horizontal .ui-slider-range-max { right: 0; }
19 |
20 | .ui-slider-vertical { width: .8em; height: 100px; }
21 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
22 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
23 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
24 | .ui-slider-vertical .ui-slider-range-max { top: 0; }
--------------------------------------------------------------------------------
/normaldepth/normaldepth.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position, normal;
7 | varying vec3 v_normal, v_position;
8 | uniform mat4 proj, view;
9 |
10 | void main(void) {
11 | gl_Position = proj * view * vec4(position, 1.0);
12 | v_normal = normal;
13 | v_position = position;
14 | }
15 |
16 | fragment:
17 | varying vec3 v_normal, v_position;
18 | uniform mat3 view_rot;
19 | uniform mat4 view;
20 | uniform float near, far;
21 |
22 | vec2 encode_normal(vec3 normal)
23 | {
24 | float f = sqrt(8.0*normal.z+8.0);
25 | return normal.xy / f + 0.5;
26 | }
27 |
28 | vec2 encode_depth(vec3 position){
29 | float depth = (length(position)-near)/far;
30 | depth = depth*255.0*255.0;
31 | return vec2(
32 | mod(depth, 255.0)/255.0,
33 | floor(depth/255.0)/255.0
34 | );
35 | }
36 |
37 | void main(void){
38 | vec3 normal = view_rot * normalize(v_normal);
39 | vec3 position = (view * vec4(v_position, 1.0)).xyz;
40 | gl_FragColor = vec4(encode_normal(normal), encode_depth(position));
41 | }
42 |
--------------------------------------------------------------------------------
/util.js:
--------------------------------------------------------------------------------
1 | var handlers = {
2 | /*
3 | error: function(glee, description, info){
4 | console.log(info);
5 | $('canvas.demo').replaceWith($('
').append(description));
6 | census.error(glee, 'ssao', info);
7 | },
8 | capabilities: function(glee, description, webgl){
9 | if(webgl){
10 | census.capabilities(glee, 'irradiance');
11 | }
12 | else{
13 | $('canvas.demo').replaceWith($('
').append(description));
14 | census.nowebgl('ssao');
15 | }
16 | },
17 | */
18 | };
19 |
20 | var slider = function(params){
21 | var row = $('
');
22 | $(' ').appendTo(row).text(params.title);
23 | $('
').slider({
24 | range: params.range,
25 | min: params.min,
26 | max: params.max,
27 | value: params.value,
28 | values: params.values,
29 | step: params.step,
30 | slide: function(event, ui){
31 | params.slide(ui.value);
32 | value_display.text(ui.value);
33 | }
34 | }).appendTo(row);
35 | var value_display = $(' ').appendTo(row).text(params.value);
36 | params.slide(params.value);
37 | return row;
38 | }
39 |
--------------------------------------------------------------------------------
/glee/renderbuffer.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | var gl = glee.gl;
7 |
8 | var DepthBuffer = glee.DepthBuffer = function(params){
9 | this.format = gl.DEPTH_COMPONENT16;
10 | this.id = gl.createRenderbuffer();
11 |
12 | gl.bindRenderbuffer(gl.RENDERBUFFER, this.id);
13 | gl.renderbufferStorage(gl.RENDERBUFFER, this.format, params.width, params.height);
14 | gl.bindRenderbuffer(gl.RENDERBUFFER, null);
15 | };
16 |
17 | var StencilBuffer = glee.StencilBuffer = function(params){
18 | this.format = gl.STENCIL_INDEX8;
19 | this.id = gl.createRenderbuffer();
20 |
21 | gl.bindRenderbuffer(gl.RENDERBUFFER, this.id);
22 | gl.renderbufferStorage(gl.RENDERBUFFER, this.format, params.width, params.height);
23 | gl.bindRenderbuffer(gl.RENDERBUFFER, null);
24 | };
25 |
26 | var DepthStencilBuffer = glee.DepthStencilBuffer = function(params){
27 | this.format = gl.DEPTH_STENCIL;
28 | this.id = gl.createRenderbuffer();
29 |
30 | gl.bindRenderbuffer(gl.RENDERBUFFER, this.id);
31 | gl.renderbufferStorage(gl.RENDERBUFFER, this.format, params.width, params.height);
32 | gl.bindRenderbuffer(gl.RENDERBUFFER, null);
33 | };
34 | });
35 |
--------------------------------------------------------------------------------
/glee/picks.js:
--------------------------------------------------------------------------------
1 | Glee.prototype.random_picks = function(N){
2 | var picks = [];
3 | for(var i=0; i 0.0){
27 | picks.push(Math.cos(phi)*r, y, Math.sin(phi)*r);
28 | }
29 | }
30 | return picks;
31 | }
32 |
33 | Glee.prototype.kernel_picks = function(size, step){
34 | var kernel = [];
35 | var size = size || 2;
36 | var step = step || Math.PI/8;
37 | for(var a=-size; a<=size; a++){
38 | for(var b=-size; b<=size; b++){
39 | var x = Math.sin(a*step);
40 | var z0 = Math.cos(a*step);
41 | var y = Math.sin(b*step)*z0;
42 | var z = Math.cos(b*step)*z0;
43 | kernel.push(x, y, z);
44 | }
45 | }
46 | return kernel;
47 | }
48 |
--------------------------------------------------------------------------------
/sky/downsample.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 |
8 | void main(void) {
9 | gl_Position = vec4(position, 1.0);
10 | }
11 |
12 | fragment:
13 | uniform vec2 viewport;
14 | uniform mat4 inv_proj;
15 | uniform mat3 inv_view_rot;
16 | uniform samplerCube source;
17 |
18 | vec3 get_world_normal(vec2 pos, vec2 dims){
19 | vec2 frag_coord = pos/dims;
20 | frag_coord = (frag_coord-0.5)*2.0;
21 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
22 | vec3 eye_normal = normalize((inv_proj * device_normal).xyz);
23 | vec3 world_normal = normalize(inv_view_rot*eye_normal);
24 | return world_normal;
25 | }
26 |
27 | vec3 sample(float xoff, float yoff){
28 | vec2 off = gl_FragCoord.xy*2.0+vec2(xoff, yoff);
29 | vec3 normal = get_world_normal(off, viewport*2.0);
30 | vec4 src = textureCube(source, normal);
31 | return src.rgb*pow(src.a*16.0, 2.0);
32 | }
33 |
34 | void main(void){
35 | vec3 color = (
36 | sample(-0.5, -0.5) +
37 | sample(-0.5, +0.5) +
38 | sample(+0.5, -0.5) +
39 | sample(+0.5, +0.5)
40 | ) * 0.25;
41 | gl_FragColor = vec4(normalize(color), sqrt(length(color))/16.0);
42 | }
43 |
--------------------------------------------------------------------------------
/jquery/development-bundle/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Paul Bakaus, http://jqueryui.com/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
5 | contribution history, see the revision history and logs, available
6 | at http://jquery-ui.googlecode.com/svn/
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the
10 | "Software"), to deal in the Software without restriction, including
11 | without limitation the rights to use, copy, modify, merge, publish,
12 | distribute, sublicense, and/or sell copies of the Software, and to
13 | permit persons to whom the Software is furnished to do so, subject to
14 | the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be
17 | included in all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/splitbutton.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button - Split button
6 |
7 |
8 |
9 |
10 |
11 |
12 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | Run last action
43 | Select an action
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
An example of a split button built with two buttons: A plan button with just text, one with only a primary icon and no text. Both are grouped together in a set.
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/checkbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button - Checkboxes
6 |
7 |
8 |
9 |
10 |
11 |
12 |
18 |
21 |
22 |
23 |
24 |
35 |
36 |
37 |
38 |
39 |
A checkbox is styled as a toggle button with the button widget. The label element associated with the checkbox is used for the button text.
40 |
This demo also demonstrates three checkboxes styled as a button set by calling .buttonset() on a common container.
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/rangemax.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Range with fixed maximum
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Minimum number of bedrooms:
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
Fix the maximum value of the range slider so that the user can only select a minimum. Set the range option to "max."
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/rangemin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Range with fixed minimum
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Maximum price:
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
Fix the minimum value of the range slider so that the user can only select a maximum. Set the range option to "min."
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/steps.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Snap to increments
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Donation amount ($50 increments):
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
Increment slider values with the step option set to an integer, commonly a dividend of the slider's maximum value. The default increment is 1.
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/jquery.ui.core.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI CSS Framework 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Theming/API
9 | */
10 |
11 | /* Layout helpers
12 | ----------------------------------*/
13 | .ui-helper-hidden { display: none; }
14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17 | .ui-helper-clearfix { display: inline-block; }
18 | /* required comment for clearfix to work in Opera \*/
19 | * html .ui-helper-clearfix { height:1%; }
20 | .ui-helper-clearfix { display:block; }
21 | /* end clearfix */
22 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23 |
24 |
25 | /* Interaction Cues
26 | ----------------------------------*/
27 | .ui-state-disabled { cursor: default !important; }
28 |
29 |
30 | /* Icons
31 | ----------------------------------*/
32 |
33 | /* states and images */
34 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35 |
36 |
37 | /* Misc visuals
38 | ----------------------------------*/
39 |
40 | /* Overlays */
41 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 |
6 | $(function(){
7 | var canvas = $('canvas')[0];
8 | var glee = new Glee(canvas, handlers).load({
9 | graph: graph,
10 | onload: function(gl){
11 | var self = this;
12 |
13 | glee.resize(canvas.width, canvas.height);
14 |
15 | var statistic = new Statistic();
16 |
17 | var cube = new glee.Cube(0.15);
18 | var sphere = new glee.Sphere(1.0);
19 |
20 | var keys = new glee.Keys();
21 | var view = new glee.Viewpoint({
22 | position: new glee.Vec3(0.0, 5.0, 2.0),
23 | keys: keys,
24 | speed: 0.2,
25 | });
26 |
27 | var proj = new glee.Perspective({
28 | width: canvas.width,
29 | height: canvas.height,
30 | fov: 75,
31 | near: 0.001,
32 | far: 40,
33 | });
34 |
35 | this.graph.init(glee, {
36 | view: view,
37 | proj: proj,
38 | });
39 |
40 | glee.schedule(function(delta, current){
41 | view.step(delta);
42 | self.graph.render();
43 | glee.gl.finish();
44 |
45 | var now = (new Date()).getTime();
46 | var render_time = now - current;
47 | statistic.tick(render_time);
48 | //statistic.tick(delta*1000);
49 | });
50 | }
51 | });
52 | });
53 |
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/jquery.ui.core.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI CSS Framework 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Theming/API
9 | */
10 |
11 | /* Layout helpers
12 | ----------------------------------*/
13 | .ui-helper-hidden { display: none; }
14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17 | .ui-helper-clearfix { display: inline-block; }
18 | /* required comment for clearfix to work in Opera \*/
19 | * html .ui-helper-clearfix { height:1%; }
20 | .ui-helper-clearfix { display:block; }
21 | /* end clearfix */
22 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23 |
24 |
25 | /* Interaction Cues
26 | ----------------------------------*/
27 | .ui-state-disabled { cursor: default !important; }
28 |
29 |
30 | /* Icons
31 | ----------------------------------*/
32 |
33 | /* states and images */
34 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35 |
36 |
37 | /* Misc visuals
38 | ----------------------------------*/
39 |
40 | /* Overlays */
41 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/slider-vertical.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Vertical slider
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Volume:
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
Change the orientation of the slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to "vertical."
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/shadow/shadow.js:
--------------------------------------------------------------------------------
1 | shadow = {
2 | root: 'shadow',
3 | shader: 'shadow.shader',
4 | init: function(glee, params){
5 | var self = this;
6 | this.sky = params.sky;
7 |
8 | var size = 50;
9 | var proj = this.proj = new glee.Ortho({
10 | left: size/2,
11 | right: -size/2,
12 | top: -size/2,
13 | bottom: size/2,
14 | near: -30,
15 | far: 30,
16 | });
17 |
18 | var view = this.view = new glee.Mat4();
19 |
20 | var width = 4092;
21 | var height = 4092;
22 |
23 | this.result = new glee.Texture({
24 | width: width,
25 | height: height,
26 | //filter: glee.gl.NEAREST,
27 | });
28 |
29 | this.processor = new glee.Processor({
30 | result: this.result,
31 | fbo: params.fbo,
32 | clear: {
33 | color: [0,0,0,1],
34 | depth: 1,
35 | },
36 | shader: this.shader,
37 | uniforms: {
38 | view: view,
39 | proj: proj.matrix,
40 | near: proj.near,
41 | far: proj.far,
42 | },
43 | draw: function(){
44 | params.scene.city.draw();
45 | },
46 | depth: {
47 | test: 'Less',
48 | write: true,
49 | },
50 | depthstencil: new glee.DepthStencilBuffer({width: width, height: height})
51 | });
52 | },
53 | render: function(){
54 | this.view.ident().rotatex(this.sky.elevation+90).rotatey(this.sky.orientation);
55 | this.processor.render();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/range.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Range slider
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Price range:
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
Set the range option to true to capture a range of values with two drag handles. The space between the handles is filled with a different background color to indicate those values are selected.
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/icons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button - Icons
6 |
7 |
8 |
9 |
10 |
11 |
12 |
37 |
38 |
39 |
40 |
41 |
42 | Button with icon only
43 | Button with icon on the left
44 | Button with two icons
45 | Button with two icons and no text
46 |
47 |
48 |
49 |
50 |
51 |
52 |
Some buttons with various combinations of text and icons, here specified via metadata.
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/range-vertical.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Vertical range slider
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Target sales goal (Millions):
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
Change the orientation of the range slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to "vertical."
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/hotelrooms.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Range with fixed minimum
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
33 |
34 |
35 |
36 |
37 |
38 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
How to bind a slider to an existing select element. The select stays visible to display the change. When the select is changed, the slider is updated, too.
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/jquery/development-bundle/external/jquery.bgiframe-2.1.2.js:
--------------------------------------------------------------------------------
1 | /*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
2 | * Licensed under the MIT License (LICENSE.txt).
3 | *
4 | * Version 2.1.2
5 | */
6 |
7 | (function($){
8 |
9 | $.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
10 | s = $.extend({
11 | top : 'auto', // auto == .currentStyle.borderTopWidth
12 | left : 'auto', // auto == .currentStyle.borderLeftWidth
13 | width : 'auto', // auto == offsetWidth
14 | height : 'auto', // auto == offsetHeight
15 | opacity : true,
16 | src : 'javascript:false;'
17 | }, s);
18 | var html = '';
26 | return this.each(function() {
27 | if ( $(this).children('iframe.bgiframe').length === 0 )
28 | this.insertBefore( document.createElement(html), this.firstChild );
29 | });
30 | } : function() { return this; });
31 |
32 | // old alias
33 | $.fn.bgIframe = $.fn.bgiframe;
34 |
35 | function prop(n) {
36 | return n && n.constructor === Number ? n + 'px' : n;
37 | }
38 |
39 | })(jQuery);
--------------------------------------------------------------------------------
/$:
--------------------------------------------------------------------------------
1 | scene = {
2 | root: 'scene',
3 | simple: 'simple.shader',
4 | city: 'city.vbo',
5 | //city: 'cityscape.vbo',
6 | init: function(glee, params){
7 | var self = this;
8 |
9 | this.sky = params.sky;
10 |
11 | var samples = [];
12 | while(samples.length < 16){
13 | var x = (Math.random()-0.5)*2.0;
14 | var y = (Math.random()-0.5)*2.0;
15 | var z = (Math.random()-0.5)*2.0;
16 | var l = Math.sqrt(x*x+y*y+z*z);
17 | if(l < 1.0 && l > 0.1){
18 | samples.push(x, y, z);
19 | }
20 | }
21 |
22 | this.processor = new glee.Processor({
23 | clear: {
24 | depth: 1,
25 | },
26 | shader: this.simple,
27 | uniforms: {
28 | view: params.view.matrix,
29 | view_rot: params.view.rot,
30 | proj: params.proj.matrix,
31 | lightdir: new glee.Vec3(0.5, 1.0, 0.2).normalize(),
32 | near: params.proj.near,
33 | far: params.proj.far,
34 | shadow_near: params.shadow.proj.near,
35 | shadow_far: params.shadow.proj.far,
36 | shadow_view: shadow.view,
37 | shadow_proj: params.shadow.proj.matrix,
38 | },
39 | uniform3f: {
40 | samples: samples,
41 | },
42 | samplers: {
43 | diffuse: params.sky.diffuse.result,
44 | occlusionmap: params.occlusion,
45 | shadowmap: params.shadow.result,
46 | },
47 | draw: function(){
48 | self.city.draw();
49 | },
50 | depth: {
51 | test: 'Less',
52 | write: true,
53 | }
54 | });
55 | },
56 | set_occlusion: function(occlusion){
57 | this.processor.samplers.occlusionmap = occlusion;
58 | },
59 | render: function(){
60 | this.processor.render();
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/glee/plane.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | glee.Plane = function(params){
7 | var size = params.size;
8 | var scale = params.scale;
9 | var factor = (1.0/size)*scale;
10 | var half_scale = scale/2;
11 |
12 | var vertices = [];
13 | var texcoords = [];
14 | var normals = [];
15 |
16 | for(var x=0; x.
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | uniform sampler2D source, normaldepth;
17 | uniform float distance_factor, depth_power;
18 | uniform float normal_factor, normal_power;
19 | uniform vec2 viewport, axis;
20 | varying vec2 uv;
21 |
22 | /*
23 | float sample_depth(vec2 uv){
24 | vec2 src = texture2D(normaldepth, uv).zw;
25 | float depth = src.x/255.0+src.y;
26 | return pow(depth, depth_power);
27 | }
28 | */
29 |
30 | vec4 sample(vec2 uv){
31 | return texture2D(source, uv);
32 | }
33 |
34 | vec3 decode_normal(vec4 data){
35 | vec2 enc = data.xy;
36 | vec2 fenc = enc*4.0-2.0;
37 | float f = dot(fenc,fenc);
38 | float g = sqrt(1.0-f/4.0);
39 | return normalize(vec3(fenc*g, 1.0-f/2.0));
40 | }
41 |
42 | float decode_depth(vec4 data){
43 | vec2 src = data.zw;
44 | float depth = src.x/255.0+src.y;
45 | return depth;
46 | }
47 |
48 | vec4 sample_normaldepth(vec2 uv){
49 | vec4 data = texture2D(normaldepth, uv);
50 | return vec4(decode_normal(data), decode_depth(data));
51 | }
52 |
53 | void main(void){
54 | vec2 off = (axis*1.0)/viewport;
55 |
56 | vec4 da = sample_normaldepth(uv);
57 | vec4 db = sample_normaldepth(uv+off);
58 | vec4 dc = sample_normaldepth(uv-off);
59 |
60 | float fdb = 1.0-smoothstep(0.0, 1.0, distance_factor*abs(db.w-da.w));
61 | float fdc = 1.0-smoothstep(0.0, 1.0, distance_factor*abs(dc.w-da.w));
62 | float fnb = max(0.0, pow(dot(da.xyz, db.xyz)*normal_factor, normal_power));
63 | float fnc = max(0.0, pow(dot(da.xyz, dc.xyz)*normal_factor, normal_power));
64 |
65 | vec4 a = sample(uv);
66 | vec4 b = sample(uv+off)*1.0*fdb*fnb;
67 | vec4 c = sample(uv-off)*1.0*fdc*fnc;
68 | vec4 result = a+b+c;
69 | result /= (1.0 + 1.0*fdb*fnb + 1.0*fdc*fnc);
70 | gl_FragColor = result;
71 | }
72 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/multiple-vertical.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Multiple sliders
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Master volume
49 |
50 |
51 |
52 |
53 |
54 |
55 | Graphic EQ
56 |
57 |
58 |
59 | 88
60 | 77
61 | 55
62 | 33
63 | 40
64 | 45
65 | 70
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
Combine horizontal and vertical sliders, each with their own options, to create the UI for a music player.
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/glee/model.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | var gl = glee.gl;
7 |
8 | var dirname_re = /(.+)\/[^\/]+\.model$/
9 |
10 | glee.Model = function(path, nodes, onprogress){
11 | var dirname = path.match(dirname_re)[1];
12 | var self = this;
13 | this.texture_count = 0;
14 | var drawables = [];
15 |
16 | var total = {};
17 | var pos3f = total.position_3f = [];
18 | var norm3f = total.normal_3f = [];
19 | var tex2f = total.texcoord_2f = [];
20 |
21 | Glee.each(nodes, function(i, node){
22 | var drawable = {samplers: {}};
23 | Glee.each(node.samplers, function(name, filename){
24 | this.texture_count += 1;
25 | var image = new Image();
26 | var filepath = dirname + '/' + filename;
27 | image.onload = function(){
28 | drawable.samplers[name] = new glee.Texture({image: image}).repeat().mipmap();
29 | onprogress(filepath);
30 | };
31 | image.src = filepath;
32 | });
33 | drawable.vbo = new glee.VBO(node.vbo);
34 | pos3f = pos3f.concat(node.vbo.position_3f);
35 | norm3f = norm3f.concat(node.vbo.normal_3f);
36 | tex2f = tex2f.concat(node.vbo.texcoord_2f);
37 | drawables.push(drawable);
38 | });
39 | this.vbo = new glee.VBO({
40 | position_3f: pos3f,
41 | normal_3f: norm3f,
42 | texcoord_2f: tex2f
43 | });
44 | this.nodes = drawables;
45 | };
46 |
47 | glee.Model.prototype = {
48 | draw: function(){
49 | var current_shader = glee.Shader.current;
50 | var last_unit = current_shader.last_unit;
51 | for(var i=0; i.
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 |
8 | void main(void) {
9 | gl_Position = vec4(position, 1.0);
10 | }
11 |
12 | fragment:
13 | uniform samplerCube source;
14 | uniform vec2 viewport;
15 | uniform mat4 inv_proj;
16 | uniform mat3 inv_view_rot;
17 | uniform float specularity;
18 |
19 | const vec3 x = vec3(1.0, 0.0, 0.0);
20 | const vec3 y = vec3(0.0, 1.0, 0.0);
21 | const vec3 z = vec3(0.0, 0.0, 1.0);
22 |
23 | const mat3 front = mat3(x, y, z);
24 | const mat3 back = mat3(x, y, -z);
25 | const mat3 right = mat3(z, y, x);
26 | const mat3 left = mat3(z, y, -x);
27 | const mat3 top = mat3(x, z, y);
28 | const mat3 bottom = mat3(x, z, -y);
29 |
30 | const float size = 16.0;
31 | const float start = ((0.5/size)-0.5)*2.0;
32 | const float end = -start;
33 | const float incr = 2.0/size;
34 |
35 | vec3 get_eye_normal(){
36 | vec2 frag_coord = gl_FragCoord.xy/viewport;
37 | frag_coord = (frag_coord-0.5)*2.0;
38 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
39 | vec3 eye_normal = normalize((inv_proj * device_normal).xyz);
40 | vec3 world_normal = normalize(inv_view_rot*eye_normal);
41 | return world_normal;
42 | }
43 |
44 | vec4 sample(mat3 side, vec3 eyedir, vec3 base_ray){
45 | vec3 ray = side*base_ray;
46 | float lambert = max(0.0, dot(ray, eyedir));
47 | float term = pow(lambert, specularity)*base_ray.z;
48 | vec4 src = textureCube(source, ray);
49 | return vec4(src.rgb*pow(src.a*16.0, 2.0)*term, term);
50 | }
51 |
52 | void main(){
53 | vec4 result = vec4(0.0);
54 | vec3 eyedir = get_eye_normal(), ray;
55 |
56 | for(float xi=start; xi<=end; xi+=incr){
57 | for(float yi=start; yi<=end; yi+=incr){
58 | ray = normalize((inv_proj * vec4(xi, yi, 0.0, 1.0)).xyz);
59 | result += sample(front, eyedir, ray);
60 | result += sample(back, eyedir, ray);
61 | result += sample(top, eyedir, ray);
62 | result += sample(bottom, eyedir, ray);
63 | result += sample(left, eyedir, ray);
64 | result += sample(right, eyedir, ray);
65 | }
66 | }
67 | result /= result.w;
68 | gl_FragColor = vec4(pow(result.rgb, vec3(1.0/2.2)), 1.0);
69 | }
70 |
--------------------------------------------------------------------------------
/census.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 |
6 | var census = {
7 | error: function(glee, app, info){
8 | var caps = this.get_info(glee);
9 | var user = this.get_user();
10 | var message = {
11 | webgl: true,
12 | error: info,
13 | caps: caps,
14 | }
15 | this.send(app, 'error', message);
16 | },
17 | capabilities: function(glee, app){
18 | var caps = this.get_info(glee);
19 | var user = this.get_user();
20 | var message = {
21 | webgl: true,
22 | caps: caps,
23 | };
24 | this.send(app, 'capabilities', message);
25 | },
26 | nowebgl: function(app){
27 | var user = this.get_user();
28 | var message = {
29 | webgl: false,
30 | };
31 | this.send(app, 'capabilities', message);
32 | },
33 | send: function(app, type, message){
34 | message.app = app;
35 | message.user = this.get_user();
36 | $.ajax({
37 | contentType: 'text/plain',
38 | data: JSON.stringify(message),
39 | type: 'POST',
40 | url: '/webgl_report/' + type,
41 | });
42 | },
43 | get_user: function(){
44 | var user = $.cookie('user');
45 | if(!user){
46 | var user = '';
47 | var chars = 'abcdef0123456789'
48 | for(var i=0; i<32; i++){
49 | var index = Math.floor(Math.random()*chars.length);
50 | user += chars.charAt(index);
51 | }
52 | $.cookie('user', user, {expires: 365*10, path:'/'});
53 | }
54 | return user;
55 | },
56 | get_info: function(glee){
57 | var info = {};
58 | info.extensions = glee.gl.getSupportedExtensions();
59 | $.each([
60 | 'VENDOR',
61 | 'VERSION',
62 | 'RENDERER',
63 | 'MAX_VERTEX_TEXTURE_IMAGE_UNITS',
64 | 'MAX_TEXTURE_IMAGE_UNITS',
65 | 'MAX_COMBINED_TEXTURE_IMAGE_UNITS',
66 | 'MAX_CUBE_MAP_TEXTURE_SIZE',
67 | 'MAX_RENDERBUFFER_SIZE',
68 | 'MAX_TEXTURE_SIZE',
69 | 'MAX_VARYING_VECTORS',
70 | 'MAX_VERTEX_ATTRIBS',
71 | 'MAX_TEXTURE_IMAGE_UNITS',
72 | 'MAX_VERTEX_UNIFORM_VECTORS',
73 | 'MAX_VIEWPORT_DIMS'
74 | ], function(i, name){
75 | info[name] = glee.get(name);
76 | });
77 | return info;
78 | },
79 | }
80 |
81 |
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/base/jquery.ui.button.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Button 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Button#theming
9 | */
10 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
11 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
12 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
13 | .ui-button-icons-only { width: 3.4em; }
14 | button.ui-button-icons-only { width: 3.7em; }
15 |
16 | /*button text element */
17 | .ui-button .ui-button-text { display: block; line-height: 1.4; }
18 | .ui-button-text-only .ui-button-text { padding: .4em 1em; }
19 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
20 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
21 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
22 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
23 | /* no icon support for input elements, provide padding by default */
24 | input.ui-button { padding: .4em 1em; }
25 |
26 | /*button icon element(s) */
27 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
28 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
29 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
30 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
31 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
32 |
33 | /*button sets*/
34 | .ui-buttonset { margin-right: 7px; }
35 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
36 |
37 | /* workarounds */
38 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
39 |
--------------------------------------------------------------------------------
/jquery/development-bundle/themes/ui-darkness/jquery.ui.button.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Button 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Button#theming
9 | */
10 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
11 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
12 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
13 | .ui-button-icons-only { width: 3.4em; }
14 | button.ui-button-icons-only { width: 3.7em; }
15 |
16 | /*button text element */
17 | .ui-button .ui-button-text { display: block; line-height: 1.4; }
18 | .ui-button-text-only .ui-button-text { padding: .4em 1em; }
19 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
20 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
21 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
22 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
23 | /* no icon support for input elements, provide padding by default */
24 | input.ui-button { padding: .4em 1em; }
25 |
26 | /*button icon element(s) */
27 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
28 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
29 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
30 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
31 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
32 |
33 | /*button sets*/
34 | .ui-buttonset { margin-right: 7px; }
35 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
36 |
37 | /* workarounds */
38 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
39 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 |
6 | canvas, div{
7 | padding: 0px;
8 | margin: 0px;
9 | }
10 |
11 | html, body{
12 | margin: 0px;
13 | padding: 0px;
14 | padding-top: 10px;
15 | font-family: sans-serif;
16 | color: #ddd;
17 | font-size: 11px;
18 | background-color: #111;
19 | }
20 |
21 | canvas{
22 | background-color: #ddd;
23 | }
24 |
25 | div.error{
26 | width: 480px;
27 | height: 480px;
28 | padding: 10px;
29 | background-color: #ddd;
30 | color: black;
31 | }
32 |
33 | td{
34 | vertical-align: middle;
35 | text-align: center;
36 | }
37 |
38 | /*
39 | div.node{
40 | border-width: 12px 12px 12px 12px;
41 | border-image: url("node_bg.png") 12 12 12 12 stretch stretch;
42 | -webkit-border-image: url("node_bg.png") 12 12 12 12 stretch stretch;
43 | -moz-border-image: url("node_bg.png") 12 12 12 12 stretch stretch;
44 | }
45 | */
46 |
47 | table{
48 | margin-left: auto;
49 | margin-right: auto;
50 | }
51 |
52 | div.tree{
53 | width: 1019px;
54 | height: 280px;
55 | text-align: center;
56 | padding-top: 20px;
57 | padding-bottom: 20px;
58 | padding-left: 5px;
59 | font-weight: bold;
60 | background-image: url("panel_bg.png");
61 | background-repeat: repeat-x;
62 | }
63 |
64 | div.content{
65 | width: 1374px;
66 | margin-left: auto;
67 | margin-right: auto;
68 | }
69 |
70 | div.left{
71 | float: left;
72 | width: 1024px;
73 | }
74 |
75 | div.right{
76 | float: right;
77 | width: 350px;
78 | background-color: #333;
79 | height: 964px;
80 | }
81 |
82 | #status{
83 | text-align: center;
84 | background-color: #555;
85 | padding-top: 5px;
86 | }
87 |
88 | canvas.graph{
89 | border: 1px solid black;
90 | }
91 |
92 | h1{
93 | padding: 0px;
94 | margin: 0px;
95 | padding-bottom: 5px;
96 |
97 | font-size: 16px;
98 | text-align: center;
99 | text-shadow: #111 1px 1px 4px;
100 | }
101 |
102 | #gauge{
103 | display: inline-block;
104 | width: 120px;
105 | height: 120px;
106 | text-align: center;
107 | }
108 |
109 | #properties{
110 | padding: 10px;
111 | }
112 |
113 | div.hslider{
114 | width: 150px;
115 | font-size: 8px;
116 | display: inline-block;
117 | }
118 |
119 | div.field{
120 | padding-top: 5px;
121 | }
122 |
123 | div.field label.desc{
124 | display: inline-block;
125 | font-size: 14px;
126 | width: 100px;
127 | text-shadow: #111 1px 1px 4px;
128 | }
129 |
--------------------------------------------------------------------------------
/statistic.js:
--------------------------------------------------------------------------------
1 | var Statistic = function(){
2 | this.timings = [];
3 | this.series = [];
4 | for(var i=0; i<150; i++){
5 | this.series.push(0);
6 | }
7 | var self = this;
8 |
9 | /*
10 | this.data = new google.visualization.DataTable();
11 | this.data.addColumn('string', 'Label');
12 | this.data.addColumn('number', 'Value');
13 | this.data.addRows(1);
14 | this.data.setValue(0,0, 'Millisec.');
15 | this.data.setValue(0,1, 0);
16 |
17 | this.chart = new google.visualization.Gauge($('#gauge')[0]);
18 | this.options = {
19 | minorTicks: 5,
20 | majorTicks: 10,
21 | min: 0,
22 | max: 100,
23 |
24 | greenColor: '#d4ff2a',
25 | greenFrom: 0,
26 | greenTo: 16,
27 | yellowColor: '#ffd42a',
28 | yellowFrom: 16,
29 | yellowTo: 33,
30 | redColor: '#ff4c1e',
31 | redFrom: 33,
32 | redTo: 100,
33 | };
34 | this.chart.draw(this.data, this.options);
35 | */
36 |
37 | this.ctx = $('canvas.graph')[0].getContext('2d');
38 | this.gradient = this.ctx.createLinearGradient(0,0,0,120);
39 | this.gradient.addColorStop(0, '#ff4c1e');
40 | this.gradient.addColorStop((100-33)/100, '#ff4c1e');
41 | this.gradient.addColorStop((100-33)/100, '#ffd42a');
42 | this.gradient.addColorStop((100-16)/100, '#ffd42a');
43 | this.gradient.addColorStop((100-16)/100, '#d4ff2a');
44 | this.gradient.addColorStop(1, '#d4ff2a');
45 |
46 | setInterval(function(){
47 | self.update();
48 | }, 200);
49 | };
50 |
51 | Statistic.prototype = {
52 | tick: function(delta){
53 | this.timings.push(delta);
54 | if(this.timings.length > 10){
55 | this.timings.shift();
56 | }
57 | },
58 | update: function(){
59 | var result = 0.0;
60 | for(var i=0; i=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
17 | if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
18 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/colorpicker.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Colorpicker
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
35 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | Simple Colorpicker
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
Combine three sliders to create a simple RGB colorpicker.
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/glee/vector.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | (function(){
6 | var fmt = function(value){
7 | var str = value.toFixed(4);
8 | while(str.length < 7){
9 | str = ' ' + str;
10 | }
11 | return str;
12 | }
13 |
14 | var Vec3 = Glee.prototype.Vec3 = function(x, y, z){
15 | this.x = x === undefined ? 0 : x
16 | this.y = y === undefined ? 0 : y
17 | this.z = z === undefined ? 0 : z
18 | };
19 |
20 | Vec3.prototype = {
21 | type: 'Vec3',
22 | normalize: function(){
23 | var length = Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);
24 | if(length != 0){
25 | this.x /= length;
26 | this.y /= length;
27 | this.z /= length;
28 | }
29 | return this;
30 | },
31 | log: function(message){
32 | if(!message){
33 | var message = 'Vec3';
34 | }
35 | console.log('%s: %s %s %s', message, fmt(this.x), fmt(this.y), fmt(this.z));
36 | return this;
37 | },
38 | mul: function(value){
39 | if(value.type == 'Vec3'){
40 | this.x *= value.x;
41 | this.y *= value.y;
42 | this.z *= value.z;
43 | }
44 | else if(value.type == 'Mat3'){
45 | this.set(
46 | value.data[0]*this.x + value.data[1]*this.y + value.data[2]*this.z,
47 | value.data[3]*this.x + value.data[4]*this.y + value.data[5]*this.z,
48 | value.data[6]*this.x + value.data[7]*this.y + value.data[8]*this.z
49 | )
50 | }
51 | else{
52 | this.x *= value;
53 | this.y *= value;
54 | this.z *= value;
55 | }
56 | return this;
57 | },
58 | sub: function(value){
59 | if(value.type == 'Vec3'){
60 | this.x -= value.x;
61 | this.y -= value.y;
62 | this.z -= value.z;
63 | }
64 | else{
65 | this.x -= value;
66 | this.y -= value;
67 | this.z -= value;
68 | }
69 | return this;
70 | },
71 | add: function(value){
72 | if(value.type == 'Vec3'){
73 | this.x += value.x;
74 | this.y += value.y;
75 | this.z += value.z;
76 | }
77 | else{
78 | this.x += value;
79 | this.y += value;
80 | this.z += value;
81 | }
82 | return this;
83 | },
84 | update: function(other){
85 | this.x = other.x;
86 | this.y = other.y;
87 | this.z = other.z;
88 | return this;
89 | },
90 | set: function(x, y, z){
91 | this.x = x;
92 | this.y = y;
93 | this.z = z;
94 | return this;
95 | }
96 | };
97 | })();
98 |
--------------------------------------------------------------------------------
/jquery/development-bundle/ui/minified/jquery.ui.widget.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery UI Widget 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Widget
9 | */
10 | (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
11 | a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
12 | e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
13 | this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
14 | widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
15 | enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
16 |
--------------------------------------------------------------------------------
/scene/scene.js:
--------------------------------------------------------------------------------
1 | scene = {
2 | root: 'scene',
3 | simple: 'simple.shader',
4 | //city: 'city.vbo',
5 | //city: 'city2.vbo',
6 | //city: 'city3.vbo',
7 | city_model: 'city/city.model',
8 | init: function(glee, params){
9 | this.city = this.city_model.vbo;
10 | var self = this;
11 | var gl = glee.gl;
12 |
13 | this.sky = params.sky;
14 |
15 | var samples = [];
16 | while(samples.length < 16){
17 | var x = (Math.random()-0.5)*2.0;
18 | var y = (Math.random()-0.5)*2.0;
19 | var z = (Math.random()-0.5)*2.0;
20 | var l = Math.sqrt(x*x+y*y+z*z);
21 | if(l < 1.0 && l > 0.1){
22 | samples.push(x, y, z);
23 | }
24 | }
25 |
26 | this.result = new glee.Texture();
27 |
28 | this.processor = new glee.Processor({
29 | fbo: params.fbo,
30 | result: this.result,
31 | clear: {
32 | color: [0, 0, 0, 1],
33 | depth: 1,
34 | stencil: 1
35 | },
36 | shader: this.simple,
37 | uniforms: {
38 | view: params.view.matrix,
39 | view_rot: params.view.rot,
40 | inv_view_rot: params.view.inv_rot,
41 | proj: params.proj.matrix,
42 | inv_proj: params.proj.inverse,
43 | lightdir: params.sky.lightdir,
44 | near: params.proj.near,
45 | far: params.proj.far,
46 | shadow_near: params.shadow.proj.near,
47 | shadow_far: params.shadow.proj.far,
48 | shadow_view: shadow.view,
49 | shadow_proj: params.shadow.proj.matrix,
50 | },
51 | uniform3f: {
52 | samples: samples,
53 | },
54 | samplers: {
55 | diffuse_sun: params.sky.diffuse_sun.result,
56 | diffuse_env: params.sky.diffuse_env.result,
57 | specular_sun: params.sky.specular_sun.result,
58 | specular_env: params.sky.specular_env.result,
59 | shadowmap: params.shadow.result,
60 | },
61 | draw: function(){
62 | gl.clearColor(0, 0, 0, 1);
63 | gl.clearDepth(0);
64 | gl.clearStencil(0);
65 | glee.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
66 | //self.city.draw();
67 | self.city_model.draw();
68 | },
69 | depth: {
70 | test: 'Less',
71 | write: true,
72 | },
73 | stencil: {
74 | test: true,
75 | mask: 255,
76 | func: {
77 | test: gl.ALWAYS,
78 | ref: 0,
79 | mask: 255
80 | },
81 | op: {
82 | fail: gl.REPLACE,
83 | depth_fail: gl.REPLACE,
84 | pass: gl.REPLACE
85 | }
86 | },
87 | depthstencil: params.depthstencil,
88 | });
89 | },
90 | render: function(){
91 | this.processor.render();
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/button/toolbar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Button - Toolbar
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
86 |
87 |
88 |
89 |
90 |
91 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | A mediaplayer toolbar. Take a look at the underlying markup: A few button elements,
115 | an input of type checkbox for the Shuffle button, and three inputs of type radio for the Repeat options.
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/ssao/gp1.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | #define sample_count 16
17 | #define pattern_size 4.0
18 |
19 | uniform sampler2D normaldepth, random_field;
20 |
21 | uniform float radius, near, far, random_size;
22 | uniform float depth_bias, singularity, strength;
23 |
24 | uniform vec2 viewport;
25 | uniform vec3 samples[sample_count];
26 | uniform mat4 proj, inv_proj;
27 | uniform mat3 inv_rot;
28 | varying vec2 uv;
29 |
30 | vec3 decode_normal(vec2 enc){
31 | vec2 fenc = enc*4.0-2.0;
32 | float f = dot(fenc,fenc);
33 | float g = sqrt(1.0-f/4.0);
34 | return normalize(vec3(fenc*g, 1.0-f/2.0));
35 | }
36 |
37 | float decode_depth(vec2 src){
38 | float depth = src.x/255.0+src.y;
39 | return depth*far+near;
40 | }
41 |
42 | vec2 get_uv(vec3 pos){
43 | vec4 device = proj * vec4(pos, 1.0);
44 | vec4 device_norm = device/device.w;
45 | return (device_norm.xy+1.0)*0.5;
46 | }
47 |
48 | vec3 get_vec(vec2 uv){
49 | vec2 device = (uv*2.0)-1.0;
50 | return normalize((inv_proj * vec4(device.xy, -1.0, 1.0)).xyz);
51 | }
52 |
53 | vec3 getsample(int i){
54 | vec2 mod_coord = mod(floor(gl_FragCoord.xy), pattern_size);
55 | float y = ((mod_coord.x + mod_coord.y*pattern_size)+0.5) / (pattern_size*pattern_size);
56 | float x = (float(i)+0.5)/float(sample_count);
57 | return (texture2D(random_field, vec2(x, y)).xyz-0.5)*2.0;
58 | }
59 |
60 | void main(void){
61 | vec3 eye_ray = get_vec(uv);
62 | vec4 eye_data = texture2D(normaldepth, uv);
63 | vec3 eye_normal = decode_normal(eye_data.xy);
64 | float eye_depth = decode_depth(eye_data.zw);
65 | vec3 eye_pos = eye_depth * eye_ray;
66 |
67 | float occlusion = 0.0;
68 |
69 | for(int i=0; i sample_pos.z ? 1.0 : 0.0;
86 | float dist_term = diff < singularity ? 1.0 : 0.0;
87 | float lambert = dot(normalize(sample_offset), eye_normal);
88 | occlusion += lambert*dist_term*occluded*strength;
89 | }
90 |
91 | occlusion = clamp(occlusion/float(sample_count), 0.0, 1.0);
92 | gl_FragColor = vec4(1.0 - occlusion);
93 | }
94 |
--------------------------------------------------------------------------------
/glee/cube.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | glee.Cube = function(size){
7 | var s = size || 1;
8 | var vbo = this.vbo = new glee.VBO({
9 | position_3f: [
10 | // front
11 | -s, -s, -s, -s, s, -s, s, s, -s,
12 | s, -s, -s, -s, -s, -s, s, s, -s,
13 |
14 | // back
15 | s, s, s, -s, s, s, -s, -s, s,
16 | s, s, s, -s, -s, s, s, -s, s,
17 |
18 | // top
19 | -s, s, -s, -s, s, s, s, s, s,
20 | s, s, -s, -s, s, -s, s, s, s,
21 |
22 | // bottom
23 | s, -s, s, -s, -s, s, -s, -s, -s,
24 | s, -s, s, -s, -s, -s, s, -s, -s,
25 |
26 | // left
27 | -s, -s, -s, -s, -s, s, -s, s, s,
28 | -s, s, -s, -s, -s, -s, -s, s, s,
29 |
30 | // right
31 | s, s, s, s, -s, s, s, -s, -s,
32 | s, s, s, s, -s, -s, s, s, -s
33 | ],
34 | normal_3f: [
35 | // front
36 | 0, 0, -1, 0, 0, -1, 0, 0, -1,
37 | 0, 0, -1, 0, 0, -1, 0, 0, -1,
38 |
39 | // back
40 | 0, 0, 1, 0, 0, 1, 0, 0, 1,
41 | 0, 0, 1, 0, 0, 1, 0, 0, 1,
42 |
43 | // top
44 | 0, 1, 0, 0, 1, 0, 0, 1, 0,
45 | 0, 1, 0, 0, 1, 0, 0, 1, 0,
46 |
47 | // bottom
48 | 0, -1, 0, 0, -1, 0, 0, -1, 0,
49 | 0, -1, 0, 0, -1, 0, 0, -1, 0,
50 |
51 | // left
52 | -1, 0, 0, -1, 0, 0, -1, 0, 0,
53 | -1, 0, 0, -1, 0, 0, -1, 0, 0,
54 |
55 | // right
56 | 1, 0, 0, 1, 0, 0, 1, 0, 0,
57 | 1, 0, 0, 1, 0, 0, 1, 0, 0
58 | ],
59 | texcoord_2f: [
60 | 0, 1, 0, 0, 1, 0,
61 | 1, 1, 0, 1, 1, 0,
62 |
63 | 1, 0, 0, 0, 0, 1,
64 | 1, 0, 0, 1, 1, 1,
65 |
66 | 0, 1, 0, 0, 1, 0,
67 | 1, 1, 0, 1, 1, 0,
68 |
69 | 1, 0, 0, 0, 0, 1,
70 | 1, 0, 0, 1, 1, 1,
71 |
72 | 0, 1, 0, 0, 1, 0,
73 | 1, 1, 0, 1, 1, 0,
74 |
75 | 1, 0, 0, 0, 0, 1,
76 | 1, 0, 0, 1, 1, 1
77 | ]
78 | });
79 |
80 | this.draw = function(){
81 | vbo.draw(glee.gl.TRIANGLES);
82 | }
83 | }
84 | });
85 |
--------------------------------------------------------------------------------
/glee/viewpoint.js:
--------------------------------------------------------------------------------
1 | Glee.extensions.push(function(glee){
2 | glee.Viewpoint = function(params){
3 | if(params){
4 | var keys = params.keys;
5 | }
6 | else{
7 | var keys = null;
8 | }
9 |
10 | var speed_factor = params.speed || 0.05;
11 | var change_factor = 80.0;
12 | var speed_damping = params.damping || 0.9;
13 |
14 | this.matrix = new glee.Mat4();
15 | this.rot = new glee.Mat3();
16 | this.inv = new glee.Mat4();
17 | this.inv_rot = new glee.Mat3();
18 |
19 | var mousepressed = false;
20 | var x, y;
21 |
22 | if(params.position){
23 | var position = params.position;
24 | }
25 | else{
26 | var position = this.position = new glee.Vec3(0.0, 0.0, 0.0);
27 | }
28 |
29 | if(params.offset){
30 | var offset = params.offset;
31 | }
32 | else{
33 | var offset = new glee.Vec3(0.0, 0.0, 0.0);
34 | }
35 |
36 | var speed = this.speed = new glee.Vec3();
37 | var change = this.speed = new glee.Vec3();
38 |
39 | var rotation = this.rotation = new glee.Vec3();
40 | var rotspeed = new glee.Vec3();
41 | var tmp = new glee.Vec3();
42 |
43 | var elem = glee.canvas;
44 |
45 | $(elem).mousedown(function(event){
46 | if(event.button == 0){
47 | x = event.pageX, y = event.pageY;
48 | mousepressed = true;
49 | }
50 | return false;
51 | });
52 |
53 | $(elem).mouseup(function(event){
54 | if(event.button == 0){
55 | mousepressed = false;
56 | }
57 | });
58 |
59 | $(elem).mousemove(function(event){
60 | if(mousepressed){
61 | var xdelta = event.pageX-x;
62 | var ydelta = y-event.pageY;
63 | x = event.pageX, y = event.pageY;
64 | rotspeed.x -= xdelta*2.0;
65 | rotspeed.y -= ydelta*2.0;
66 | }
67 | });
68 |
69 | this.step = function(delta){
70 | tmp.update(rotspeed).mul(delta);
71 | rotation.add(tmp);
72 | rotspeed.mul(0.93);
73 |
74 | tmp.update(speed).mul(speed_factor*delta);
75 | position.add(tmp);
76 | speed.mul(speed_damping);
77 |
78 | if(keys){
79 | change.x = keys.a ? -1 : keys.d ? +1 : 0;
80 | change.y = keys.q ? -1 : keys.e ? +1 : 0;
81 | change.z = keys.s ? +1 : keys.w ? -1 : 0;
82 | }
83 |
84 | change.mul(change_factor*delta).mul(this.rot);
85 | speed.add(change);
86 |
87 | if(rotation.y > 70){
88 | rotation.y = 70;
89 | rotspeed.y = 0;
90 | }
91 | else if(rotation.y < -70){
92 | rotation.y = -70;
93 | rotspeed.y = 0;
94 | }
95 |
96 | this.matrix.ident()
97 | .translate(-offset.x, -offset.y, -offset.z)
98 | .rotatex(this.rotation.y)
99 | .rotatey(-this.rotation.x)
100 | .translate(-position.x, -position.y, -position.z)
101 | this.rot.updateFrom(this.matrix);
102 | this.inv.updateFrom(this.matrix).invert();
103 | this.inv_rot.updateFrom(this.inv);
104 | }
105 | };
106 | });
107 |
--------------------------------------------------------------------------------
/ssao/gpg8.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | #define sample_count 16
17 | #define pattern_size 4.0
18 |
19 | uniform sampler2D normaldepth, random_field;
20 | uniform vec2 viewport;
21 | uniform float near, far, radius, epsilon, full_occlusion_treshold, no_occlusion_treshold, occlusion_power, random_size, power;
22 | uniform mat4 proj, inv_proj;
23 | uniform mat3 inv_rot;
24 | uniform vec3 samples[8];
25 | varying vec2 uv;
26 |
27 | vec3 getsample(int i){
28 | vec2 mod_coord = mod(floor(gl_FragCoord.xy), pattern_size);
29 | float y = ((mod_coord.x + mod_coord.y*pattern_size)+0.5) / (pattern_size*pattern_size);
30 | float x = (float(i)+0.5)/float(sample_count);
31 | return (texture2D(random_field, vec2(x, y)).xyz-0.5)*2.0;
32 | }
33 |
34 | vec3 get_eye_normal(){
35 | vec2 frag_coord = gl_FragCoord.xy/viewport;
36 | frag_coord = (frag_coord-0.5)*2.0;
37 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
38 | return normalize((inv_proj * device_normal).xyz);
39 | }
40 |
41 | vec3 decode_normal(vec2 enc){
42 | vec2 fenc = enc*4.0-2.0;
43 | float f = dot(fenc,fenc);
44 | float g = sqrt(1.0-f/4.0);
45 | return vec3(fenc*g, 1.0-f/2.0);
46 | }
47 |
48 | float decode_depth(vec2 src){
49 | float depth = src.x/255.0+src.y;
50 | return depth*far+near;
51 | }
52 |
53 | float occlusionFunction(float dist){
54 | if(dist > epsilon){
55 | if(dist < full_occlusion_treshold){
56 | return 1.0;
57 | }
58 | else{
59 | float range = no_occlusion_treshold - full_occlusion_treshold;
60 | return max(1.0 - pow((dist - full_occlusion_treshold)/range, occlusion_power), 0.0);
61 | }
62 | }
63 | else{
64 | return 0.0;
65 | }
66 | }
67 |
68 | float testOcclusion(vec3 eye_normal, vec3 eye_pos, vec3 sample_offset){
69 | sample_offset *= inv_rot;
70 | sample_offset *= sign(dot(eye_normal, sample_offset));
71 | vec3 sample_pos = eye_pos + radius*sample_offset;
72 | vec4 device = proj * vec4(sample_pos, 1.0);
73 | vec4 device_norm = device/device.w;
74 | vec2 screen_coord = (device_norm.xy+1.0)*0.5;
75 |
76 | vec4 sample_data = texture2D(normaldepth, screen_coord);
77 | float sample_depth = decode_depth(sample_data.zw);
78 | float dist = length(sample_pos) - sample_depth;
79 | return occlusionFunction(dist)*dot(normalize(sample_offset), eye_normal);
80 | //return occlusionFunction(dist);
81 | }
82 |
83 | void main(void){
84 | vec3 eye_ray = get_eye_normal();
85 | vec4 eye_data = texture2D(normaldepth, uv);
86 | vec3 eye_normal = decode_normal(eye_data.xy);
87 | float eye_depth = decode_depth(eye_data.zw);
88 | vec3 eye_pos = eye_depth * eye_ray;
89 | float result = 0.0;
90 |
91 | for(int i=0; i.
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | var gl = glee.gl;
7 |
8 | var FBO = glee.FBO = function(){
9 | this.id = gl.createFramebuffer();
10 | };
11 |
12 | var current = null;
13 | var stack = [];
14 |
15 | FBO.prototype = {
16 | check: function(){
17 | var result = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
18 | if(result == gl.FRAMEBUFFER_UNSUPPORTED){
19 | throw 'Framebuffer is unsupported';
20 | }
21 | else if(result == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT){
22 | throw 'Framebuffer incomplete attachment';
23 | }
24 | else if(result == gl.FRAMEBUFFER_INCOMPLETE_DIMESIONS){
25 | throw 'Framebuffer incomplete dimensions';
26 | }
27 | else if(result == gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT){
28 | throw 'Framebuffer incomplete missing attachment';
29 | }
30 | },
31 | bind: function(){
32 | gl.bindFramebuffer(gl.FRAMEBUFFER, this.id);
33 | current = this;
34 | },
35 | unbind: function(){
36 | gl.bindFramebuffer(gl.FRAMEBUFFER, null);
37 | current = null;
38 | },
39 | push: function(){
40 | if(current == this){
41 | return false;
42 | }
43 | else{
44 | stack.push(current);
45 | this.bind();
46 | return true;
47 | }
48 | },
49 | pop: function(pushed){
50 | if(pushed){
51 | current = stack.pop();
52 | if(current){
53 | current.bind();
54 | }
55 | else{
56 | this.unbind();
57 | }
58 | }
59 | },
60 | color: function(attachment){
61 | var pushed = this.push();
62 | gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, attachment.target, attachment.id, 0)
63 | this.pop(pushed);
64 | },
65 | cubemap: function(id, target){
66 | var pushed = this.push();
67 | gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, target, id, 0)
68 | this.pop(pushed);
69 | },
70 | depth: function(attachment){
71 | var pushed = this.push();
72 | if(attachment){
73 | gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, attachment.id);
74 | }
75 | else{
76 | gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null);
77 | }
78 | this.pop(pushed);
79 | },
80 | stencil: function(attachment){
81 | var pushed = this.push();
82 | if(attachment){
83 | gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, attachment.id);
84 | }
85 | else{
86 | gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, null);
87 | }
88 | this.pop(pushed);
89 | },
90 | depthstencil: function(attachment){
91 | var pushed = this.push();
92 | if(attachment){
93 | gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, attachment.id);
94 | }
95 | else{
96 | gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, null);
97 | }
98 | this.pop(pushed);
99 | }
100 | };
101 | });
102 |
--------------------------------------------------------------------------------
/jquery/development-bundle/demos/slider/tabs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | jQuery UI Slider - Snap to increments
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
46 |
47 |
Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.
48 |
49 |
50 |
Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.
51 |
52 |
53 |
Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.
54 |
Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
Control tabs with a slider.
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/jquery/development-bundle/external/jquery.cookie.js:
--------------------------------------------------------------------------------
1 | /*jslint browser: true */ /*global jQuery: true */
2 |
3 | /**
4 | * jQuery Cookie plugin
5 | *
6 | * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
7 | * Dual licensed under the MIT and GPL licenses:
8 | * http://www.opensource.org/licenses/mit-license.php
9 | * http://www.gnu.org/licenses/gpl.html
10 | *
11 | */
12 |
13 | // TODO JsDoc
14 |
15 | /**
16 | * Create a cookie with the given key and value and other optional parameters.
17 | *
18 | * @example $.cookie('the_cookie', 'the_value');
19 | * @desc Set the value of a cookie.
20 | * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
21 | * @desc Create a cookie with all available options.
22 | * @example $.cookie('the_cookie', 'the_value');
23 | * @desc Create a session cookie.
24 | * @example $.cookie('the_cookie', null);
25 | * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
26 | * used when the cookie was set.
27 | *
28 | * @param String key The key of the cookie.
29 | * @param String value The value of the cookie.
30 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
31 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
32 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
33 | * If set to null or omitted, the cookie will be a session cookie and will not be retained
34 | * when the the browser exits.
35 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
36 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
37 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
38 | * require a secure protocol (like HTTPS).
39 | * @type undefined
40 | *
41 | * @name $.cookie
42 | * @cat Plugins/Cookie
43 | * @author Klaus Hartl/klaus.hartl@stilbuero.de
44 | */
45 |
46 | /**
47 | * Get the value of a cookie with the given key.
48 | *
49 | * @example $.cookie('the_cookie');
50 | * @desc Get the value of a cookie.
51 | *
52 | * @param String key The key of the cookie.
53 | * @return The value of the cookie.
54 | * @type String
55 | *
56 | * @name $.cookie
57 | * @cat Plugins/Cookie
58 | * @author Klaus Hartl/klaus.hartl@stilbuero.de
59 | */
60 | jQuery.cookie = function (key, value, options) {
61 |
62 | // key and value given, set cookie...
63 | if (arguments.length > 1 && (value === null || typeof value !== "object")) {
64 | options = jQuery.extend({}, options);
65 |
66 | if (value === null) {
67 | options.expires = -1;
68 | }
69 |
70 | if (typeof options.expires === 'number') {
71 | var days = options.expires, t = options.expires = new Date();
72 | t.setDate(t.getDate() + days);
73 | }
74 |
75 | return (document.cookie = [
76 | encodeURIComponent(key), '=',
77 | options.raw ? String(value) : encodeURIComponent(String(value)),
78 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
79 | options.path ? '; path=' + options.path : '',
80 | options.domain ? '; domain=' + options.domain : '',
81 | options.secure ? '; secure' : ''
82 | ].join(''));
83 | }
84 |
85 | // key and possibly options given, get cookie...
86 | options = value || {};
87 | var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
88 | return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
89 | };
90 |
--------------------------------------------------------------------------------
/blur/blur.js:
--------------------------------------------------------------------------------
1 | blur = {
2 | root: 'blur',
3 | shaders: {
4 | blur: 'blur.shader',
5 | },
6 | Blur: function(glee, klass, params){
7 | var self = this;
8 |
9 | this.source = params.source;
10 | this.enabler = params.enabler;
11 |
12 | this.blur_h = new glee.Processor({
13 | fbo: params.fbo,
14 | result: new glee.Texture({width: glee.width, height: glee.height}),
15 | shader: klass.shaders.blur,
16 | samplers: {
17 | normaldepth: params.normaldepth,
18 | },
19 | uniforms: {
20 | axis: [1, 0],
21 | },
22 | });
23 |
24 | this.blur_v = new glee.Processor({
25 | fbo: params.fbo,
26 | result: new glee.Texture({width: glee.width, height: glee.height}),
27 | shader: klass.shaders.blur,
28 | samplers: {
29 | normaldepth: params.normaldepth,
30 | source: this.blur_h.result,
31 | },
32 | uniforms: {
33 | axis: [0, 1],
34 | },
35 | });
36 |
37 | this.result = this.blur_v.result;
38 |
39 | this.repeat = 4;
40 | this.render = function(){
41 | this.blur_h.samplers.source = this.source;
42 | for(var i=0; i');
50 | $(' ').text(params.name).appendTo(this.parameters);
51 | slider({
52 | title: 'Repeat',
53 | min: 1,
54 | max: 20,
55 | value: 4,
56 | step: 1,
57 | slide: function(value){
58 | self.repeat = value
59 | }
60 | }).appendTo(this.parameters);
61 |
62 | slider({
63 | title: 'Distance',
64 | min: 1,
65 | max: 1000,
66 | value: 90,
67 | step: 1,
68 | slide: function(value){
69 | self.blur_h.uniforms.distance_factor = value;
70 | self.blur_v.uniforms.distance_factor = value;
71 | }
72 | }).appendTo(this.parameters);
73 |
74 | slider({
75 | title: 'Depth Power',
76 | min: 0.01,
77 | max: 3,
78 | value: 0.3,
79 | step: 0.01,
80 | slide: function(value){
81 | self.blur_h.uniforms.depth_power = value;
82 | self.blur_v.uniforms.depth_power = value;
83 | }
84 | }).appendTo(this.parameters);
85 |
86 | slider({
87 | title: 'Normal Factor',
88 | min: 0.01,
89 | max: 3,
90 | value: 1.0,
91 | step: 0.01,
92 | slide: function(value){
93 | self.blur_h.uniforms.normal_factor = value;
94 | self.blur_v.uniforms.normal_factor = value;
95 | }
96 | }).appendTo(this.parameters);
97 |
98 | slider({
99 | title: 'Normal Power',
100 | min: 0.01,
101 | max: 3,
102 | value: 1.0,
103 | step: 0.01,
104 | slide: function(value){
105 | self.blur_h.uniforms.normal_power = value;
106 | self.blur_v.uniforms.normal_power = value;
107 | }
108 | }).appendTo(this.parameters);
109 |
110 | this.check = function(){
111 | if(this.enabler.attr('checked')){
112 | self.enabled = true;
113 | }
114 | else{
115 | self.enabled = false;
116 | }
117 | };
118 | params.enabler.change(function(){
119 | self.check();
120 | });
121 | this.check();
122 | },
123 | };
124 |
--------------------------------------------------------------------------------
/ssao/gd.backup.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | #define sample_count 8
17 |
18 | uniform sampler2D normaldepth;
19 | #ifdef random_reflect
20 | uniform sampler2D random;
21 | #endif
22 |
23 | uniform float radius, near, far, random_size;
24 | uniform float dist_factor, dist_power;
25 | uniform float occlusion_factor, occlusion_power;
26 | uniform float sample_factor, sample_power;
27 |
28 | uniform vec2 viewport;
29 | uniform vec3 samples[sample_count];
30 | uniform mat4 proj, inv_proj;
31 | uniform mat3 inv_rot;
32 | varying vec2 uv;
33 |
34 | vec3 get_eye_normal(){
35 | vec2 frag_coord = gl_FragCoord.xy/viewport;
36 | frag_coord = (frag_coord-0.5)*2.0;
37 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
38 | return normalize((inv_proj * device_normal).xyz);
39 | }
40 |
41 | vec3 decode_normal(vec2 enc)
42 | {
43 | vec2 fenc = enc*4.0-2.0;
44 | float f = dot(fenc,fenc);
45 | float g = sqrt(1.0-f/4.0);
46 | return vec3(fenc*g, 1.0-f/2.0);
47 | }
48 |
49 | float decode_depth(vec2 src){
50 | float depth = src.x/255.0+src.y;
51 | return depth*far+near;
52 | }
53 |
54 | void main(void){
55 | vec3 eye_ray = get_eye_normal();
56 | vec4 eye_data = texture2D(normaldepth, uv);
57 | vec3 eye_normal = decode_normal(eye_data.xy);
58 | float eye_depth = decode_depth(eye_data.zw);
59 | vec3 eye_pos = eye_depth * eye_ray;
60 |
61 | #ifdef random_reflect
62 | vec3 random_vec = (texture2D(random, gl_FragCoord.xy/random_size).xyz-0.5)*2.0;
63 | #endif
64 |
65 | float occlusion = 0.0;
66 | float divider = 0.0;
67 |
68 | for(int i=0; i 0.0){
103 | continue;
104 | }
105 | occlusion += lambert*pow(dist, dist_power)*pow(len, sample_power);
106 | }
107 |
108 | occlusion = clamp(occlusion/divider, 0.0, 1.0);
109 | gl_FragColor = vec4(vec3(1.0-pow(occlusion*occlusion_factor, occlusion_power)), 1.0);
110 | }
111 |
--------------------------------------------------------------------------------
/jquery/development-bundle/external/qunit.css:
--------------------------------------------------------------------------------
1 | /** Font Family and Sizes */
2 |
3 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
4 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
5 | }
6 |
7 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
8 | #qunit-tests { font-size: smaller; }
9 |
10 |
11 | /** Resets */
12 |
13 | #qunit-tests, #qunit-tests li ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
14 | margin: 0;
15 | padding: 0;
16 | }
17 |
18 |
19 | /** Header */
20 |
21 | #qunit-header {
22 | padding: 0.5em 0 0.5em 1em;
23 |
24 | color: #fff;
25 | text-shadow: rgba(0, 0, 0, 0.5) 4px 4px 1px;
26 | background-color: #0d3349;
27 |
28 | border-radius: 15px 15px 0 0;
29 | -moz-border-radius: 15px 15px 0 0;
30 | -webkit-border-top-right-radius: 15px;
31 | -webkit-border-top-left-radius: 15px;
32 | }
33 |
34 | #qunit-header a {
35 | text-decoration: none;
36 | color: white;
37 | }
38 |
39 | #qunit-banner {
40 | height: 5px;
41 | }
42 |
43 | #qunit-testrunner-toolbar {
44 | padding: 0em 0 0.5em 2em;
45 | }
46 |
47 | #qunit-userAgent {
48 | padding: 0.5em 0 0.5em 2.5em;
49 | background-color: #2b81af;
50 | color: #fff;
51 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
52 | }
53 |
54 |
55 | /** Tests: Pass/Fail */
56 |
57 | #qunit-tests {
58 | list-style-position: inside;
59 | }
60 |
61 | #qunit-tests li {
62 | padding: 0.4em 0.5em 0.4em 2.5em;
63 | border-bottom: 1px solid #fff;
64 | list-style-position: inside;
65 | }
66 |
67 | #qunit-tests li strong {
68 | cursor: pointer;
69 | }
70 |
71 | #qunit-tests li ol {
72 | margin-top: 0.5em;
73 | padding: 0.5em;
74 |
75 | background-color: #fff;
76 |
77 | border-radius: 15px;
78 | -moz-border-radius: 15px;
79 | -webkit-border-radius: 15px;
80 |
81 | box-shadow: inset 0px 2px 13px #999;
82 | -moz-box-shadow: inset 0px 2px 13px #999;
83 | -webkit-box-shadow: inset 0px 2px 13px #999;
84 | }
85 |
86 | #qunit-tests li li {
87 | margin: 0.5em;
88 | padding: 0.4em 0.5em 0.4em 0.5em;
89 | background-color: #fff;
90 | border-bottom: none;
91 | list-style-position: inside;
92 | }
93 |
94 | /*** Passing Styles */
95 |
96 | #qunit-tests li li.pass {
97 | color: #5E740B;
98 | background-color: #fff;
99 | border-left: 26px solid #C6E746;
100 | }
101 |
102 | #qunit-tests li.pass { color: #528CE0; background-color: #D2E0E6; }
103 | #qunit-tests li.pass span.test-name { color: #366097; }
104 |
105 | #qunit-tests li li.pass span.test-actual,
106 | #qunit-tests li li.pass span.test-expected { color: #999999; }
107 |
108 | strong b.pass { color: #5E740B; }
109 |
110 | #qunit-banner.qunit-pass { background-color: #C6E746; }
111 |
112 | /*** Failing Styles */
113 |
114 | #qunit-tests li li.fail {
115 | color: #710909;
116 | background-color: #fff;
117 | border-left: 26px solid #EE5757;
118 | }
119 |
120 | #qunit-tests li.fail { color: #000000; background-color: #EE5757; }
121 | #qunit-tests li.fail span.test-name,
122 | #qunit-tests li.fail span.module-name { color: #000000; }
123 |
124 | #qunit-tests li li.fail span.test-actual { color: #EE5757; }
125 | #qunit-tests li li.fail span.test-expected { color: green; }
126 |
127 | strong b.fail { color: #710909; }
128 |
129 | #qunit-banner.qunit-fail,
130 | #qunit-testrunner-toolbar { background-color: #EE5757; }
131 |
132 |
133 | /** Footer */
134 |
135 | #qunit-testresult {
136 | padding: 0.5em 0.5em 0.5em 2.5em;
137 |
138 | color: #2b81af;
139 | background-color: #D2E0E6;
140 |
141 | border-radius: 0 0 15px 15px;
142 | -moz-border-radius: 0 0 15px 15px;
143 | -webkit-border-bottom-right-radius: 15px;
144 | -webkit-border-bottom-left-radius: 15px;
145 | }
146 |
147 | /** Fixture */
148 |
149 | #qunit-fixture {
150 | position: absolute;
151 | top: -10000px;
152 | left: -10000px;
153 | }
154 |
--------------------------------------------------------------------------------
/ssao/gd.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | #define sample_count 16
17 | #define pattern_size 4.0
18 |
19 | uniform sampler2D normaldepth, random_field;
20 |
21 | uniform float radius, near, far;
22 | uniform float dist_factor, dist_power;
23 | uniform float occlusion_factor, occlusion_power;
24 |
25 | uniform vec3 lightdir;
26 | uniform mat4 proj, inv_proj;
27 | uniform mat3 inv_rot;
28 | varying vec2 uv;
29 |
30 | vec3 decode_normal(vec2 enc){
31 | vec2 fenc = enc*4.0-2.0;
32 | float f = dot(fenc,fenc);
33 | float g = sqrt(1.0-f/4.0);
34 | return vec3(fenc*g, 1.0-f/2.0);
35 | }
36 |
37 | float decode_depth(vec2 src){
38 | float depth = src.x/255.0+src.y;
39 | return depth*far+near;
40 | }
41 |
42 | vec2 get_uv(vec3 pos){
43 | vec4 device = proj * vec4(pos, 1.0);
44 | vec4 device_norm = device/device.w;
45 | return (device_norm.xy+1.0)*0.5;
46 | }
47 |
48 | vec3 get_vec(vec2 uv){
49 | vec2 device = (uv*2.0)-1.0;
50 | return normalize((inv_proj * vec4(device.xy, -1.0, 1.0)).xyz);
51 | }
52 |
53 | vec3 getsample(int i){
54 | vec2 mod_coord = mod(floor(gl_FragCoord.xy), pattern_size);
55 | float y = ((mod_coord.x + mod_coord.y*pattern_size)+0.5) / (pattern_size*pattern_size);
56 | float x = (float(i)+0.5)/float(sample_count);
57 | return (texture2D(random_field, vec2(x, y)).xyz-0.5)*2.0;
58 | }
59 |
60 | void main(void){
61 | vec3 eye_ray = get_vec(uv);
62 | vec4 eye_data = texture2D(normaldepth, uv);
63 | vec3 eye_normal = decode_normal(eye_data.xy);
64 | float eye_depth = decode_depth(eye_data.zw);
65 | vec3 eye_pos = eye_depth * eye_ray;
66 |
67 | float divider = 0.0;
68 | float irradiance = 0.0;
69 |
70 | for(int i=0; i 0.0){
100 | occlusion = 0.0;
101 | }
102 | else{
103 | occlusion = clamp(pow(dist, dist_power)*occlusion_factor, 0.0, 1.0);
104 | }
105 | divider += lambert * light_lambert;
106 | irradiance += (1.0 - occlusion) * lambert * light_lambert;
107 | }
108 |
109 | irradiance /= divider;
110 | gl_FragColor = vec4(pow(irradiance, occlusion_power));
111 | }
112 |
--------------------------------------------------------------------------------
/glee/sphere.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | var phi = (1+Math.sqrt(5))/2;
7 |
8 | var v1 = [1, phi, 0];
9 | var v2 = [-1, phi, 0];
10 | var v3 = [0, 1, phi];
11 | var v4 = [0, 1, -phi];
12 | var v5 = [phi, 0, 1];
13 | var v6 = [-phi, 0, 1];
14 | var v7 = [-phi, 0, -1];
15 | var v8 = [phi, 0, -1];
16 | var v9 = [0, -1, phi];
17 | var v10 = [0, -1, -phi];
18 | var v11 = [-1, -phi, 0];
19 | var v12 = [1, -phi, 0];
20 |
21 | var faces = [
22 | [v1 , v2 , v3 ],
23 | [v2 , v1 , v4 ],
24 | [v1 , v3 , v5 ],
25 | [v2 , v6 , v3 ],
26 | [v2 , v7 , v6 ],
27 | [v2 , v4 , v7 ],
28 | [v1 , v5 , v8 ],
29 | [v1 , v8 , v4 ],
30 | [v9 , v3 , v6 ],
31 | [v3 , v9 , v5 ],
32 | [v4 , v10, v7 ],
33 | [v4 , v8 , v10],
34 | [v6 , v7 , v11],
35 | [v6 , v11, v9 ],
36 | [v7 , v10, v11],
37 | [v5 , v12, v8 ],
38 | [v12, v5 , v9 ],
39 | [v12, v10, v8 ],
40 | [v11, v12, v9 ],
41 | [v12, v11, v10]
42 | ];
43 |
44 | var midp = function(v1, v2){
45 | var x1 = v1[0];
46 | var y1 = v1[1];
47 | var z1 = v1[2];
48 |
49 | var x2 = v2[0];
50 | var y2 = v2[1];
51 | var z2 = v2[2];
52 |
53 | var x3 = (x1+x2)/2;
54 | var y3 = (y1+y2)/2;
55 | var z3 = (z1+z2)/2;
56 |
57 | return [x3, y3, z3];
58 | }
59 |
60 | var subdivide = function(faces){
61 | var result = [];
62 | for(fi in faces){
63 | var face = faces[fi];
64 | var v0 = face[0];
65 | var v1 = face[1];
66 | var v2 = face[2];
67 |
68 | var va = midp(v0, v1);
69 | var vb = midp(v1, v2);
70 | var vc = midp(v2, v0);
71 |
72 | result.push(
73 | [v0, va, vc],
74 | [va, v1, vb],
75 | [vc, vb, v2],
76 | [va, vb, vc]
77 | )
78 | }
79 | return result;
80 | }
81 |
82 | var normalize = function(faces, r){
83 | if(r === undefined){
84 | var r = 1.0;
85 | }
86 | var result = [];
87 | for(fi in faces){
88 | var face = faces[fi];
89 | var new_face = [];
90 | result.push(new_face);
91 | for(vi in face){
92 | var vertex = face[vi];
93 | var x = vertex[0];
94 | var y = vertex[1];
95 | var z = vertex[2];
96 | var l = Math.sqrt(x*x + y*y + z*z);
97 | new_face.push([(r*x)/l, (r*y)/l, (r*z)/l]);
98 | }
99 | }
100 | return result;
101 | }
102 |
103 | var vertexlist = function(faces){
104 | var vertices = [];
105 | for(fi in faces){
106 | var face = faces[fi];
107 | for(vi in face){
108 | var vertex = face[vi];
109 | var x = vertex[0];
110 | var y = vertex[1];
111 | var z = vertex[2];
112 | vertices.push(x, y, z);
113 | }
114 | }
115 | return vertices;
116 | }
117 |
118 | var template = normalize(faces);
119 | var template = subdivide(template);
120 | var template = normalize(template);
121 | var template = subdivide(template);
122 | var template = normalize(template);
123 | var template = subdivide(template);
124 | var template = normalize(template);
125 |
126 | glee.Sphere = function(radius){
127 | var faces = normalize(template, radius);
128 | var vertices = vertexlist(faces);
129 | var normals = vertexlist(template);
130 |
131 | var vbo = this.vbo = new glee.VBO({
132 | position_3f: vertices,
133 | normal_3f: normals,
134 | });
135 |
136 | this.draw = function(){
137 | //vbo.draw(glee.gl.TRIANGLES, vertices.length/3);
138 | vbo.draw(glee.gl.TRIANGLES, vertices.length/3);
139 | }
140 | }
141 | });
142 |
--------------------------------------------------------------------------------
/glee/resources.js:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 |
6 | Glee.xhr = function(params){
7 | var request = new XMLHttpRequest();
8 | if(params.type){
9 | console.dir(request);
10 | request.overrideMimeType('text/plain; charset=x-user-defined');
11 | }
12 | request.onreadystatechange = function(){
13 | if(this.readyState == 4){
14 | params.success(request.responseText);
15 | }
16 | };
17 | request.open('GET', params.url);
18 | request.send();
19 | };
20 |
21 | Glee.prototype.load = function(resources){
22 | var extre = /\.(.+)$/
23 | var count = 0;
24 | var loaded = 0;
25 | var glee = this;
26 | var onprogress = resources.onprogress || function(){};
27 |
28 | var do_load = function(root, obj){
29 | var prefix;
30 | if(root){
31 | if(obj.root){
32 | var prefix = root + '/' + obj.root;
33 | }
34 | else{
35 | var prefix = root;
36 | }
37 | }
38 | else if(obj.root){
39 | var prefix = obj.root;
40 | }
41 | Glee.each(obj, function(name, loc){
42 | if(name == 'root'){
43 | return;
44 | }
45 | else if(typeof(loc) == 'object'){
46 | do_load(prefix, loc);
47 | }
48 | else if(typeof(loc) == 'string'){
49 | if(prefix){
50 | var path = prefix + '/' + loc;
51 | }
52 | else{
53 | var path = loc;
54 | }
55 | count += 1;
56 | var extension = path.match(extre)[1];
57 | if(extension == 'model'){
58 | Glee.xhr({
59 | url: path,
60 | success: function(text){
61 | var nodes = JSON.parse(text);
62 | var model = obj[name] = new glee.Model(path, nodes, function(filepath){
63 | loaded += 1;
64 | onprogress(loaded/count, filepath);
65 | });
66 | count += model.texture_count;
67 | loaded += 1;
68 | onprogress(loaded/count, path);
69 | }
70 | });
71 | }
72 | else if(extension == 'shader'){
73 | Glee.xhr({
74 | url: path,
75 | success: function(text){
76 | obj[name] = new glee.Shader(text, path);
77 | loaded += 1;
78 | onprogress(loaded/count, path);
79 | }
80 | });
81 | }
82 | else if(extension == 'png' || extension == 'jpg' || extension == 'gif'){
83 | var image = new Image();
84 | image.onload = function(){
85 | obj[name] = new glee.Texture({image: image});
86 | loaded += 1;
87 | onprogress(loaded/count, path);
88 | };
89 | image.src = path;
90 | }
91 | else if(extension == 'vbo'){
92 | Glee.xhr({
93 | url: path,
94 | success: function(text){
95 | var params = JSON.parse(text);
96 | obj[name] = new glee.VBO(params);
97 | loaded += 1;
98 | onprogress(loaded/count, path);
99 | }
100 | });
101 | }
102 | }
103 | });
104 | };
105 | do_load(null, resources);
106 |
107 | var interval = setInterval(function(){
108 | if(count==loaded){
109 | clearInterval(interval);
110 | resources.onload();
111 | }
112 | }, 100);
113 |
114 | return glee;
115 | };
116 |
--------------------------------------------------------------------------------
/jquery/development-bundle/ui/minified/jquery.ui.core.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery UI 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI
9 | */
10 | (function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
11 | NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
12 | "position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
13 | if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
14 | "border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
15 | d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
16 | c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a.
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 |
8 | void main(void) {
9 | gl_Position = vec4(position, 1.0);
10 | }
11 |
12 | fragment:
13 | uniform vec2 viewport;
14 | uniform mat4 inv_proj;
15 | uniform mat3 inv_view_rot;
16 | uniform vec3 lightdir, Kr;
17 | //vec3 Kr = vec3(0.18867780436772762, 0.4978442963618773, 0.6616065586417131); // air
18 | uniform float rayleigh_brightness, mie_brightness, spot_brightness, scatter_strength, rayleigh_strength, mie_strength;
19 | uniform float rayleigh_collection_power, mie_collection_power, mie_distribution;
20 |
21 | float surface_height = 0.99;
22 | float range = 0.01;
23 | float intensity = 1.8;
24 | const int step_count = 16;
25 |
26 | vec3 get_world_normal(){
27 | vec2 frag_coord = gl_FragCoord.xy/viewport;
28 | frag_coord = (frag_coord-0.5)*2.0;
29 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
30 | vec3 eye_normal = normalize((inv_proj * device_normal).xyz);
31 | vec3 world_normal = normalize(inv_view_rot*eye_normal);
32 | return world_normal;
33 | }
34 |
35 | float atmospheric_depth(vec3 position, vec3 dir){
36 | float a = dot(dir, dir);
37 | float b = 2.0*dot(dir, position);
38 | float c = dot(position, position)-1.0;
39 | float det = b*b-4.0*a*c;
40 | float detSqrt = sqrt(det);
41 | float q = (-b - detSqrt)/2.0;
42 | float t1 = c/q;
43 | return t1;
44 | }
45 |
46 | float phase(float alpha, float g){
47 | float a = 3.0*(1.0-g*g);
48 | float b = 2.0*(2.0+g*g);
49 | float c = 1.0+alpha*alpha;
50 | float d = pow(1.0+g*g-2.0*g*alpha, 1.5);
51 | return (a/b)*(c/d);
52 | }
53 |
54 | float horizon_extinction(vec3 position, vec3 dir, float radius){
55 | float u = dot(dir, -position);
56 | if(u<0.0){
57 | return 1.0;
58 | }
59 | vec3 near = position + u*dir;
60 | if(length(near) < radius){
61 | return 0.0;
62 | }
63 | else{
64 | vec3 v2 = normalize(near)*radius - position;
65 | float diff = acos(dot(normalize(v2), dir));
66 | return smoothstep(0.0, 1.0, pow(diff*2.0, 3.0));
67 | }
68 | }
69 |
70 | vec3 absorb(float dist, vec3 color, float factor){
71 | return color-color*pow(Kr, vec3(factor/dist));
72 | }
73 |
74 | void main(void){
75 | vec3 eyedir = get_world_normal();
76 | float alpha = dot(eyedir, lightdir);
77 |
78 | float rayleigh_factor = phase(alpha, -0.01)*rayleigh_brightness;
79 | float mie_factor = phase(alpha, mie_distribution)*mie_brightness;
80 | float spot = smoothstep(0.0, 15.0, phase(alpha, 0.9995))*spot_brightness;
81 |
82 | vec3 eye_position = vec3(0.0, surface_height, 0.0);
83 | float eye_depth = atmospheric_depth(eye_position, eyedir);
84 | float step_length = eye_depth/float(step_count);
85 | float eye_extinction = horizon_extinction(eye_position, eyedir, surface_height-0.15);
86 |
87 | vec3 rayleigh_collected = vec3(0.0, 0.0, 0.0);
88 | vec3 mie_collected = vec3(0.0, 0.0, 0.0);
89 |
90 | for(int i=0; iThis is a p
35 | * @before $.metadata.setType("class")
36 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
37 | * @desc Reads metadata from the class attribute
38 | *
39 | * @example This is a p
40 | * @before $.metadata.setType("attr", "data")
41 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
42 | * @desc Reads metadata from a "data" attribute
43 | *
44 | * @example This is a p
45 | * @before $.metadata.setType("elem", "script")
46 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
47 | * @desc Reads metadata from a nested script element
48 | *
49 | * @param String type The encoding type
50 | * @param String name The name of the attribute to be used to get metadata (optional)
51 | * @cat Plugins/Metadata
52 | * @descr Sets the type of encoding to be used when loading metadata for the first time
53 | * @type undefined
54 | * @see metadata()
55 | */
56 |
57 | (function($) {
58 |
59 | $.extend({
60 | metadata : {
61 | defaults : {
62 | type: 'class',
63 | name: 'metadata',
64 | cre: /({.*})/,
65 | single: 'metadata'
66 | },
67 | setType: function( type, name ){
68 | this.defaults.type = type;
69 | this.defaults.name = name;
70 | },
71 | get: function( elem, opts ){
72 | var settings = $.extend({},this.defaults,opts);
73 | // check for empty string in single property
74 | if ( !settings.single.length ) settings.single = 'metadata';
75 |
76 | var data = $.data(elem, settings.single);
77 | // returned cached data if it already exists
78 | if ( data ) return data;
79 |
80 | data = "{}";
81 |
82 | if ( settings.type == "class" ) {
83 | var m = settings.cre.exec( elem.className );
84 | if ( m )
85 | data = m[1];
86 | } else if ( settings.type == "elem" ) {
87 | if( !elem.getElementsByTagName )
88 | return undefined;
89 | var e = elem.getElementsByTagName(settings.name);
90 | if ( e.length )
91 | data = $.trim(e[0].innerHTML);
92 | } else if ( elem.getAttribute != undefined ) {
93 | var attr = elem.getAttribute( settings.name );
94 | if ( attr )
95 | data = attr;
96 | }
97 |
98 | if ( data.indexOf( '{' ) <0 )
99 | data = "{" + data + "}";
100 |
101 | data = eval("(" + data + ")");
102 |
103 | $.data( elem, settings.single, data );
104 | return data;
105 | }
106 | }
107 | });
108 |
109 | /**
110 | * Returns the metadata object for the first member of the jQuery object.
111 | *
112 | * @name metadata
113 | * @descr Returns element's metadata object
114 | * @param Object opts An object contianing settings to override the defaults
115 | * @type jQuery
116 | * @cat Plugins/Metadata
117 | */
118 | $.fn.metadata = function( opts ){
119 | return $.metadata.get( this[0], opts );
120 | };
121 |
122 | })(jQuery);
--------------------------------------------------------------------------------
/jquery/jquery.cookie.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Cookie plugin
3 | *
4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
5 | * Dual licensed under the MIT and GPL licenses:
6 | * http://www.opensource.org/licenses/mit-license.php
7 | * http://www.gnu.org/licenses/gpl.html
8 | *
9 | */
10 |
11 | /**
12 | * Create a cookie with the given name and value and other optional parameters.
13 | *
14 | * @example $.cookie('the_cookie', 'the_value');
15 | * @desc Set the value of a cookie.
16 | * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
17 | * @desc Create a cookie with all available options.
18 | * @example $.cookie('the_cookie', 'the_value');
19 | * @desc Create a session cookie.
20 | * @example $.cookie('the_cookie', null);
21 | * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
22 | * used when the cookie was set.
23 | *
24 | * @param String name The name of the cookie.
25 | * @param String value The value of the cookie.
26 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
27 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
28 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
29 | * If set to null or omitted, the cookie will be a session cookie and will not be retained
30 | * when the the browser exits.
31 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
32 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
33 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
34 | * require a secure protocol (like HTTPS).
35 | * @type undefined
36 | *
37 | * @name $.cookie
38 | * @cat Plugins/Cookie
39 | * @author Klaus Hartl/klaus.hartl@stilbuero.de
40 | */
41 |
42 | /**
43 | * Get the value of a cookie with the given name.
44 | *
45 | * @example $.cookie('the_cookie');
46 | * @desc Get the value of a cookie.
47 | *
48 | * @param String name The name of the cookie.
49 | * @return The value of the cookie.
50 | * @type String
51 | *
52 | * @name $.cookie
53 | * @cat Plugins/Cookie
54 | * @author Klaus Hartl/klaus.hartl@stilbuero.de
55 | */
56 | jQuery.cookie = function(name, value, options) {
57 | if (typeof value != 'undefined') { // name and value given, set cookie
58 | options = options || {};
59 | if (value === null) {
60 | value = '';
61 | options.expires = -1;
62 | }
63 | var expires = '';
64 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
65 | var date;
66 | if (typeof options.expires == 'number') {
67 | date = new Date();
68 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
69 | } else {
70 | date = options.expires;
71 | }
72 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
73 | }
74 | // CAUTION: Needed to parenthesize options.path and options.domain
75 | // in the following expressions, otherwise they evaluate to undefined
76 | // in the packed version for some reason...
77 | var path = options.path ? '; path=' + (options.path) : '';
78 | var domain = options.domain ? '; domain=' + (options.domain) : '';
79 | var secure = options.secure ? '; secure' : '';
80 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
81 | } else { // only name given, get cookie
82 | var cookieValue = null;
83 | if (document.cookie && document.cookie != '') {
84 | var cookies = document.cookie.split(';');
85 | for (var i = 0; i < cookies.length; i++) {
86 | var cookie = jQuery.trim(cookies[i]);
87 | // Does this cookie string begin with the name we want?
88 | if (cookie.substring(0, name.length + 1) == (name + '=')) {
89 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
90 | break;
91 | }
92 | }
93 | }
94 | return cookieValue;
95 | }
96 | };
97 |
--------------------------------------------------------------------------------
/sky/scattering.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 |
8 | void main(void) {
9 | gl_Position = vec4(position, 1.0);
10 | }
11 |
12 | fragment:
13 | uniform vec2 viewport;
14 | uniform mat4 inv_proj;
15 | uniform mat3 inv_view_rot;
16 | uniform vec3 lightdir, Kr;
17 | //vec3 Kr = vec3(0.18867780436772762, 0.4978442963618773, 0.6616065586417131); // air
18 | uniform float rayleigh_brightness, mie_brightness, spot_brightness, scatter_strength, rayleigh_strength, mie_strength;
19 | uniform float rayleigh_collection_power, mie_collection_power, mie_distribution;
20 |
21 | float surface_height = 0.99;
22 | float range = 0.01;
23 | float intensity = 1.8;
24 | const int step_count = 16;
25 |
26 | vec4 get_world_normal(){
27 | vec2 frag_coord = gl_FragCoord.xy/viewport;
28 | frag_coord = (frag_coord-0.5)*2.0;
29 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
30 | vec3 eye_normal = normalize((inv_proj * device_normal).xyz);
31 | vec3 world_normal = normalize(inv_view_rot*eye_normal);
32 | return vec4(world_normal, eye_normal.z);
33 | }
34 |
35 | float atmospheric_depth(vec3 position, vec3 dir){
36 | float a = dot(dir, dir);
37 | float b = 2.0*dot(dir, position);
38 | float c = dot(position, position)-1.0;
39 | float det = b*b-4.0*a*c;
40 | float detSqrt = sqrt(det);
41 | float q = (-b - detSqrt)/2.0;
42 | float t1 = c/q;
43 | return t1;
44 | }
45 |
46 | float phase(float alpha, float g){
47 | float a = 3.0*(1.0-g*g);
48 | float b = 2.0*(2.0+g*g);
49 | float c = 1.0+alpha*alpha;
50 | float d = pow(1.0+g*g-2.0*g*alpha, 1.5);
51 | return (a/b)*(c/d);
52 | }
53 |
54 | float horizon_extinction(vec3 position, vec3 dir, float radius){
55 | float u = dot(dir, -position);
56 | if(u<0.0){
57 | return 1.0;
58 | }
59 | vec3 near = position + u*dir;
60 | if(length(near) < radius){
61 | return 0.0;
62 | }
63 | else{
64 | vec3 v2 = normalize(near)*radius - position;
65 | float diff = acos(dot(normalize(v2), dir));
66 | return smoothstep(0.0, 1.0, pow(diff*2.0, 3.0));
67 | }
68 | }
69 |
70 | vec3 absorb(float dist, vec3 color, float factor){
71 | return color-color*pow(Kr, vec3(factor/dist));
72 | }
73 |
74 | void main(void){
75 | vec4 data = get_world_normal();
76 | vec3 eyedir = data.rgb;
77 | float alpha = dot(eyedir, lightdir);
78 |
79 | float rayleigh_factor = phase(alpha, -0.01)*rayleigh_brightness;
80 | float mie_factor = phase(alpha, mie_distribution)*mie_brightness;
81 | float spot = smoothstep(0.0, 15.0, phase(alpha, 0.9995))*spot_brightness;
82 |
83 | vec3 eye_position = vec3(0.0, surface_height, 0.0);
84 | float eye_depth = atmospheric_depth(eye_position, eyedir);
85 | float step_length = eye_depth/float(step_count);
86 | float eye_extinction = horizon_extinction(eye_position, eyedir, surface_height-0.15);
87 |
88 | vec3 rayleigh_collected = vec3(0.0, 0.0, 0.0);
89 | vec3 mie_collected = vec3(0.0, 0.0, 0.0);
90 |
91 | for(int i=0; i.
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | Glee.extensions.push(function(glee){
6 | var gl = glee.gl;
7 |
8 | var Texture = glee.Texture = function(params){
9 | var args = Glee.defaults(params, {
10 | target: gl.TEXTURE_2D,
11 | format: gl.RGBA,
12 | internal_format: gl.RGBA,
13 | type: gl.UNSIGNED_BYTE,
14 | filter: gl.LINEAR,
15 | });
16 |
17 | this.id = gl.createTexture();
18 | this.target = args.target;
19 | this.format = args.format;
20 | this.internal_format = args.internal_format;
21 | this.type = args.type;
22 |
23 | if(args.repeat){
24 | var clamp = gl.REPEAT;
25 | }
26 | else{
27 | var clamp = gl.CLAMP_TO_EDGE;
28 | }
29 |
30 | if(args.image){
31 | this.width = args.image.width;
32 | this.height = args.image.height;
33 |
34 | this
35 | .bind()
36 | .imagedata(args.image)
37 | .param(gl.TEXTURE_MAG_FILTER, args.filter)
38 | .param(gl.TEXTURE_MIN_FILTER, args.filter)
39 | .param(gl.TEXTURE_WRAP_S, clamp)
40 | .param(gl.TEXTURE_WRAP_T, clamp)
41 | .unbind();
42 | }
43 | else{
44 | this.width = args.width || glee.width;
45 | this.height = args.height || glee.height;
46 |
47 | this
48 | .bind()
49 | .data(this.width, this.height, args.data)
50 | .param(gl.TEXTURE_MAG_FILTER, args.filter)
51 | .param(gl.TEXTURE_MIN_FILTER, args.filter)
52 | .param(gl.TEXTURE_WRAP_S, clamp)
53 | .param(gl.TEXTURE_WRAP_T, clamp)
54 | .unbind();
55 | }
56 | };
57 |
58 | Texture.prototype = {
59 | update: function(params){
60 | var args = Glee.defaults(params, {
61 | target: gl.TEXTURE_2D,
62 | format: gl.RGBA,
63 | internal_format: gl.RGBA,
64 | type: gl.UNSIGNED_BYTE,
65 | filter: gl.LINEAR,
66 | });
67 |
68 | this.width = args.width || glee.width;
69 | this.height = args.height || glee.height;
70 |
71 | if(args.repeat){
72 | var clamp = gl.REPEAT;
73 | }
74 | else{
75 | var clamp = gl.CLAMP_TO_EDGE;
76 | }
77 |
78 | this
79 | .bind()
80 | .data(this.width, this.height, args.data)
81 | .param(gl.TEXTURE_MAG_FILTER, args.filter)
82 | .param(gl.TEXTURE_MIN_FILTER, args.filter)
83 | .param(gl.TEXTURE_WRAP_S, clamp)
84 | .param(gl.TEXTURE_WRAP_T, clamp)
85 | .unbind();
86 | },
87 | data: function(width, height, data){
88 | if(!data){
89 | var data = null;
90 | }
91 | gl.texImage2D(this.target, 0, this.internal_format, width, height, 0, this.format, this.type, data);
92 | return this;
93 | },
94 | imagedata: function(image){
95 | gl.texImage2D(this.target, 0, this.internal_format, this.format, this.type, image);
96 | return this;
97 | },
98 | bind: function(unit){
99 | if(unit != undefined){
100 | gl.activeTexture(gl.TEXTURE0+unit);
101 | }
102 | gl.bindTexture(this.target, this.id);
103 | return this;
104 | },
105 | unbind: function(){
106 | gl.bindTexture(this.target, null);
107 | return this;
108 | },
109 | param: function(name, value){
110 | gl.texParameteri(this.target, name, value);
111 | return this;
112 | },
113 | repeat: function(){
114 | return this
115 | .bind()
116 | .param(gl.TEXTURE_WRAP_S, gl.REPEAT)
117 | .param(gl.TEXTURE_WRAP_T, gl.REPEAT)
118 | .unbind()
119 | },
120 | mipmap: function(){
121 | this
122 | .bind()
123 | .param(gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR)
124 | .param(gl.TEXTURE_MAG_FILTER, gl.LINEAR)
125 | gl.generateMipmap(gl.TEXTURE_2D);
126 | glee.checkError();
127 | this.unbind();
128 | return this;
129 | }
130 | };
131 | });
132 |
--------------------------------------------------------------------------------
/jquery/development-bundle/ui/jquery.ui.mouse.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery UI Mouse 1.8.11
3 | *
4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Mouse
9 | *
10 | * Depends:
11 | * jquery.ui.widget.js
12 | */
13 | (function( $, undefined ) {
14 |
15 | $.widget("ui.mouse", {
16 | options: {
17 | cancel: ':input,option',
18 | distance: 1,
19 | delay: 0
20 | },
21 | _mouseInit: function() {
22 | var self = this;
23 |
24 | this.element
25 | .bind('mousedown.'+this.widgetName, function(event) {
26 | return self._mouseDown(event);
27 | })
28 | .bind('click.'+this.widgetName, function(event) {
29 | if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
30 | $.removeData(event.target, self.widgetName + '.preventClickEvent');
31 | event.stopImmediatePropagation();
32 | return false;
33 | }
34 | });
35 |
36 | this.started = false;
37 | },
38 |
39 | // TODO: make sure destroying one instance of mouse doesn't mess with
40 | // other instances of mouse
41 | _mouseDestroy: function() {
42 | this.element.unbind('.'+this.widgetName);
43 | },
44 |
45 | _mouseDown: function(event) {
46 | // don't let more than one widget handle mouseStart
47 | // TODO: figure out why we have to use originalEvent
48 | event.originalEvent = event.originalEvent || {};
49 | if (event.originalEvent.mouseHandled) { return; }
50 |
51 | // we may have missed mouseup (out of window)
52 | (this._mouseStarted && this._mouseUp(event));
53 |
54 | this._mouseDownEvent = event;
55 |
56 | var self = this,
57 | btnIsLeft = (event.which == 1),
58 | elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
59 | if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
60 | return true;
61 | }
62 |
63 | this.mouseDelayMet = !this.options.delay;
64 | if (!this.mouseDelayMet) {
65 | this._mouseDelayTimer = setTimeout(function() {
66 | self.mouseDelayMet = true;
67 | }, this.options.delay);
68 | }
69 |
70 | if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
71 | this._mouseStarted = (this._mouseStart(event) !== false);
72 | if (!this._mouseStarted) {
73 | event.preventDefault();
74 | return true;
75 | }
76 | }
77 |
78 | // Click event may never have fired (Gecko & Opera)
79 | if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
80 | $.removeData(event.target, this.widgetName + '.preventClickEvent');
81 | }
82 |
83 | // these delegates are required to keep context
84 | this._mouseMoveDelegate = function(event) {
85 | return self._mouseMove(event);
86 | };
87 | this._mouseUpDelegate = function(event) {
88 | return self._mouseUp(event);
89 | };
90 | $(document)
91 | .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
92 | .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
93 |
94 | event.preventDefault();
95 | event.originalEvent.mouseHandled = true;
96 | return true;
97 | },
98 |
99 | _mouseMove: function(event) {
100 | // IE mouseup check - mouseup happened when mouse was out of window
101 | if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
102 | return this._mouseUp(event);
103 | }
104 |
105 | if (this._mouseStarted) {
106 | this._mouseDrag(event);
107 | return event.preventDefault();
108 | }
109 |
110 | if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
111 | this._mouseStarted =
112 | (this._mouseStart(this._mouseDownEvent, event) !== false);
113 | (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
114 | }
115 |
116 | return !this._mouseStarted;
117 | },
118 |
119 | _mouseUp: function(event) {
120 | $(document)
121 | .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
122 | .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
123 |
124 | if (this._mouseStarted) {
125 | this._mouseStarted = false;
126 |
127 | if (event.target == this._mouseDownEvent.target) {
128 | $.data(event.target, this.widgetName + '.preventClickEvent', true);
129 | }
130 |
131 | this._mouseStop(event);
132 | }
133 |
134 | return false;
135 | },
136 |
137 | _mouseDistanceMet: function(event) {
138 | return (Math.max(
139 | Math.abs(this._mouseDownEvent.pageX - event.pageX),
140 | Math.abs(this._mouseDownEvent.pageY - event.pageY)
141 | ) >= this.options.distance
142 | );
143 | },
144 |
145 | _mouseDelayMet: function(event) {
146 | return this.mouseDelayMet;
147 | },
148 |
149 | // These are placeholder methods, to be overriden by extending plugin
150 | _mouseStart: function(event) {},
151 | _mouseDrag: function(event) {},
152 | _mouseStop: function(event) {},
153 | _mouseCapture: function(event) { return true; }
154 | });
155 |
156 | })(jQuery);
157 |
--------------------------------------------------------------------------------
/scene/simple.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position, normal;
7 | attribute vec2 texcoord;
8 | varying vec3 v_normal, v_position;
9 | varying vec2 v_texcoord;
10 | uniform mat4 proj, view, shadow_view;
11 | uniform float shadow_near, shadow_far;
12 |
13 | void main(void) {
14 | gl_Position = proj * view * vec4(position, 1.0);
15 | v_normal = normal;
16 | v_position = position;
17 | v_texcoord = texcoord;
18 | }
19 |
20 | fragment:
21 | varying vec3 v_normal, v_position;
22 | varying vec2 v_texcoord;
23 |
24 | uniform float near, far, shadow_near, shadow_far;
25 | uniform vec2 viewport;
26 | uniform vec3 lightdir;
27 | uniform vec3 samples[16];
28 | uniform mat3 view_rot, inv_view_rot;
29 | uniform mat4 view, inv_proj, shadow_view, shadow_proj;
30 | uniform samplerCube diffuse_sun, diffuse_env, specular_sun, specular_env;
31 | uniform sampler2D shadowmap, diffuse_texture, specular_texture;
32 |
33 | vec2 unpack(vec4 src){
34 | //return src.x/255.0+src.y+src.z*255.0;
35 | //return src.x/255.0+src.y;
36 | return vec2(
37 | src.x/255.0+src.y,
38 | src.z/255.0+src.w
39 | );
40 | }
41 |
42 | vec3 get_world_normal(){
43 | vec2 frag_coord = gl_FragCoord.xy/viewport;
44 | frag_coord = (frag_coord-0.5)*2.0;
45 | vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
46 | vec3 eye_normal = normalize((inv_proj * device_normal).xyz);
47 | vec3 world_normal = normalize(inv_view_rot*eye_normal);
48 | return world_normal;
49 | }
50 |
51 | void main(void){
52 | vec3 normal = normalize(v_normal);
53 | vec3 eye_normal = get_world_normal();
54 | vec4 shadow_pos = shadow_view * vec4(v_position, 1.0);
55 | vec4 shadow_device = shadow_proj * shadow_pos;
56 | vec4 shadow_device_normal = shadow_device / shadow_device.w;
57 | vec2 shadow_coord = (shadow_device.xy + 1.0) * 0.5;
58 | //float shadow_depth2 = shadow_pos.z - shadow_near;
59 | float shadow_depth2 = (shadow_pos.z - shadow_near)/(shadow_far-shadow_near)-0.002;
60 |
61 | float shadowed = 0.0;
62 | for(float y = -1.5; y<=1.5; y+=1.0){
63 | for(float x = -1.5; x<=1.5; x+=1.0){
64 | vec2 moments = unpack(texture2D(shadowmap, shadow_coord+vec2(x,y)/vec2(4092.0, 4092.0)));
65 | float p = float(shadow_depth2 >= moments.x);
66 | float variance = max(0.000015, moments.y - (moments.x*moments.x));
67 | float d = shadow_depth2 - moments.x;
68 | float p_max = variance/(variance + d*d);
69 | p_max = smoothstep(0.3, 1.0, p_max);
70 | shadowed += max(p, p_max);
71 | /*
72 | float shadow_depth1 = unpack(texture2D(shadowmap, shadow_coord+vec2(x,y)/vec2(4092.0, 4092.0)));
73 | float top = 0.001;
74 | float bottom = -0.2;
75 | float coeff = shadow_depth1 - shadow_depth2;
76 | if(coeff > top){
77 | shadowed += 0.0;
78 | }
79 | else if(coeff <= bottom){
80 | shadowed += 1.0;
81 | }
82 | else{
83 | shadowed += pow(1.0 - coeff/(top-bottom), 0.5);
84 | }
85 | */
86 | }
87 | }
88 | shadowed = shadowed / 16.0;
89 |
90 | float lambert = pow(max(0.0, dot(normal, lightdir)), 0.5);
91 | //vec4 occlusion = texture2D(occlusionmap, gl_FragCoord.xy/viewport);
92 |
93 | vec4 lit_diffuse = pow(textureCube(diffuse_sun, normal), vec4(2.2));
94 | vec4 shadow_diffuse = pow(textureCube(diffuse_env, normal), vec4(2.2));
95 |
96 | vec3 specular_normal = reflect(eye_normal, normal);
97 |
98 | vec4 lit_specular = pow(textureCube(specular_sun, specular_normal), vec4(2.2));
99 | vec4 shadow_specular = pow(textureCube(specular_env, specular_normal), vec4(2.2));
100 | float specular_extinction = 1.0 - max(0.0, pow(dot(-eye_normal, normal), 0.5));
101 |
102 | vec3 diffuse_material = texture2D(diffuse_texture, v_texcoord).rgb;
103 | vec3 specular_material = mix(diffuse_material, vec3(1.0), 0.75);
104 | float specular_factor = texture2D(specular_texture, v_texcoord).r;
105 |
106 | vec3 diffuse_color = mix(shadow_diffuse, lit_diffuse, shadowed*lambert).rgb;
107 | vec3 specular_color = mix(shadow_specular, lit_specular, shadowed*lambert).rgb;
108 | //vec3 color = mix(diffuse_material*diffuse_color, specular_material*specular_color, specular_factor);
109 | vec3 color = diffuse_material*diffuse_color + specular_material*specular_color*specular_factor;
110 | gl_FragColor = vec4(pow(color, vec3(1.0/2.2)), 1.0);
111 | }
112 |
--------------------------------------------------------------------------------
/ssao/gd.2.backup.shader:
--------------------------------------------------------------------------------
1 | /*
2 | :copyright: 2011 by Florian Boesch .
3 | :license: GNU AGPL3, see LICENSE for more details.
4 | */
5 | vertex:
6 | attribute vec3 position;
7 | attribute vec2 texcoord;
8 | varying vec2 uv;
9 |
10 | void main(void) {
11 | gl_Position = vec4(position, 1.0);
12 | uv = texcoord;
13 | }
14 |
15 | fragment:
16 | #define sample_count 8
17 |
18 | uniform sampler2D normaldepth, normalmap;
19 | uniform samplerCube environment;
20 | #ifdef random_reflect
21 | uniform sampler2D random;
22 | #endif
23 |
24 | uniform float radius, near, far, random_size;
25 | uniform float dist_factor, dist_power;
26 | uniform float occlusion_factor, occlusion_power;
27 | uniform float sample_factor, sample_power;
28 |
29 | uniform vec2 viewport;
30 | uniform vec3 samples[sample_count];
31 | uniform mat4 proj, inv_proj;
32 | uniform mat3 rot, inv_rot;
33 | varying vec2 uv;
34 |
35 | vec3 decode_normal(vec2 enc){
36 | vec2 fenc = enc*4.0-2.0;
37 | float f = dot(fenc,fenc);
38 | float g = sqrt(1.0-f/4.0);
39 | return vec3(fenc*g, 1.0-f/2.0);
40 | }
41 |
42 | float decode_depth(vec2 src){
43 | float depth = src.x/255.0+src.y;
44 | return depth*far+near;
45 | }
46 |
47 | vec2 get_uv(vec3 pos){
48 | vec4 device = proj * vec4(pos, 1.0);
49 | vec4 device_norm = device/device.w;
50 | return (device_norm.xy+1.0)*0.5;
51 | }
52 |
53 | vec3 get_vec(vec2 uv){
54 | vec2 device = (uv*2.0)-1.0;
55 | return normalize((inv_proj * vec4(device.xy, -1.0, 1.0)).xyz);
56 | }
57 |
58 | void main(void){
59 | vec3 eye_ray = get_vec(uv);
60 | vec4 eye_data = texture2D(normaldepth, uv);
61 | vec3 eye_normal = decode_normal(eye_data.xy);
62 | //vec3 eye_normal = (texture2D(normalmap, uv).xyz-0.5)*2.0;
63 | float eye_depth = decode_depth(eye_data.zw);
64 | vec3 eye_pos = eye_depth * eye_ray;
65 |
66 | #ifdef random_reflect
67 | vec3 random_vec = (texture2D(random, gl_FragCoord.xy/random_size).xyz-0.5)*2.0;
68 | #endif
69 |
70 | //float occlusion = 0.0;
71 | float divider = 0.0;
72 | vec3 irradiance = vec3(0);
73 |
74 | for(int i=0; i 0.0){
106 | occlusion = 0.0;
107 | }
108 | else{
109 | //occlusion = lambert*pow(dist, dist_power)*pow(len, sample_power)*occlusion_factor;
110 | //occlusion = pow(dist, dist_power)*pow(len, sample_power)*occlusion_factor;
111 | occlusion = pow(dist, dist_power)*occlusion_factor*lambert;
112 | }
113 | //occlusion += lambert*pow(dist, dist_power)*pow(len, sample_power);
114 | divider += lambert;
115 | //vec3 color = textureCube(environment, normalize(sample_offset)).rgb;
116 | //irradiance += textureCube(environment, inv_rot * normalize(sample_offset)).rgb * (1.0 - occlusion) * lambert;
117 | //irradiance += color * lambert;
118 | //irradiance += color * (1.0 - occlusion) * lambert;
119 | irradiance += (1.0 - occlusion) * lambert;
120 | }
121 |
122 | //occlusion = clamp(occlusion/divider, 0.0, 1.0);
123 | //occlusion /= float(sample_count);
124 | irradiance /= divider;
125 | //gl_FragColor = vec4(vec3(1.0-pow(occlusion*occlusion_factor, occlusion_power)), 1.0);
126 | gl_FragColor = vec4(irradiance, 1.0);
127 | //gl_FragColor = vec4((eye_normal+1.0)*0.5, 1.0);
128 | }
129 |
--------------------------------------------------------------------------------