I’m trying to create a CRT screen in Unity, that a player can interact with.
The “screen” is a rendertexture, projecting a 2d camera, looking at sprites out of the players view.
I’m using a recreation video as reference, where the author has provided their code for the shader. Source shader code
So far I’ve managed to recreate the scanlines to my specifications, which work perfectly:
The problem lies with adding the curvature and vignette.
Based on the provided shader, I’ve tried converting the math, line by line, to shadergraph. I’ve added little red symbols (triangle, circle and square) to better show where each result is used.
The scanlines effect (which works)
Line 37 through 40
Line 46 through 49
Line 51 through 54
The result does not create curvature or a vignette.
I suspect the problem lies in my low understanding of the semantics and language of Shaders as a whole. I was hoping someone could point me towards where I’m going wrong or explain why this doesn’t work like in the breakdown provided further up.
I would appreciate any answers you can give me.