• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › General Discussion v
« Previous 1 … 187 188 189 190 191 … 370 Next »

GLSL Shaders - CRT Emulating old televisions
View New Posts | View Today's Posts

Pages (4): 1 2 3 4 Next »
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
GLSL Shaders - CRT Emulating old televisions
05-13-2012, 11:40 PM
#1
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
Has anyone ported a CRT GLSL shader to Dolphin at all?

A good example would be the one discussed here

I've tried and failed to create a simple scanline based shader:

Code:
// lerp = mix

#define PI 3.14159265f

uniform samplerRECT samp0 : register(s0);

uniform float ScanlineAmount = 1.0f;
uniform float ScanlineScale = 1.0f;
uniform float ScanlineBrightScale = 1.0f;
uniform float ScanlineBrightOffset = 1.0f;
uniform float ScanlineOffset = 0.0f;
uniform float ScanlineHeight = 1.0f;
uniform float2 SourceDims = float2(640, 528);

void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
      float4 c0 = texRECT(samp0, uv0).rgba;

    float TargetWidth = SourceDims.x;
    float TargetHeight = SourceDims.y;

    float RawWidth = 1920;
    float RawHeight = 1080;

    float pixelRatio = RawHeight / SourceDims.y;

    float2 BaseCoord = uv0;
    
    float2 ScanCoord = BaseCoord - 0.5f / SourceDims;
    //float2 ScanCoord = BaseCoord;
    ScanCoord.y *= pixelRatio;

    float InnerSine = ScanCoord.y * RawHeight * ScanlineScale;
    float ScanBrightMod = sin(InnerSine * PI + ScanlineOffset * RawHeight);
    float4 ScanBrightness = mix(1.0f, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f) * 0.5f, ScanlineAmount);

      // output
    ocol0 = float4(c0 * ScanBrightness.xyz, c0.a);
}

but it has no effect. Sad
Find
Reply
05-13-2012, 11:48 PM
#2
Duke Nukem Offline
Banned
Posts: 1,724
Threads: 48
Joined: Mar 2011
This seems to be quite interesting.

Just watched some of the comparison screens from that thread and I liked what I saw.
This would be something I'd definitely would use if there is a solution.
Find
Reply
05-14-2012, 01:08 AM (This post was last modified: 05-14-2012, 01:09 AM by ProfEmu.)
#3
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
I started poking around with some sort of translation today by starting with a simple scanline emulation.

Would be useful to know why that doesn't work so I can use it as a base for converting the CRT code.

One thing that confused me is that I would get a popup window with a list of errors the first time I would run the code (can't covert from float3, etc.) but on subsequent runs this list no longer appears. It was certainly helpful for debugging so I'd like to know how I could get it back Smile
Find
Reply
05-14-2012, 02:22 AM (This post was last modified: 05-14-2012, 02:22 AM by neobrain.)
#4
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
(05-14-2012, 01:08 AM)ProfEmu Wrote: One thing that confused me is that I would get a popup window with a list of errors the first time I would run the code (can't covert from float3, etc.) but on subsequent runs this list no longer appears. It was certainly helpful for debugging so I'd like to know how I could get it back Smile
If you edit the Shutdown() function in Source/Plugins/Plugin_VideoOGL/Src/PostProcessing.cpp and add the line "s_currentShader = std:Confusedtring();" there, the error message should appear on all subsequent runs.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
05-14-2012, 05:38 AM (This post was last modified: 05-14-2012, 05:39 AM by ProfEmu.)
#5
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
Well I've followed the instructions on this page but I'm still getting a truck load of errors when trying to build.

Here are the unique errors:

Code:
Error    24    error C1083: Cannot open include file: 'dxerr.h': No such file or directory    C:\SVN\dolphin-emu\Source\Core\AudioCommon\Src\DSoundStream.cpp    22    1    AudioCommon

Error    25    error C1083: Cannot open include file: 'xaudio2.h': No such file or directory    c:\svn\dolphin-emu\source\core\audiocommon\src\XAudio2Stream.h    25    1    AudioCommon


Error    60    error C1083: Cannot open include file: 'D3DX11.h': No such file or directory    c:\svn\dolphin-emu\source\plugins\plugin_videodx11\src\D3DBase.h    20    1    VideoDX11

Error    98    error C1083: Cannot open include file: 'd3dx9.h': No such file or directory    c:\svn\dolphin-emu\source\plugins\plugin_videodx9\src\D3DBase.h    23    1    VideoDX9

These two I presume are because of the above dependencies not being found:

Code:
Error    123    error LNK1181: cannot open input file 'C:\SVN\dolphin-emu\Source\x64\Release\AudioCommon.lib'    C:\SVN\dolphin-emu\Source\DSPTool\LINK    DSPTool

Error    127    error LNK1181: cannot open input file 'C:\SVN\dolphin-emu\Source\x64\Release\VideoDX11.lib'    C:\SVN\dolphin-emu\Source\Core\DolphinWX\LINK    Dolphin

I've included everything I need too according to the guide but only for the startup project (Dolphin -> Properties -> Configuration Properties -> VC++ Properties).

I'm using Microsoft Visual Studio 2010 Ultimate SP1 on Windows 7 64.

The project is configured for Release x64.
Find
Reply
05-14-2012, 05:47 AM
#6
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
Looks like you didn't install the DirectX SDK or didn't setup the DX SDK paths, yet.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
05-14-2012, 05:55 AM
#7
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
(05-14-2012, 05:47 AM)neobrain Wrote: Looks like you didn't install the DirectX SDK or didn't setup the DX SDK paths, yet.

I have included the following:

$(DXSDK_DIR)Utilities\Bin\x64;$(ExecutablePath)
$(DXSDK_DIR)Include;$(IncludePath)
$(DXSDK_DIR)Lib\x64;$(LibraryPath)

Are you referring to this version of the SDK. That is definitely installed.
Find
Reply
05-14-2012, 06:07 AM
#8
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
do you have set up the DXSDK_DIR env variable?
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
05-14-2012, 07:23 AM
#9
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
(05-14-2012, 06:07 AM)neobrain Wrote: do you have set up the DXSDK_DIR env variable?

I don't think so. Where should I add that to?
Find
Reply
05-14-2012, 08:39 AM
#10
dannzen Offline
I liked to help people (but NO)
*******
Posts: 1,525
Threads: 5
Joined: Dec 2010
why should someone use this? it adds so much fucking bloom ö-Ö
EDIT by neobrain: that pic was kinda annoying..
EDIT by dannzen: don't fuck with my sig Dodgy
EDIT by neobrain: yet, I will keep doing it Tongue
EDIT by ???? : A WILD DACO APPEARS
EDIT by [SS]: Hey guys, what's going on here?
EDIT by dannzen: Gotta Catch 'em All!
EDIT by ???? : WILD DACO BROKE FREE FROM MASTER BALL
Find
Reply
« Next Oldest | Next Newest »
Pages (4): 1 2 3 4 Next »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma