The unofficial BSNES pixel shader thread
The unofficial BSNES pixel shader thread
Okay here's where all discussions on hardware based filters using shaders for BSNES are based. (whether they are technically based or not)
For those that don't know, I worked out a simple method to get shaders working under BSNES (any version). All it involves is this pack, and the enclosed patch..
To use shaders:
* Apply the patch
* Copy one shader file (shader.fx) to the same directory as BSNES.
For those that don't know, I worked out a simple method to get shaders working under BSNES (any version). All it involves is this pack, and the enclosed patch..
To use shaders:
* Apply the patch
* Copy one shader file (shader.fx) to the same directory as BSNES.
Last edited by mudlord on Thu Jun 05, 2008 11:51 am, edited 5 times in total.
-
- Regular
- Posts: 347
- Joined: Tue Mar 07, 2006 10:32 am
- Location: The Netherlands
The only difference between a shader and a normal filter is that a shaders are computed using your graphics card's shading units rather than your CPU. This means you need a graphics card that supports shader version 1.4 or higher to use them. The advantage is, of course, to offload the task of filtering to the GPU, leaving your CPU to deal with the task of emulating the SNES (and running your operating system
).
Edit: changed 'version 2 or higher' to 'version 1.4 or higher'.

Edit: changed 'version 2 or higher' to 'version 1.4 or higher'.
Last edited by Verdauga Greeneyes on Mon Mar 24, 2008 1:47 pm, edited 1 time in total.
EDIT: Bet me to it, Verdauga Greeneyes

Just a note, you can do Shader Model 1.4 shadersThe only difference between a shader and a normal filter is that a shaders are computed using your graphics card's shading units rather than your CPU. This means you need a graphics card that supports shader version 2 or higher to use them.

-
- Regular
- Posts: 347
- Joined: Tue Mar 07, 2006 10:32 am
- Location: The Netherlands
Aah, so that's the version I was looking formudlord wrote:Just a note, you can do Shader Model 1.4 shaders

Edit: by the way, do you think it would be possible to add debugging messages to the implementation? Right now it just fails silently, which can be frustrating for more complex shaders.
Yeah, okay, I'll make a simple logger that logs to a logfile the execution.by the way, do you think it would be possible to add debugging messages to the implementation? Right now it just fails silently, which can be frustrating for more complex shaders.
If you can do shaders in DX8.1 shader style ASM, be my guest. Otherwise its best to use PS 2.0, if you rather use plain HLSL instead of ASM.Should I make my scanline shader use PS 1.4?
-
- Regular
- Posts: 347
- Joined: Tue Mar 07, 2006 10:32 am
- Location: The Netherlands
Has anyone done any side by side testing to see what, if any, difference this is making for performance/quality?
There's a little voice in my head that says "this sounds like a cool idea" but I'm a sucker for placebos.
There's a little voice in my head that says "this sounds like a cool idea" but I'm a sucker for placebos.
Last edited by Palin on Mon Mar 24, 2008 6:47 pm, edited 2 times in total.
-
- Regular
- Posts: 347
- Joined: Tue Mar 07, 2006 10:32 am
- Location: The Netherlands
In general mudlord's wrapper DLL seems to be slowing bsnes down by about 2fps for me. That said, as long as the graphics card can perform the filtering fast enough, that should be the extent of the speed hit; whereas enabling the more complex filters in bsnes slows it down significantly. Shaders also offer the advantage that they are distributed separately from bsnes, so licensing should be less of an issue. For instance, I should be able to whip up a 2xSaI shader pretty quickly. It's still worth talking about licensing issues, but it won't effect bsnes directly. To get back to your question, speed-wise it offers an advantage iff (if and only if) we can make fast shaders for the more complex filters; right now that makes it hard to testPalin wrote:Has anyone done any side by side testing to see what, if any, difference this is making for performance/quality?
There's a little voice in my head that says "this sounds like a cool idea" but I'm a sucker for placebos.

There's little I can do about that, unfortunately.I do suffer about an 8% performance hit when I use them though.
That said, for the people interested in how it works in detail, it uses derived classes of IDirect3DDevice9 and IDirect3D9, with modified functions for Present(), CreateDevice(), SetFVF(), and SetRenderTarget().
I'm hoping to add a timer uniform to allow for realtime effects, such as wave cycling.....Whoa, talk about simulating a "play while drunk" situation
I managed to make the DLL popup a small error message box when theres a error in shader syntax, pointing out the exact issueTo get back to your question, speed-wise it offers an advantage iff (if and only if) we can make fast shaders for the more complex filters; right now that makes it hard to test


I'll upload the updated DLL when I can.
-
- Trooper
- Posts: 394
- Joined: Mon Feb 20, 2006 3:11 am
- Location: Space
Kinda reminds me of the drunk/drugged Yoshi in SMW2.Palin wrote:Ok, after downloading this looks like a sort of proof of concept. I'm impressed. I do suffer about an 8% performance hit when I use them though.
Haha, I need to play all of my games like this.
[url=http://www.eidolons-inn.net/tiki-index.php?page=Kega]Kega Fusion Supporter[/url] | [url=http://byuu.cinnamonpirate.com/]bsnes Supporter[/url] | [url=http://aamirm.hacking-cult.org/]Regen Supporter[/url]
-
- Buzzkill Gil
- Posts: 4295
- Joined: Wed Jan 12, 2005 7:14 pm
I said it in the monster thread, and I'll say it here...King Of Chaos wrote:Kinda reminds me of the drunk/drugged Yoshi in SMW2.Palin wrote:Ok, after downloading this looks like a sort of proof of concept. I'm impressed. I do suffer about an 8% performance hit when I use them though.
Haha, I need to play all of my games like this.
Touch Fuzzy, get dizzy!
Sorry, just wanted to get in on quoting the large JPEG.Gil_Hamilton wrote:I said it in the monster thread, and I'll say it here...King Of Chaos wrote:Kinda reminds me of the drunk/drugged Yoshi in SMW2.Palin wrote:Ok, after downloading this looks like a sort of proof of concept. I'm impressed. I do suffer about an 8% performance hit when I use them though.
Haha, I need to play all of my games like this.
Touch Fuzzy, get dizzy!
While we're at it ...


There we go, much better.
-
- Seen it all
- Posts: 2302
- Joined: Mon Jan 03, 2005 5:04 pm
- Location: Germany
- Contact:
-
- Regular
- Posts: 347
- Joined: Tue Mar 07, 2006 10:32 am
- Location: The Netherlands
Hehe, trippy; thanks for the update. How does the new Timer work? I looked at your wave shader, but all it seems to do is initialise it to 1. Does this assignment happen only once, at the start of execution, or is it a periodic thing? Does the Timer increase every frame, and does it use modulus or does it simply overflow from time to time?mudlord wrote:Update one up.
Includes a new wave shader with dynamic alteration.
Word of warning about this shader: It can mess with your head in games like SMW. Please don't blame me if you keep losing.
Oh, and could you put a list of Uniforms in either the first post or a readme in the shaderpack? (perhaps that would be the best place to answer my questions about the timer, too)
Code: Select all
effect->SetFloat(timehandle,Timer);
int nTime = timeGetTime();
nTimeElapsed += nTime - nTimeStart;
nTimeStart = nTime;
if(nTimeElapsed > 100)
{
nTimeElapsed = 0;
Timer += 0.01f;
}
Yup, its initialised at the start of execution.looked at your wave shader, but all it seems to do is initialise it to 1. Does this assignment happen only once, at the start of execution, or is it a periodic thing?
Sure.Oh, and could you put a list of Uniforms in either the first post or a readme in the shaderpack? (perhaps that would be the best place to answer my questions about the timer, too)
-
- Regular
- Posts: 347
- Joined: Tue Mar 07, 2006 10:32 am
- Location: The Netherlands
Many thanks for the readme, should help a bundle.
'This contains the results of the previous pass. In the first pass, it will contain the results of the last but one pass from the previous frame.'
So.. technically, we should be able to interpolate two subsequent frames? Perhaps a topic of future discussion.. (though I bet we'd need at least a framerate counter or some such to make anything useful with it)
One last request, because I forgot it wasn't in there (you posted the list before on bsnes' mother thread): could you add a uniform that holds the size of tex1? tex2's size is the screen resolution, I presume, which is already provided for.
'This contains the results of the previous pass. In the first pass, it will contain the results of the last but one pass from the previous frame.'
So.. technically, we should be able to interpolate two subsequent frames? Perhaps a topic of future discussion.. (though I bet we'd need at least a framerate counter or some such to make anything useful with it)
One last request, because I forgot it wasn't in there (you posted the list before on bsnes' mother thread): could you add a uniform that holds the size of tex1? tex2's size is the screen resolution, I presume, which is already provided for.
-
- Trooper
- Posts: 376
- Joined: Tue Apr 19, 2005 11:08 pm
- Location: DFW area, TX USA
- Contact:
I'd very much like to try a scanline shader if someone can make it.
BTW I notice no "sharpening" of the image when I use the sharpen shader. Perhaps it doesn't work with point filtering?
I did confirm the shaders do work on my system by testing the drunken wave one. That's a Vista 64-bit test done for ya
BTW I notice no "sharpening" of the image when I use the sharpen shader. Perhaps it doesn't work with point filtering?
I did confirm the shaders do work on my system by testing the drunken wave one. That's a Vista 64-bit test done for ya
