summaryrefslogtreecommitdiffhomepage
path: root/examples/resources/shaders/bloom.fs
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2015-09-02 01:06:55 +0200
committerraysan5 <[email protected]>2015-09-02 01:06:55 +0200
commit9a578c59624f671418a1f3b046b6b09aa4233909 (patch)
tree9394a7458d11ea59f62fdf5b50d0669a5df425fd /examples/resources/shaders/bloom.fs
parent0a345a6128de40229638c66ceb37728ae7e5f0c5 (diff)
downloadraylib-9a578c59624f671418a1f3b046b6b09aa4233909.tar.gz
raylib-9a578c59624f671418a1f3b046b6b09aa4233909.zip
Added shaders examples resources
Diffstat (limited to 'examples/resources/shaders/bloom.fs')
-rw-r--r--examples/resources/shaders/bloom.fs42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/resources/shaders/bloom.fs b/examples/resources/shaders/bloom.fs
new file mode 100644
index 00000000..f9cebe18
--- /dev/null
+++ b/examples/resources/shaders/bloom.fs
@@ -0,0 +1,42 @@
+#version 330
+
+in vec2 fragTexCoord;
+
+out vec4 fragColor;
+
+uniform sampler2D texture0;
+uniform vec4 tintColor;
+
+// NOTE: Add here your custom variables
+
+void main()
+{
+ vec4 sum = vec4(0);
+ vec4 tc = vec4(0);
+
+ for (int i = -4; i < 4; i++)
+ {
+ for (int j = -3; j < 3; j++)
+ {
+ sum += texture2D(texture0, fragTexCoord + vec2(j, i)*0.004) * 0.25;
+ }
+ }
+
+ if (texture2D(texture0, fragTexCoord).r < 0.3)
+ {
+ tc = sum*sum*0.012 + texture2D(texture0, fragTexCoord);
+ }
+ else
+ {
+ if (texture2D(texture0, fragTexCoord).r < 0.5)
+ {
+ tc = sum*sum*0.009 + texture2D(texture0, fragTexCoord);
+ }
+ else
+ {
+ tc = sum*sum*0.0075 + texture2D(texture0, fragTexCoord);
+ }
+ }
+
+ fragColor = tc;
+} \ No newline at end of file