Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'osx-yosemite' of ssh://github.com/skyjake/Doomsday-Engi…
…ne into packageloader
- Loading branch information
Showing
30 changed files
with
353 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 73 additions & 75 deletions
148
doomsday/client/data/net.dengine.pack/renderer.pack/shaders/fx/bloom.dei
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,87 @@ | ||
group fx { | ||
# Bloom is a specialized additive blur that only applies to bright pixels | ||
# (given a configurable threshold for brightness). | ||
group bloom { | ||
common = " | ||
uniform highp mat4 uMvpMatrix; | ||
uniform highp vec4 uColor; | ||
uniform highp vec4 uWindow; | ||
# Bloom is a specialized additive blur that only applies to bright pixels | ||
# (given a configurable threshold for brightness). | ||
group fx.bloom { | ||
common = " | ||
uniform highp mat4 uMvpMatrix; | ||
uniform highp vec4 uColor; | ||
uniform highp vec4 uWindow; | ||
|
||
attribute highp vec4 aVertex; | ||
attribute highp vec2 aUV; | ||
attribute highp vec4 aVertex; | ||
attribute highp vec2 aUV; | ||
|
||
varying highp vec2 vUV; | ||
|
||
void main(void) { | ||
gl_Position = uMvpMatrix * aVertex; | ||
vUV = uWindow.xy + aUV * uWindow.zw; | ||
}" | ||
|
||
shader horizontal { | ||
vertex $= fx.bloom.common | ||
fragment = " | ||
uniform sampler2D uTex; | ||
uniform highp float uIntensity; | ||
uniform highp float uThreshold; | ||
uniform highp vec2 uBlurStep; | ||
|
||
varying highp vec2 vUV; | ||
|
||
void main(void) { | ||
gl_Position = uMvpMatrix * aVertex; | ||
vUV = uWindow.xy + aUV * uWindow.zw; | ||
}" | ||
|
||
shader horizontal { | ||
vertex $= fx.bloom.common | ||
fragment = " | ||
uniform sampler2D uTex; | ||
uniform highp float uIntensity; | ||
uniform highp float uThreshold; | ||
uniform highp vec2 uBlurStep; | ||
highp vec4 sum = vec4(0.0); | ||
|
||
varying highp vec2 vUV; | ||
sum += texture2D(uTex, vec2(vUV.s - 7.0 * uBlurStep.s, vUV.t)) * 0.0249; | ||
sum += texture2D(uTex, vec2(vUV.s - 6.0 * uBlurStep.s, vUV.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s - 5.0 * uBlurStep.s, vUV.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s - 4.0 * uBlurStep.s, vUV.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s - 3.0 * uBlurStep.s, vUV.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s - 2.0 * uBlurStep.s, vUV.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s - uBlurStep.s, vUV.t)) * 0.0996; | ||
sum += texture2D(uTex, vUV) * 0.1027; | ||
sum += texture2D(uTex, vec2(vUV.s + uBlurStep.s, vUV.t)) * 0.0996; | ||
sum += texture2D(uTex, vec2(vUV.s + 2.0 * uBlurStep.s, vUV.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s + 3.0 * uBlurStep.s, vUV.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s + 4.0 * uBlurStep.s, vUV.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s + 5.0 * uBlurStep.s, vUV.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s + 6.0 * uBlurStep.s, vUV.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s + 7.0 * uBlurStep.s, vUV.t)) * 0.0249; | ||
|
||
void main(void) { | ||
highp vec4 sum = vec4(0.0); | ||
|
||
sum += texture2D(uTex, vec2(vUV.s - 7.0 * uBlurStep.s, vUV.t)) * 0.0249; | ||
sum += texture2D(uTex, vec2(vUV.s - 6.0 * uBlurStep.s, vUV.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s - 5.0 * uBlurStep.s, vUV.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s - 4.0 * uBlurStep.s, vUV.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s - 3.0 * uBlurStep.s, vUV.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s - 2.0 * uBlurStep.s, vUV.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s - uBlurStep.s, vUV.t)) * 0.0996; | ||
sum += texture2D(uTex, vUV) * 0.1027; | ||
sum += texture2D(uTex, vec2(vUV.s + uBlurStep.s, vUV.t)) * 0.0996; | ||
sum += texture2D(uTex, vec2(vUV.s + 2.0 * uBlurStep.s, vUV.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s + 3.0 * uBlurStep.s, vUV.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s + 4.0 * uBlurStep.s, vUV.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s + 5.0 * uBlurStep.s, vUV.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s + 6.0 * uBlurStep.s, vUV.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s + 7.0 * uBlurStep.s, vUV.t)) * 0.0249; | ||
// Apply a threshold that gets rid of dark, non-luminous pixels. | ||
highp float intens = max(sum.r, max(sum.g, sum.b)); | ||
|
||
intens = (intens - uThreshold) * uIntensity; | ||
|
||
// Apply a threshold that gets rid of dark, non-luminous pixels. | ||
highp float intens = max(sum.r, max(sum.g, sum.b)); | ||
|
||
intens = (intens - uThreshold) * uIntensity; | ||
gl_FragColor = vec4(vec3(intens) * normalize(sum.rgb + 0.2), 1.0); | ||
}" | ||
} | ||
|
||
shader vertical { | ||
vertex $= fx.bloom.common | ||
fragment = " | ||
uniform sampler2D uTex; | ||
uniform highp vec2 uBlurStep; | ||
|
||
gl_FragColor = vec4(vec3(intens) * normalize(sum.rgb + 0.2), 1.0); | ||
}" | ||
} | ||
|
||
shader vertical { | ||
vertex $= fx.bloom.common | ||
fragment = " | ||
uniform sampler2D uTex; | ||
uniform highp vec2 uBlurStep; | ||
varying highp vec2 vUV; | ||
|
||
varying highp vec2 vUV; | ||
void main(void) { | ||
highp vec4 sum = vec4(0.0); | ||
|
||
void main(void) { | ||
highp vec4 sum = vec4(0.0); | ||
|
||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 7.0 * uBlurStep.t)) * 0.0249; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 6.0 * uBlurStep.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 5.0 * uBlurStep.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 4.0 * uBlurStep.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 3.0 * uBlurStep.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 2.0 * uBlurStep.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - uBlurStep.t )) * 0.0996; | ||
sum += texture2D(uTex, vUV) * 0.1027; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + uBlurStep.t )) * 0.0996; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 2.0 * uBlurStep.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 3.0 * uBlurStep.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 4.0 * uBlurStep.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 5.0 * uBlurStep.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 6.0 * uBlurStep.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 7.0 * uBlurStep.t)) * 0.0249; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 7.0 * uBlurStep.t)) * 0.0249; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 6.0 * uBlurStep.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 5.0 * uBlurStep.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 4.0 * uBlurStep.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 3.0 * uBlurStep.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - 2.0 * uBlurStep.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t - uBlurStep.t )) * 0.0996; | ||
sum += texture2D(uTex, vUV) * 0.1027; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + uBlurStep.t )) * 0.0996; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 2.0 * uBlurStep.t)) * 0.0915; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 3.0 * uBlurStep.t)) * 0.0803; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 4.0 * uBlurStep.t)) * 0.0660; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 5.0 * uBlurStep.t)) * 0.0498; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 6.0 * uBlurStep.t)) * 0.0367; | ||
sum += texture2D(uTex, vec2(vUV.s, vUV.t + 7.0 * uBlurStep.t)) * 0.0249; | ||
|
||
gl_FragColor = sum; | ||
}" | ||
} | ||
gl_FragColor = sum; | ||
}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
doomsday/client/data/net.dengine.pack/ui.defaultstyle.pack/rules.dei
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.