I started to experiment with simplest CRT shader I found, author: Themaister
By default it also renders vertical scanlines.
I found that if I replace calculation of omega variable:
omega = vec2(3.1415 * rubyOutputSize.x * rubyTextureSize.x / rubyInputSize.x, 2.0 * 3.1415 * rubyTextureSize.y);
by
omega = vec2(2.0 * 3.1415 * rubyOutputSize.x * rubyTextureSize.x / rubyInputSize.x, 3.1415 * rubyTextureSize.y);
it fixes scanlines:
It's good, but I want to use more advanced shader, like cgwg, Themaister and DOLLS CRT shader.
However, it uses more complex mathematics, and I can't find where to tune it to get needed result.
Other question: why these filters work for bsnes? What did I wrong with OpenGL parameters to get this curse? The OpenGL code is very basic - just draw textured rectangle with CRT shader enabled.
For the vertical scanlines in the first picture, it looks like its emulating vertical subpixel pattern there, not the scanline effect.
ReplyDeleteThe second picture, it looks like you are getting a moiré pattern, while I have no experience with shaders or anything 3D rendering, I think you'll need bilinear or anisotropic filtering to prevent the effect.
No, I use exactly CRT shaders, which emulates scanlines. Check this article for screen shots and explanations: http://filthypants.blogspot.ru/2010/12/crt-pixel-shader-filter-for-snes.html
DeleteFrom what I see, it seems that bending is apply after scanline. This make sense but as scanline seems to have thin lines (1 pixel for 2), I wonder if, once a curvature applied, you didn't have a moiré pattern.
ReplyDeleteHave you anti aliasing applied?
Try to increase the scanline size, just to see if the pattern still appear.
Not sure it help. :(
Keep the (amazing) work! :)
As I see from screen shots from this article (http://filthypants.blogspot.ru/2010/12/crt-pixel-shader-filter-for-snes.html) moiré pattern is an expected part of shader's work.
ReplyDeleteEnabling/disabling anti-aliasing does not affect shader work.
I don't know how to increase the scanline size, I don't see such parameter in the shader.