diff options
Diffstat (limited to 'macosx')
| -rwxr-xr-x[-rw-r--r--] | macosx/EmuThread.m | 810 | ||||
| -rwxr-xr-x | macosx/plugins/DFXVideo/gpuPeteOGL2.slf | 70 | ||||
| -rwxr-xr-x | macosx/plugins/DFXVideo/gpuPeteOGL2.slv | 52 |
3 files changed, 466 insertions, 466 deletions
diff --git a/macosx/EmuThread.m b/macosx/EmuThread.m index b2ca8d5e..2c34bfa4 100644..100755 --- a/macosx/EmuThread.m +++ b/macosx/EmuThread.m @@ -1,405 +1,405 @@ -//
-// EmuThread.m
-// Pcsxr
-//
-// Created by Gil Pedersen on Sun Sep 21 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
-
-#import <ExceptionHandling/NSExceptionHandler.h>
-#import <AppKit/NSApplication.h>
-#include <pthread.h>
-#include <setjmp.h>
-#import "EmuThread.h"
-#include "psxcommon.h"
-#include "plugins.h"
-#include "misc.h"
-
-EmuThread *emuThread;
-NSString *defrostPath = nil;
-static int safeEvent;
-static int paused;
-static int runbios;
-
-static pthread_cond_t eventCond;
-static pthread_mutex_t eventMutex;
-
-#define EMUEVENT_NONE 0
-#define EMUEVENT_PAUSE (1<<0)
-#define EMUEVENT_RESET (1<<1)
-#define EMUEVENT_STOP (1<<2)
-
-static NSString *ThreadInfo = @"PSX Emu Background thread";
-
-@implementation EmuThread
-
-- (void)EmuThreadRun:(id)anObject
-{
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
-
- [[NSThread currentThread] setName:ThreadInfo];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(emuWindowDidClose:)
- name:@"emuWindowDidClose" object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(emuWindowWantPause:)
- name:@"emuWindowWantPause" object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(emuWindowWantResume:)
- name:@"emuWindowWantResume" object:nil];
-
- // we shouldn't change the priority, since we might depend on subthreads
- //[NSThread setThreadPriority:1.0-((1.0-[NSThread threadPriority])/4.0)];
-
- // Do processing here
- if (OpenPlugins() == -1)
- goto done;
-
- setjmp(restartJmp);
-
- int res = CheckCdrom();
- if (res == -1) {
- ClosePlugins();
- SysMessage(_("Could not check CD-ROM!\n"));
- goto done;
- }
-
- // Auto-detect: region first, then rcnt reset
- EmuReset();
-
- LoadCdrom();
-
- if (defrostPath) {
- LoadState([defrostPath fileSystemRepresentation]);
- [defrostPath release]; defrostPath = nil;
- }
-
- psxCpu->Execute();
-
-done:
- [pool drain];
- emuThread = nil;
-
- return;
-}
-
-- (void)EmuThreadRunBios:(id)anObject
-{
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
-
- [[NSThread currentThread] setName:ThreadInfo];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(emuWindowDidClose:)
- name:@"emuWindowDidClose" object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(emuWindowWantPause:)
- name:@"emuWindowWantPause" object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(emuWindowWantResume:)
- name:@"emuWindowWantResume" object:nil];
-
- // we shouldn't change the priority, since we might depend on subthreads
- //[NSThread setThreadPriority:1.0-((1.0-[NSThread threadPriority])/4.0)];
-
- // Do processing here
- if (OpenPlugins() == -1)
- goto done;
-
- EmuReset();
-
- psxCpu->Execute();
-
-done:
- [pool drain];
- emuThread = nil;
-
- return;
-}
-
-- (void)dealloc
-{
- // remove all registered observers
- [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:nil];
-
- [super dealloc];
-}
-
-- (void)emuWindowDidClose:(NSNotification *)aNotification
-{
- [EmuThread stop];
-}
-
-- (void)emuWindowWantPause:(NSNotification *)aNotification
-{
- wasPaused = [EmuThread pause];
-}
-
-- (void)emuWindowWantResume:(NSNotification *)aNotification
-{
- if (!wasPaused) {
- [EmuThread resume];
- }
- wasPaused = NO;
-}
-
-/* called periodically from the emulation thread */
-- (void)handleEvents
-{
- /* only do a trylock here, since we're not interested in blocking,
- and we can just handle events next time round */
- if (pthread_mutex_trylock(&eventMutex) == 0) {
- while (safeEvent) {
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
- if (safeEvent & EMUEVENT_STOP) {
- /* signify that the emulation has stopped */
- [emuThread autorelease];
- emuThread = nil;
- paused = NO;
-
- /* better unlock the mutex before killing ourself */
- pthread_mutex_unlock(&eventMutex);
-
- ClosePlugins();
- SysClose();
-
- //[[NSThread currentThread] autorelease];
- [pool drain];
- [NSThread exit];
- return;
- }
-
- if (safeEvent & EMUEVENT_RESET) {
-#if 0
- /* signify that the emulation has stopped */
- [emuThread autorelease];
- emuThread = nil;
-
- /* better unlock the mutex before killing ourself */
- pthread_mutex_unlock(&eventMutex);
-
- ClosePlugins();
-
- // start a new emulation thread
- [EmuThread run];
-
- //[[NSThread currentThread] autorelease];
- [NSThread exit];
- return;
-#else
- safeEvent &= ~EMUEVENT_RESET;
- pthread_mutex_unlock(&eventMutex);
-
- longjmp(restartJmp, 0);
-#endif
- }
-
- if (safeEvent & EMUEVENT_PAUSE) {
- paused = 2;
- /* wait until we're signalled */
- pthread_cond_wait(&eventCond, &eventMutex);
- }
- [pool drain];
- }
- pthread_mutex_unlock(&eventMutex);
- }
-}
-
-+ (void)run
-{
- int err;
-
- if (emuThread) {
- [EmuThread resume];
- return;
- }
-
- if (pthread_mutex_lock(&eventMutex) != 0) {
- err = pthread_cond_init(&eventCond, NULL);
- if (err) return;
-
- err = pthread_mutex_init(&eventMutex, NULL);
- if (err) return;
-
- pthread_mutex_lock(&eventMutex);
- }
-
- safeEvent = EMUEVENT_NONE;
- paused = NO;
- runbios = NO;
-
- if (SysInit() != 0) {
- pthread_mutex_unlock(&eventMutex);
- return;
- }
-
- emuThread = [[EmuThread alloc] init];
-
- [NSThread detachNewThreadSelector:@selector(EmuThreadRun:)
- toTarget:emuThread withObject:nil];
-
- pthread_mutex_unlock(&eventMutex);
-}
-
-+ (void)runBios
-{
- int err;
-
- if (emuThread) {
- [EmuThread resume];
- return;
- }
-
- if (pthread_mutex_lock(&eventMutex) != 0) {
- err = pthread_cond_init(&eventCond, NULL);
- if (err) return;
-
- err = pthread_mutex_init(&eventMutex, NULL);
- if (err) return;
-
- pthread_mutex_lock(&eventMutex);
- }
-
- safeEvent = EMUEVENT_NONE;
- paused = NO;
- runbios = YES;
-
- if (SysInit() != 0) {
- pthread_mutex_unlock(&eventMutex);
- return;
- }
-
- emuThread = [[EmuThread alloc] init];
-
- [NSThread detachNewThreadSelector:@selector(EmuThreadRunBios:)
- toTarget:emuThread withObject:nil];
-
- pthread_mutex_unlock(&eventMutex);
-}
-
-+ (void)stop
-{
- pthread_mutex_lock(&eventMutex);
- safeEvent = EMUEVENT_STOP;
- pthread_mutex_unlock(&eventMutex);
-
- // wake it if it's sleeping
- pthread_cond_broadcast(&eventCond);
-}
-
-+ (BOOL)pause
-{
- if (paused || ![EmuThread active])
- return YES;
-
- pthread_mutex_lock(&eventMutex);
- safeEvent |= EMUEVENT_PAUSE;
- paused = 1;
- pthread_mutex_unlock(&eventMutex);
-
- pthread_cond_broadcast(&eventCond);
-
- return NO;
-}
-
-+ (BOOL)pauseSafe
-{
- if ((paused == 2) || ![EmuThread active])
- return YES;
-
- [EmuThread pause];
- while ([EmuThread isPaused] != 2) [NSThread sleepUntilDate:[[NSDate date] addTimeInterval:0.05]];
-
- return NO;
-}
-
-+ (void)resume
-{
- if (!paused || ![EmuThread active])
- return;
-
- pthread_mutex_lock(&eventMutex);
-
- safeEvent &= ~EMUEVENT_PAUSE;
- paused = NO;
- pthread_mutex_unlock(&eventMutex);
-
- pthread_cond_broadcast(&eventCond);
-}
-
-+ (void)reset
-{
- pthread_mutex_lock(&eventMutex);
- safeEvent = EMUEVENT_RESET;
- pthread_mutex_unlock(&eventMutex);
-
- pthread_cond_broadcast(&eventCond);
-}
-
-// must only be called from within the emulation thread!!!
-+ (void)resetNow
-{
- /* signify that the emulation has stopped */
- [emuThread autorelease];
- emuThread = nil;
-
- ClosePlugins();
-
- // start a new emulation thread
- [EmuThread run];
-
- //[[NSThread currentThread] autorelease];
- [NSThread exit];
- return;
-}
-
-+ (BOOL)isPaused
-{
- return paused;
-}
-
-+ (BOOL)isRunBios
-{
- return runbios;
-}
-
-+ (BOOL)active
-{
- return emuThread ? YES : NO;
-}
-
-+ (void)freezeAt:(NSString *)path which:(int)num
-{
- BOOL emuWasPaused = [EmuThread pauseSafe];
- char Text[256];
-
- GPU_freeze(2, (GPUFreeze_t *)&num);
- int ret = SaveState([path fileSystemRepresentation]);
- if (ret == 0) sprintf (Text, _("*PCSXR*: Saved State %d"), num+1);
- else sprintf (Text, _("*PCSXR*: Error Saving State %d"), num+1);
- GPU_displayText(Text);
-
- if (!emuWasPaused) {
- [EmuThread resume];
- }
-}
-
-+ (BOOL)defrostAt:(NSString *)path
-{
- const char *cPath = [path fileSystemRepresentation];
- if (CheckState(cPath) != 0)
- return NO;
-
- defrostPath = [path retain];
- [EmuThread reset];
-
- GPU_displayText(_("*PCSXR*: Loaded State"));
- return YES;
-}
-
-@end
+// +// EmuThread.m +// Pcsxr +// +// Created by Gil Pedersen on Sun Sep 21 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import <ExceptionHandling/NSExceptionHandler.h> +#import <AppKit/NSApplication.h> +#include <pthread.h> +#include <setjmp.h> +#import "EmuThread.h" +#include "psxcommon.h" +#include "plugins.h" +#include "misc.h" + +EmuThread *emuThread; +NSString *defrostPath = nil; +static int safeEvent; +static int paused; +static int runbios; + +static pthread_cond_t eventCond; +static pthread_mutex_t eventMutex; + +#define EMUEVENT_NONE 0 +#define EMUEVENT_PAUSE (1<<0) +#define EMUEVENT_RESET (1<<1) +#define EMUEVENT_STOP (1<<2) + +static NSString *ThreadInfo = @"PSX Emu Background thread"; + +@implementation EmuThread + +- (void)EmuThreadRun:(id)anObject +{ + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + + [[NSThread currentThread] setName:ThreadInfo]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(emuWindowDidClose:) + name:@"emuWindowDidClose" object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(emuWindowWantPause:) + name:@"emuWindowWantPause" object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(emuWindowWantResume:) + name:@"emuWindowWantResume" object:nil]; + + // we shouldn't change the priority, since we might depend on subthreads + //[NSThread setThreadPriority:1.0-((1.0-[NSThread threadPriority])/4.0)]; + + // Do processing here + if (OpenPlugins() == -1) + goto done; + + setjmp(restartJmp); + + int res = CheckCdrom(); + if (res == -1) { + ClosePlugins(); + SysMessage(_("Could not check CD-ROM!\n")); + goto done; + } + + // Auto-detect: region first, then rcnt reset + EmuReset(); + + LoadCdrom(); + + if (defrostPath) { + LoadState([defrostPath fileSystemRepresentation]); + [defrostPath release]; defrostPath = nil; + } + + psxCpu->Execute(); + +done: + [pool drain]; + emuThread = nil; + + return; +} + +- (void)EmuThreadRunBios:(id)anObject +{ + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + + [[NSThread currentThread] setName:ThreadInfo]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(emuWindowDidClose:) + name:@"emuWindowDidClose" object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(emuWindowWantPause:) + name:@"emuWindowWantPause" object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(emuWindowWantResume:) + name:@"emuWindowWantResume" object:nil]; + + // we shouldn't change the priority, since we might depend on subthreads + //[NSThread setThreadPriority:1.0-((1.0-[NSThread threadPriority])/4.0)]; + + // Do processing here + if (OpenPlugins() == -1) + goto done; + + EmuReset(); + + psxCpu->Execute(); + +done: + [pool drain]; + emuThread = nil; + + return; +} + +- (void)dealloc +{ + // remove all registered observers + [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:nil]; + + [super dealloc]; +} + +- (void)emuWindowDidClose:(NSNotification *)aNotification +{ + [EmuThread stop]; +} + +- (void)emuWindowWantPause:(NSNotification *)aNotification +{ + wasPaused = [EmuThread pause]; +} + +- (void)emuWindowWantResume:(NSNotification *)aNotification +{ + if (!wasPaused) { + [EmuThread resume]; + } + wasPaused = NO; +} + +/* called periodically from the emulation thread */ +- (void)handleEvents +{ + /* only do a trylock here, since we're not interested in blocking, + and we can just handle events next time round */ + if (pthread_mutex_trylock(&eventMutex) == 0) { + while (safeEvent) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + if (safeEvent & EMUEVENT_STOP) { + /* signify that the emulation has stopped */ + [emuThread autorelease]; + emuThread = nil; + paused = NO; + + /* better unlock the mutex before killing ourself */ + pthread_mutex_unlock(&eventMutex); + + ClosePlugins(); + SysClose(); + + //[[NSThread currentThread] autorelease]; + [pool drain]; + [NSThread exit]; + return; + } + + if (safeEvent & EMUEVENT_RESET) { +#if 0 + /* signify that the emulation has stopped */ + [emuThread autorelease]; + emuThread = nil; + + /* better unlock the mutex before killing ourself */ + pthread_mutex_unlock(&eventMutex); + + ClosePlugins(); + + // start a new emulation thread + [EmuThread run]; + + //[[NSThread currentThread] autorelease]; + [NSThread exit]; + return; +#else + safeEvent &= ~EMUEVENT_RESET; + pthread_mutex_unlock(&eventMutex); + + longjmp(restartJmp, 0); +#endif + } + + if (safeEvent & EMUEVENT_PAUSE) { + paused = 2; + /* wait until we're signalled */ + pthread_cond_wait(&eventCond, &eventMutex); + } + [pool drain]; + } + pthread_mutex_unlock(&eventMutex); + } +} + ++ (void)run +{ + int err; + + if (emuThread) { + [EmuThread resume]; + return; + } + + if (pthread_mutex_lock(&eventMutex) != 0) { + err = pthread_cond_init(&eventCond, NULL); + if (err) return; + + err = pthread_mutex_init(&eventMutex, NULL); + if (err) return; + + pthread_mutex_lock(&eventMutex); + } + + safeEvent = EMUEVENT_NONE; + paused = NO; + runbios = NO; + + if (SysInit() != 0) { + pthread_mutex_unlock(&eventMutex); + return; + } + + emuThread = [[EmuThread alloc] init]; + + [NSThread detachNewThreadSelector:@selector(EmuThreadRun:) + toTarget:emuThread withObject:nil]; + + pthread_mutex_unlock(&eventMutex); +} + ++ (void)runBios +{ + int err; + + if (emuThread) { + [EmuThread resume]; + return; + } + + if (pthread_mutex_lock(&eventMutex) != 0) { + err = pthread_cond_init(&eventCond, NULL); + if (err) return; + + err = pthread_mutex_init(&eventMutex, NULL); + if (err) return; + + pthread_mutex_lock(&eventMutex); + } + + safeEvent = EMUEVENT_NONE; + paused = NO; + runbios = YES; + + if (SysInit() != 0) { + pthread_mutex_unlock(&eventMutex); + return; + } + + emuThread = [[EmuThread alloc] init]; + + [NSThread detachNewThreadSelector:@selector(EmuThreadRunBios:) + toTarget:emuThread withObject:nil]; + + pthread_mutex_unlock(&eventMutex); +} + ++ (void)stop +{ + pthread_mutex_lock(&eventMutex); + safeEvent = EMUEVENT_STOP; + pthread_mutex_unlock(&eventMutex); + + // wake it if it's sleeping + pthread_cond_broadcast(&eventCond); +} + ++ (BOOL)pause +{ + if (paused || ![EmuThread active]) + return YES; + + pthread_mutex_lock(&eventMutex); + safeEvent |= EMUEVENT_PAUSE; + paused = 1; + pthread_mutex_unlock(&eventMutex); + + pthread_cond_broadcast(&eventCond); + + return NO; +} + ++ (BOOL)pauseSafe +{ + if ((paused == 2) || ![EmuThread active]) + return YES; + + [EmuThread pause]; + while ([EmuThread isPaused] != 2) [NSThread sleepUntilDate:[[NSDate date] addTimeInterval:0.05]]; + + return NO; +} + ++ (void)resume +{ + if (!paused || ![EmuThread active]) + return; + + pthread_mutex_lock(&eventMutex); + + safeEvent &= ~EMUEVENT_PAUSE; + paused = NO; + pthread_mutex_unlock(&eventMutex); + + pthread_cond_broadcast(&eventCond); +} + ++ (void)reset +{ + pthread_mutex_lock(&eventMutex); + safeEvent = EMUEVENT_RESET; + pthread_mutex_unlock(&eventMutex); + + pthread_cond_broadcast(&eventCond); +} + +// must only be called from within the emulation thread!!! ++ (void)resetNow +{ + /* signify that the emulation has stopped */ + [emuThread autorelease]; + emuThread = nil; + + ClosePlugins(); + + // start a new emulation thread + [EmuThread run]; + + //[[NSThread currentThread] autorelease]; + [NSThread exit]; + return; +} + ++ (BOOL)isPaused +{ + return paused; +} + ++ (BOOL)isRunBios +{ + return runbios; +} + ++ (BOOL)active +{ + return emuThread ? YES : NO; +} + ++ (void)freezeAt:(NSString *)path which:(int)num +{ + BOOL emuWasPaused = [EmuThread pauseSafe]; + char Text[256]; + + GPU_freeze(2, (GPUFreeze_t *)&num); + int ret = SaveState([path fileSystemRepresentation]); + if (ret == 0) sprintf (Text, _("*PCSXR*: Saved State %d"), num+1); + else sprintf (Text, _("*PCSXR*: Error Saving State %d"), num+1); + GPU_displayText(Text); + + if (!emuWasPaused) { + [EmuThread resume]; + } +} + ++ (BOOL)defrostAt:(NSString *)path +{ + const char *cPath = [path fileSystemRepresentation]; + if (CheckState(cPath) != 0) + return NO; + + defrostPath = [path retain]; + [EmuThread reset]; + + GPU_displayText(_("*PCSXR*: Loaded State")); + return YES; +} + +@end diff --git a/macosx/plugins/DFXVideo/gpuPeteOGL2.slf b/macosx/plugins/DFXVideo/gpuPeteOGL2.slf index 08e77b18..c9c63d1a 100755 --- a/macosx/plugins/DFXVideo/gpuPeteOGL2.slf +++ b/macosx/plugins/DFXVideo/gpuPeteOGL2.slf @@ -1,35 +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));
-}
+// 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)); +} diff --git a/macosx/plugins/DFXVideo/gpuPeteOGL2.slv b/macosx/plugins/DFXVideo/gpuPeteOGL2.slv index 639eb41c..49f6bd27 100755 --- a/macosx/plugins/DFXVideo/gpuPeteOGL2.slv +++ b/macosx/plugins/DFXVideo/gpuPeteOGL2.slv @@ -1,26 +1,26 @@ -// by guest(r) - guest.r@gmail.com
-// license: GNU-GPL
-
-uniform vec4 OGL2Param;
-uniform vec4 OGL2Size;
-
-void main()
-{
-float x = (OGL2Size.x/2048.0)*OGL2Param.x;
-float y = (OGL2Size.y/1024.0)*OGL2Param.y;
-vec2 dg1 = vec2( x,y);
-vec2 dg2 = vec2(-x,y);
-vec2 dx = vec2(x,0.0);
-vec2 dy = vec2(0.0,y);
-gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-gl_TexCoord[0] = gl_MultiTexCoord0;
-gl_TexCoord[6].zw= gl_MultiTexCoord1.xy;
-gl_TexCoord[1].xy = gl_TexCoord[0].xy - dy;
-gl_TexCoord[2].xy = gl_TexCoord[0].xy + dy;
-gl_TexCoord[3].xy = gl_TexCoord[0].xy - dx;
-gl_TexCoord[4].xy = gl_TexCoord[0].xy + dx;
-gl_TexCoord[5].xy = gl_TexCoord[0].xy - dg1;
-gl_TexCoord[6].xy = gl_TexCoord[0].xy + dg1;
-gl_TexCoord[1].zw = gl_TexCoord[0].xy - dg2;
-gl_TexCoord[2].zw = gl_TexCoord[0].xy + dg2;
-}
+// by guest(r) - guest.r@gmail.com +// license: GNU-GPL + +uniform vec4 OGL2Param; +uniform vec4 OGL2Size; + +void main() +{ +float x = (OGL2Size.x/2048.0)*OGL2Param.x; +float y = (OGL2Size.y/1024.0)*OGL2Param.y; +vec2 dg1 = vec2( x,y); +vec2 dg2 = vec2(-x,y); +vec2 dx = vec2(x,0.0); +vec2 dy = vec2(0.0,y); +gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +gl_TexCoord[0] = gl_MultiTexCoord0; +gl_TexCoord[6].zw= gl_MultiTexCoord1.xy; +gl_TexCoord[1].xy = gl_TexCoord[0].xy - dy; +gl_TexCoord[2].xy = gl_TexCoord[0].xy + dy; +gl_TexCoord[3].xy = gl_TexCoord[0].xy - dx; +gl_TexCoord[4].xy = gl_TexCoord[0].xy + dx; +gl_TexCoord[5].xy = gl_TexCoord[0].xy - dg1; +gl_TexCoord[6].xy = gl_TexCoord[0].xy + dg1; +gl_TexCoord[1].zw = gl_TexCoord[0].xy - dg2; +gl_TexCoord[2].zw = gl_TexCoord[0].xy + dg2; +} |
