Sharp-edged, Stripes-like Scanlines
- AladinZ
- Topic Author
Photo #1
Photo #2
Those were taken using Dolphin Emulator; The Scanlines were simulated using DolphinFX
P.S. I Realize what I want doesn't look anything like an Authentic Scanlines Effect.
Thank you~
Please Log in or Create an account to join the conversation.
- Marty McFly
float coord = floor(vpos.x / scan_width) * scan_width;
color *= coord % 2.0;
Please Log in or Create an account to join the conversation.
- AladinZ
- Topic Author
Marty McFly wrote: For the first one:
float coord = floor(vpos.x / scan_width) * scan_width;
color *= coord % 2.0;
I'm terribly sorry, But how do I Use the Code you provided me with ? Is there a shader out there that I missed and can use ?
Thank you~
Please Log in or Create an account to join the conversation.
- Marty McFly
Note that line_width 2 means 2 clear pixels, 2 black pixels, 2 clear pixels and so on. If you want 1 black pixel, 2 clear pixel or different spacings, that gets a lil bit more complicated.
Save this as anyfilename.fx:
#define line_width 1 //in pixel
#include "ReShade.fxh"
float4 LinePass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
float4 color = tex2D(ReShade::BackBuffer, texcoord);
float2 xycoord = floor(vpos.xy / line_width) * line_width;
color.rgb *= xycoord.x % 2.0;
//for vertical stripes as well:
//color.rgb *= xycoord.y % 2.0;
return float4(color.xyz,1.0);
}
technique Lines
{
pass
{
VertexShader = PostProcessVS;
PixelShader = LinePass;
}
}
Please Log in or Create an account to join the conversation.
- AladinZ
- Topic Author
Marty McFly wrote: Ah sorry, I misread your post and thought you had already coded something but failed. Anyways, that should do.
Note that line_width 2 means 2 clear pixels, 2 black pixels, 2 clear pixels and so on. If you want 1 black pixel, 2 clear pixel or different spacings, that gets a lil bit more complicated.
Save this as anyfilename.fx:
#define line_width 1 //in pixel #include "ReShade.fxh" float4 LinePass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target { float4 color = tex2D(ReShade::BackBuffer, texcoord); float2 xycoord = floor(vpos.xy / line_width) * line_width; color.rgb *= xycoord.x % 2.0; //for vertical stripes as well: //color.rgb *= xycoord.y % 2.0; return float4(color.xyz,1.0); } technique Lines { pass { VertexShader = PostProcessVS; PixelShader = LinePass; } }
The Shader works flawlesly. However, I can't seem to get the lines to space out, even if I tinker with the numbers. I have even tried adding numbers to "line_width" with not avail. Please, do let me know what it is that I'm missing. Thank you~
P.S. Nevermind. I Figured I had to replace one of the "line_width" with a Value. Thank you so much.
PP.S. Now, If I want to space the lines so that the room between them isn't dependent on their Width, How Can go about that ? The thickness is having a reverse effect on Quality.
I really Appreciate your help.
Please Log in or Create an account to join the conversation.
- AladinZ
- Topic Author
Result:
Scanlines were Edited outside Reshade. That is to say you have to either edit them yourself using a Photo Editing software and save the Image as "xhair_mask.png" (Without Quotation Marks) or Grab the Following Image and put it in "reshade-shaders\Textures" (open in a new tab or save to expose details):
I have only Tested the shader on a 1920x1080 Screen Resolution. Higher Screen Resolutions might require a larger Image as well as some tinkering within the Shader itself. If you experience a weird effect, change "Xhair Mode" to "Solid Color" and disable stroke.
Hopefully, I have Helped somebody out there.
Please Log in or Create an account to join the conversation.