diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-09-17 01:15:40 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-09-17 01:15:40 +0000 |
| commit | a4905ffaa0185235cc638098dae277f8abc0a56c (patch) | |
| tree | 03f508b54719c7af768a211e3655aada65577671 /macosx/plugins/DFXVideo/gpuPeteOGL2.slf | |
| parent | 8ddbbfe157a5ed6d52bb07dcbef2e9c5814e80e0 (diff) | |
| download | pcsxr-a4905ffaa0185235cc638098dae277f8abc0a56c.tar.gz | |
Updating projects to build on Xcode 4.4
Added OpenGL shader support to the Mac software renderer.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@79892 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFXVideo/gpuPeteOGL2.slf')
| -rwxr-xr-x | macosx/plugins/DFXVideo/gpuPeteOGL2.slf | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/macosx/plugins/DFXVideo/gpuPeteOGL2.slf b/macosx/plugins/DFXVideo/gpuPeteOGL2.slf new file mode 100755 index 00000000..08e77b18 --- /dev/null +++ b/macosx/plugins/DFXVideo/gpuPeteOGL2.slf @@ -0,0 +1,35 @@ +// ColoredStorybook shader
+// by guest(r)
+// License: GNU-GPL
+
+uniform sampler2D OGL2Texture;
+uniform sampler2D OGL2TMU1;
+
+void main()
+{
+ vec3 paper = texture2D(OGL2TMU1, gl_TexCoord[6].zw).xyz;
+ vec3 c00 = texture2D(OGL2Texture, gl_TexCoord[5].xy).xyz;
+ vec3 c10 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
+ vec3 c20 = texture2D(OGL2Texture, gl_TexCoord[2].zw).xyz;
+ vec3 c01 = texture2D(OGL2Texture, gl_TexCoord[3].xy).xyz;
+ vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
+ vec3 c21 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
+ vec3 c02 = texture2D(OGL2Texture, gl_TexCoord[1].zw).xyz;
+ vec3 c12 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
+ vec3 c22 = texture2D(OGL2Texture, gl_TexCoord[6].xy).xyz;
+ vec3 dt = vec3(1.0,1.0,1.0);
+
+ c11 = 0.25*(c11+0.5*(c10+c01+c12+c21)+0.25*(c02+c20+c00+c22));
+
+ float d1=dot(abs(c00-c22),dt);
+ float d2=dot(abs(c20-c02),dt);
+ float hl=dot(abs(c01-c21),dt);
+ float vl=dot(abs(c10-c12),dt);
+
+ float d = 0.60*(d1+d2+hl+vl)/(dot(c11,dt)+0.5);
+
+ d = 0.5*pow(d,0.5) + d;
+ c11 = (1.0-0.6*d)*c11;
+
+ gl_FragColor.xyz = mix(paper, c11, pow(max(min(d,1.1)-0.1,0.0),0.5));
+}
|
