Pete´s Messageboard... No ISO/BIOS requests!

Homepage Members Register Login Search Old board


Neuer Thread ...


AuthorTopics » Book an abo for this threadClose Thread Move Thread Fix the thread Print view Delete this thread

Jeneko 



...

Status:Offline
Date registered: 06.05.2015
Post:1
Send Message
...   Created on 06.05.2015 - 19:17Jump to top Quote this post Report this post Edit Delete


Hi everyone!
I really liked effect of CRT-2 shader from PPSSPP emulator so I tried to use him inside ePSXe.

And, anyhow it's work! Well, almost :\
There is some problems, which I can not resolve, cause actually I don't know shit about all this programming and stuff and just copy some strange words from other shaders till it'll work ^_^'

So, there is two problems:
- blinking then uncomment "vignette" line
- fluttering then use "not magical" (256, 320 etc) digits to determine amount of scanline lines.

Aside that I think it works well. So you can try it if you like. And if you can fix those two glitches it would be wonderful and I'll be really grateful!

Here's code of gpuPeteOGL2.slf file (some of lines I suspect is useless, but anyway):

Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
 
// Advanced Scanlines (CRT) shader, created to use in PPSSPP.


precision mediump float; //probably useless
precision mediump int; //probably useless

uniform sampler2D sampler0;
varying vec2 v_texcoord0; //probably useless

float amount = 0.65; // suitable range = 0.0 - 1.0
float jen_res = 320; // can be: 256, 320, 512 etc. otherwise may flutters
float intensity = 0.5; // suitable range = 0.0 - 1.0
float lightness = 1.1; // overall lightness

void main()
{
  vec3 color = texture2DProj(sampler0, gl_TexCoord[0]).rgb;

  // scanlines
//float pos0 = ((gl_TexCoord[0].y + 1.0) * 480.0 * amount);
  float pos0 = ((gl_TexCoord[0].y + 1.0) * jen_res);
  float pos1 = cos((fract( pos0 ) - 0.5)*3.1415926*intensity)*1.5;
  
  // slight contrast curve
  color = color*0.5+0.5*color*color*1.2;

  // color tint
  color *= vec3(0.9,1.0,0.7);

  // vignette (don't work :(, blinking if enabled)
  //color *= 1.1 - 0.6 * (dot(gl_TexCoord[0] - 0.5, gl_TexCoord[0] - 0.5) * 2.0);

  gl_FragColor.rgb = mix(vec3(0,0,0), color, pos1*lightness);
}


And here's link to original: https://github.com/hrydgard/ppsspp/blob … nlines.fsh





Similarly threads:
Topics Created by Replies Boardname
PPSSPP CRT Shader Conversion possible ? 80T 0 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 16 pete_bernert
Quest for scanlines/porting question xexex 3 pete_bernert
'monitor dot matrix' scanlines cause flickering VGRageaholic -1 pete_bernert
What's a Shader Near 1 pete_bernert
Neuer Thread ...





Masthead

This forum is a free service of razyboard.com
Do you want a free forum in less than two minutes? Then click here!



blank