• 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 ... 196 197 198 199 200 ... 368 Next »

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

Pages (4): « Previous 1 2 3 4
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
GLSL Shaders - CRT Emulating old televisions
05-21-2012, 05:57 AM
#31
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
Yeah.. no. Read the wiki page on the dolphin wiki on gcode again, it describes that you need to do it differently.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
05-21-2012, 06:09 AM (This post was last modified: 05-21-2012, 06:09 AM by ProfEmu.)
#32
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
Are you referring to the Microsoft.cpp.x64.User?

I don't have any of those folders in my project, how are they added?

[Image: VS2010_3.PNG]
Find
Reply
05-21-2012, 08:26 AM (This post was last modified: 05-21-2012, 08:36 AM by neobrain.)
#33
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
You probably haven't "Open[ed] the Property Manager" (somewhere in the view menu maybe?).
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
05-21-2012, 08:43 AM (This post was last modified: 05-21-2012, 09:07 AM by dEnigma.)
#34
dEnigma Offline
Member
***
Posts: 138
Threads: 1
Joined: Sep 2011
In Visual C++ 2010 Express it's "Project->Properties" or [ALT]+[F7]
[Image: postcountwe8.jpg]
---------------------------------------------------------------------------------------
[Image: 2350461.png]
Find
Reply
05-21-2012, 09:17 AM
#35
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
Found it in hiding in 'Other Windows':

View -> Other Windows -> Property Manager

Everything now builds absolutely fine with no errors (just warnings) Smile

Thanks for taking the time to help out with this.

I'll look into the converting the shader when I get some spare time next weekend.
Find
Reply
05-29-2012, 08:26 AM (This post was last modified: 05-29-2012, 08:28 AM by ProfEmu.)
#36
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
Can anyone get this to openGL shader to work with Dolphin?

Code:
// lerp = mix
// #define works correctly

#define PI 3.14159265f        

uniform samplerRECT samp0 : register(s0);

uniform float ScanlineAmount = 2.0f;
uniform float ScanlineScale = 0.2f;
uniform float ScanlineBrightScale = 1.0f;
uniform float ScanlineBrightOffset = 1.0f;
uniform float ScanlineOffset = 0.0f;
uniform float ScanlineHeight = 1.0f;

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

    float RawHeight = 1080.0f;

    float2 ScanCoord = uv0;

    // -- Scanline Simulation --
    float InnerSine = ScanCoord.y * RawHeight * ScanlineScale;
    float ScanBrightMod = sin(InnerSine * PI + ScanlineOffset * RawHeight);
    float3 ScanBrightness = mix(1.0f, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f) * 0.5f, ScanlineAmount);
    float3 Scanned = BaseTexel.rgb * ScanBrightness;

    // -- Color Compression (increasing the floor of the signal without affecting the ceiling) --
    float3 Floor = float3(0.0f, 0.0f, 0.0f);    
    Scanned = Floor + (1.0f - Floor) * Scanned;

    ocol0 = float4(Scanned, BaseTexel.a);
    //ocol0 = BaseTexel;
}

I can get it to work outside of Dolphin (with HLSL and XNA) but no luck so far with GLSL. It is a simple as I could make for scanlines.
I know what the problem is....

Dolphin doesn't like all those uniform parameters. This will work:

Code:
// lerp = mix
// #define works correctly

#define PI 3.14159265f        

uniform samplerRECT samp0 : register(s0);

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

    float RawHeight = 480.0f;

    float2 ScanCoord = uv0;

float ScanlineAmount = 2.0f;
float ScanlineScale = 0.2f;
float ScanlineBrightScale = 1.0f;
float ScanlineBrightOffset = 1.0f;
float ScanlineOffset = 0.0f;
float ScanlineHeight = 1.0f;

    // -- Scanline Simulation --
    float InnerSine = ScanCoord.y * RawHeight * ScanlineScale;
    float ScanBrightMod = sin(InnerSine * PI + ScanlineOffset * RawHeight);
    float3 ScanBrightness = mix(1.0f, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f) * 0.5f, ScanlineAmount);
    float3 Scanned = BaseTexel.rgb * ScanBrightness;

    // -- Color Compression (increasing the floor of the signal without affecting the ceiling) --
    float3 Floor = float3(0.0f, 0.0f, 0.0f);    
    Scanned = Floor + (1.0f - Floor) * Scanned;

    ocol0 = float4(Scanned, BaseTexel.a);
    //ocol0 = BaseTexel;
}
Find
Reply
05-30-2012, 09:01 AM
#37
dEnigma Offline
Member
***
Posts: 138
Threads: 1
Joined: Sep 2011
I just get a black screen when I use this shader.
[Image: postcountwe8.jpg]
---------------------------------------------------------------------------------------
[Image: 2350461.png]
Find
Reply
05-31-2012, 05:08 AM
#38
ProfEmu Offline
Junior Member
**
Posts: 33
Threads: 4
Joined: Apr 2009
Try changing the following settings:

float ScanlineScale = 0.2f;
float ScanlineBrightScale = 1.0f;
float ScanlineBrightOffset = 1.0f;
float ScanlineHeight = 1.0f;

A sensible range for each one is [0, 1]

I can post screens of different settings at the weekend if that helps?
Find
Reply
« Next Oldest | Next Newest »
Pages (4): « Previous 1 2 3 4


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode