It seems byuu deserved all the hate ...
mudlord - Feb 22, 2008
Okay, I worked out a method for HLSL shaders for BSNES.
Go here and download the shader pack I compiled. Unzip d3d9.dll to the BSNES emulator directory. Unzip ONE shader entitled "fakehdr.fx" to the same BSNES directory (I put all the shaders in different groups to make them easier to identify). Make sure you have Direct3D rendering enabled and thats all. I only tested this with BSNES 0.17 and all my shaders (everything except the cel shading and HDR shader is my code) should work fine.
And here's one shader which I managed to write in a couple of minutes:
It might not look like much, but in action, its trippy has hell. Its a improvement on the "Waves" shader I got in the pack right now tho...
byuu - Mar 28, 2008
I'm actually rather disappointed by this whole thing. I had assumed it would be as simple as there just being D3D shaders and GL shaders, and they would just work across the board. The reality is quite different.
Direct3D:
- Supports HLSL and Cg. mudlord's d3d9.dll trick does not work on any of the six computers I own (8800 GTS, 7950 GT, nVidia Vanta, ATI X300LS, ATI X600 SE, ATI Mobility Radeon somethingorother)
- Overly complicated, and Windows only
OpenGL:
- Supports GLSL, ARB and Cg.
- GLSL is easy, but requires OpenGL 2.0; missing by default on Windows (ships with 1.1, though video card drivers always have 2.0)
- GLSL has different bugs in every implementation; most shaders do not work at all, especially on Linux
- ARB requires crazy function pointer handles, and is already deprecated
- Cg is also very old and deprecated, also requires use of extensions; shaders are very uncommon for this
Direct3D and OpenGL:
- SM 1.1, 1.2, 1.3, 1.3, 2.0, 2.1, 3.0, 4.0, 4.1, ... they can't make up their minds how to design a fixed standard that doesn't get usurped within 3 months' time
Ultimately, this is all bullshit. Maybe it's better to just say fuck it and multi-thread the video rendering to use another CPU core. Pure C++ is much more powerful, and much more stable, than this shader bullshit anyway. Very few single core CPUs get 60fps with bsnes anyway.
Maybe someone can describe 2xSaI's algorithm to me so I can cleanroom implement it. I'll then release my implementation as public domain so everyone can use it.
mudlord - Mar 28, 2008
Quote:
Direct3D:
- Supports HLSL and Cg. mudlord's d3d9.dll trick does not work on any of the six computers I own (8800 GTS, 7950 GT, nVidia Vanta, ATI X300LS, ATI X600 SE, ATI Mobility Radeon somethingorother)
- Overly complicated, and Windows only
Shit...It should work on any card that supports:
* Shader Model 2.0
* Multiple render targets (MRT)
I find it completely odd it doesnt work with you with that 8800GTS.
Oh well, if you wanna fuck the idea, its your choice.
Same goes for GLSL shader implementation.
Quote:
But then, mudlord's solution is genius as it is universal to all D3D9 applications. I think it would be best to keep it external, and perhaps I can link directly to his page on the bsnes download page.
And in that case, I'll write up a small homepage for it on my serverspace. I'm sure Chrono Archangel won't mind (plus he gave me a super cool project proposal with the GC emu Gekko, so im on very good terms with him).
byuu - Mar 28, 2008
Quote:
Shit...It should work on any card that supports:
* Shader Model 2.0
* Multiple render targets (MRT)
I find it completely odd it doesnt work with you with that 8800GTS.
Yeah, it's extremely bizarre. I move the fakehdr.fx file to the same directory as bsnes.exe and d3d9.dll, and bsnes just closes as soon as it opens ... I only see the window appear for half a second or less. No error message, nothing.
A real shame, I really wanted to try out the wave shader
nVidia Vanta = Win2k
nVidia 8800 GTS = WinXP SP2 / x86
nVidia 7950 GT KO SC = WinXP SP2 / x86
nVidia 6200 onboard = Ubuntu only, can't test
ATI Radeon X300 LS = Windows Vista / x86
ATI Radeon X600 SE = WinXP SP2 / x86
ATI Radeon Mobility ???? = WinXP SP2 / x86
Quote:
Oh well, if you wanna fuck the idea, its your choice.
Same goes for GLSL shader implementation.
Well, the OpenGL version is just out. It isn't going to work worth a damn on Linux, and there's little I can do about that.
I really don't see it as being worthwhile to spend a lot of time implementing a shader loading subsystem when it will only be utilized by Direct3D9 and nothing else
Source: ZSNES board:
web.archive.org/web/20160421122008/snesemu.black-ship.net/misc/archives/bsnes_thread.zip
The zip folder contains a copy of posts dated Aug 31, 2005 through Apr 24, 2008
Check this out too: byuuarchive.blogspot.com . Enjoy!