Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

[RELEASED] Ultimate CRT - Cathode Ray Tube display simulation

Discussion in 'Assets and Asset Store' started by b005t3r, Feb 4, 2017.

  1. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    If you used this effect in your released game, please let me know, I'm sure we can talk about some sort of cross-promotion or anything like that :)

    Overview


    Ultimate CRT is a camera post-process which simulates the small imperfections of cathode ray tube (CRT) displays. It lets you adjusts things like lack of sharpness, luminosity bleeding, RGB and shadow masks, color and monochromatic noise, color adjustments, screen curvature and many others (it offers over 30 different settings to adjust). And to make it easier for a beginner, it comes with 10 various presets for different display types (old black and white display, kitchen TV, arcade display, monochromatic terminals, etc.). It supports single- and multi-camera setups and comes in two versions, a standard one which can be combined with other image effects, but is a bit slower and a standalone one which can't be combined with other effects, but is faster (especially on mobiles).

    Screeny Shot 07 Jan 2017 13.58.13.png

    Asset Store link

    https://www.assetstore.unity3d.com/en/#!/content/80048

    Supported platforms

    It runs on basically everything. Tested on PC, Mac and mobiles and WebGL. It is an expensive effect however, so don't expect 60 FPS on a 5 years old mobile device. On my Moto X Style it runs at 45 FPS (at 1440p resolution).

    Introductory video



    Features
    1. Sharpness adjustment.
      Adjustable sharpness reduction - adds a bit of blur to make the image look less LCD-like.
    2. Luminosity bleeding.
      Brighter pixels "glow" more than the darker ones on CRTs, this simulates this behaviour.
    3. Chromatic aberration.
      Adds colorful halos around the edges. Can be turned off for better performance.
    4. RGB mask.
      It simulates the way CRTs produce image - some pixels let only the red channel through, some just the green channel and others just the blue one. Fully adjustable.
    5. Noise.
      Two types of noise (white and color) can be added with different blending modes. Adding the right amount of noise works like dithering - it makes color gradients smoother and edges more round.
    6. Various color adjustments.
      Things like brightness, saturation and contrast can be adjusted, along with the black and white point (what the darkest and brightest color is going to be) and levels (similar to Photoshop's levels setting).
    7. Interference.
      Horizontal interference, which lets you simulate a flickering display or, as the name suggest, a horizontal bar moving across the screen.
    8. Shadow mask, curvature and vignetting.
      Six different mask are available, screen curvature can be adjusted for X and Y axes independently, vignetting can be set.
    9. Adjustable internal resolution.
      This lets you set the dimensions of internally used buffer, which directly defines the internal resolution of the simulated display (and makes your setup not depend on screen resolution).
    10. Single- and multi-camera scenes support.
      There's a special property you can use to add other cameras which render the scene, so they all will be processed as well.
    Screenshots

    anim0.gif

    comp0.png

    comp2.png

    editor.png
     
    Last edited: May 3, 2019
    AGregori likes this.
  2. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    If you'd like to check how your game would look like with the effect applied before buying, let me know, provide a couple of screenshots and send me those. I'll do the magic and send you back the processed images :)
     
  3. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
  4. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
  5. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    113
    does this support single pass stereo rendering for VR?
     
  6. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    I never tested it with VR, so it's hard to tell.

    BUT it works like any other image effect out there, so if they (the ones from the standard effects package) work in your scenario, mine should work as well.
     
  7. jweinhartSW

    jweinhartSW

    Joined:
    Sep 30, 2016
    Posts:
    8
    I realize this is probably a longshot, but is there any way to have the effect not apply to transparent portions of the image. I was hoping to use this on our UI camera to get a scanline-ish effect without affecting the rest of the game.
     
  8. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,163
    Hi Just got the asset, and I have one simple help request.
    I want to take out the curvature and when I put curvature on 0 for both horizontal and vertical I still see a very little black curvature around the edges. Maybe Its a bug or I'm doing something wrong.

    Thanks
     
  9. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    I'm not sure, you mean like masking part of the filtered image? You can probably do it as another step with a custom image filter. But Ultimate CRT does not have a build-in functionality for this I'm afraid.

    It's bug-ish :) You can play with the way params are passed to shader or comment out the curvature step in the shader code. It's pretty straightforward to do, but if you'll have any problems doing it, let me know, I'll try to prepare an example piece of code (can't do it ATM).
     
  10. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    36
    Hi! I wonder if this is compatible with Pro Camera 2D?

    I assume it is because that camera plugin it's all about WHAT you see on screen, not HOW you see it... but I'm kind of curious about if you tested your plugin with other camera focused ones.

    Thanks.
     
  11. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Yes, it is! It requires a bit of additional work and depends on your setup (e.g. if you have any other image effects on your sub-cameras they won't be taken into account), but basically all you need to do is use a special property on the Ultimate CRT component, add all sub-cameras to it and add Ultimate CRT itself to the last camera that renders on screen. I know it sounds complex, but it's really simple - you'll find a demo project for it, it's also explained in the docs.

    And I should probably put it in the description as well :D
     
  12. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Also, if you really have to, because your setup it so custom, you can always make Pro Camera2D render to a texture, display that texture using a quad and use a separate standard camera to render than quad and use Ultimate CRT with it. Not the optimum approach, but it should work if everything else fails :)
     
  13. NOoooRyuk

    NOoooRyuk

    Joined:
    Mar 7, 2017
    Posts:
    6
    Hi I'm very satisfied your asset!. But I have some trouble in picking the objects when I use CRT_CurvatureX&Y.
    I have to adjust mouse position when the object are placed in edge of game screen . Could you help me some easy idea of adjust mouse position?​
     
  14. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Interesting ;) I never tested that if I'm honest. I'm guessing your pointer is not processed by the shader (so it's drawn on top of the processed image). You could try looking at the crt() function inside UltimateCRT/Resources/CRTFinalPostprocess.cg.shader - this is how coords are transformed from "flat" screen coords to curvy CRT coords (input coords vary from (0.0, 0.0) to (1.0, 1.0)) and do the reverse for your coords, because you're trying to click an already transformed object (output coords vary also from (0.0, 0.0) to (1.0, 1.0), they are just squeezed towards the center a bit).

    I would try copying this function entirely into your click detection code and changing crtOverscan, bendX and bendY to 1.0f / crtOverscan, 1.0f / bendX, 1.0f / bendY. This is just off the top of my head, give it a go :)
     
  15. NOoooRyuk

    NOoooRyuk

    Joined:
    Mar 7, 2017
    Posts:
    6
    Thanks alot.I'll try it. But when I play my game in my android phone, the frame is serously dropped. (My game adjust your CrtEffect value in playing time ) Can you give me some tip? Are these three shader codes will be big load to my phone?
     
  16. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    It's hard to say, it depends on various factors.

    The effect uses an internal texture for rendering stuff on - the bigger you set it to be, the more GPU power it'll require to render a frame, which may cause your FPS to drop quite significantly. Another thing to consider is chromatic aberration - it's really subtle, but requires 3x more texture samples than rendering without it, so setting this to 0 should eat up less of your GPU time.

    On the phones I tested, with very simple games, it was always able to run at 30+ FPS (on my Moto X Style it runs at 47 FPS) with chromatic aberration on and internal texture set to 768p.

    But you should always keep in mind this is a full screen effect and just to simply render a screen-sized input image at 1080p at 60 FPS, you'd need about 0.5 GB/s of bandwidth. Now, this effect samples the image about 15 times (I'd need to check that again) per each pixel it sends to output, so this is already a lot and it need to do the processing as well, so asking a 5 years old phone to do that is probably a bit too much :)
     
  17. NOoooRyuk

    NOoooRyuk

    Joined:
    Mar 7, 2017
    Posts:
    6
    Hello again, I appreciate your advice. thx.
    I tested my game within your crt Asset a lot, I found that my Frame Drop is caused by 'TextureSize' variable. I'm not use that variable, so I set it 0. But It cause serious Frame Drop. But when I set it 768 that is your default value. I work well in my phone(LG G2 same perforamnce as GALAXY S4 samsung).

    But my phone get hot in short time. So I wanna do not use 'texture Size' and 'chromatic aberration' for performance.
    (I think I have to avoid CreateCameraTexture() or do not adjust texture size calculation. I didn't see the code detaily.. sorry ) Could you give me some tip?

    (I have to publish the game in march.... If you help me, you save my life T.T)
    Thank you again
     
  18. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    You should probably never set it to 0 :)

    Please, read some more about this setting in the docs. What it's for is setting the size of internally used texture - if you set it to 768 and set the adjustment mode to "height", then for a FullHD display the effect will use an internal texture of size 1365x768 - significantly smaller than the input image, so significantly less calculations are needed for the effect to work. Setting it to 0 will cause it to work at screen resolution, which won't look good and will be a lot slower.

    For performance optimization, I'd suggest keeping this value as small as you can (if the output image still looks good, there's no point in increasing this value) and turning off chromatic aberration (just set this one to 0). Start with the default value of 768 and go lower (it depends on your particular game how low can you go), try things like 720, 640 etc. Probably going below 600 will make your game look very blurry, but anything between 600 and 768 should (reasonably) work.

    And about your phone getting hot. Well, you're pushing it to the limit 60 times per second, what did you expect? :) Seriously, there's no solution. You can try using a lower frame rate (maybe your game looks good at just 30 fps), but there isn't much I can help you with here.
     
  19. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    52
    I updated to unity 5.6 and the CRT effect is now broken. The code has errors and displays incorrectly, either black screen or upside down.
    I get this error.


    NullReferenceException: Object reference not set to an instance of an object
    BaseCRTEffect.ProcessEffect (UnityEngine.Texture src, UnityEngine.RenderTexture dest) (at Assets/UltimateCRT/Scripts/BaseCRTEffect.cs:700)
    CRTEffect.OnRenderImage (UnityEngine.RenderTexture src, UnityEngine.RenderTexture dest) (at Assets/UltimateCRT/Scripts/CRTEffect.cs:8)
     
  20. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    All right, I'll give it a go tomorrow and see what's going on.

    Thanks for reporting.
     
  21. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    52
    Any news on this?
     
  22. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Will look into this tomorrow, didn't have time today, sorry!
     
  23. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Hello mate, sorry to bother you, but your shader isn't behaving.

    The multi-camera demo works perfectly; however, the single-camera demo and my own project doesn't: The screen inverts and crashes when I toggle "Maximize On Play".

    No rush though, nothing urgent.

    Cheers.
     
  24. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Just to be clear, Unity 5.6 as well?
     
  25. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Ye
     
  26. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Just tested it on 5.5.3, no issues. Definitely a 5.6 specific problem.

    Edit: Found another issue whilst working in 5.5.3.

    I have two cameras in the same position that both print to the same display. In front of them are two spheres. Camera_1 renders one sphere and the sky box on depth_0. Camera_2 renders the other sphere and the CRT effect on depth_1.

    I can see both spheres and the sky box in the small window; however, when I toggle "Maximise On Play", I can only see Camera_2. If I place Camera_1 in the "Other Cameras" section, I can see Camera_1's sky box, but not the sphere.
     
    Last edited: May 8, 2017
  27. WarrenMarshall

    WarrenMarshall

    Joined:
    Jun 7, 2015
    Posts:
    44
    I'm having a weird issue as well ... I have a single camera with a few UI elements on it ( a text and input field ). All is well until I attach this post process effect, and then my screen flips vertically. Everything works, it's just ... upside down. I've tweaked everything I can think of but nothing corrects it.

    Anyone else seen this?
     
  28. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    OK guys, I tested on both Windows and Mac.

    First of all, I didn't experience any crashes, so if you have it crashing on your project I'd like to ask you to prepare a simple scene where the problem does occur and to send it to me: lazarecki@gmail.com

    Now, about the screen flipping. It does happen on Windows, so I'll try to battle it again and hopefully prepare something that works :)
     
  29. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Could you send me this example scene you mentioned? I'll give it a look and hopefully fix the issue.
     
  30. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Thanks mate, will do tonight.

    Also, in case you missed it, it only crashed when I used the non-standalone script and "maximize on play".
     
  31. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    OK, tested that and had a crash as well. Managed to fix that (I think).

    However, I'm really close to being certain that flipping issue is on the Unity's side. Before 5.6 each texture had this texelSize property that if it had the y property set to a negative value was an indication to flip the texture while rendering. But it doesn't any longer work like that - it's always set to a positive value and I'm not sure how am I now supposed to guess it the texture is flipped or not.
     
  32. WarrenMarshall

    WarrenMarshall

    Joined:
    Jun 7, 2015
    Posts:
    44
    For those able to do so, b005t3r gave me a work around in 5.6 ... in your Player settings, you can set your renderer to OpenGL instead of DirectX. That flips it back over the right way until he can find a correct fix ...
     
  33. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Another little trick: I could just render to a texture and flip it.

    I don't know about you, but as my screen is consistently flipped (although it is the right way up for a split second after applying the shader), is it possible that your anti-flip safety check is now redundant and interfering with the output?

    Then again, I know F*** all about shaders, so I'm not going to be a big help. You can always ask on the forums.
     
  34. WarrenMarshall

    WarrenMarshall

    Joined:
    Jun 7, 2015
    Posts:
    44
    Or ...if you want to get a fix out quickly ... add a checkbox to the shader so the user can flip it if they need to. :p
     
  35. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    That would be a work around if it happened always in the same way, but it's a bit random I'm afraid. Currently it doesn't happen if I start the app, but once I turn the effect off and then back on, it's flipped again.
     
  36. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
  37. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Yes, but these are just a shader version of the texture properties (correct me if I'm wrong on this one).

    BUT, I fixed it :) There's no crash on 5.6 and the image is no longer flipped. However, for the second fix to work you'll need to a patch: https://unity3d.com/unity/qa/patch-releases - the one from yesterday: Patch 5.6.0p4.

    I'll push the update today, let me know if it's fixed.
     
  38. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Brilliant, thanks a bunch mate. Will let u know tonight.
     
  39. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    OK guys, I pushed the update to review, hopefully they'll make it available today.

    It should work with no problems now, but for 5.6 you need to patch it to the 5.6.0p4 at least (or wait for an official release of 5.6.1).

    Let me know if things are OK now. And, once we're at it, I wouldn't mind if you gave me a positive review on the store :D
     
  40. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Just had a go: works beautifully!

    No worries mate, you deserve it.
     
  41. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Thanks man, I really appreciate the support.
     
  42. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Sorry to bother you again, but is there any way to make it so that the shader only effects certain objects?

    I tried attaching a shader to the object I want effected that writes to the stencil buffer, and editing your post-processing shaders so that they take the stencil buffer into account; but the screen just goes black. This method worked with a similar full screen effect, so I know I'm getting somewhere.

    Edit: I've PM'd the example project.
     
    Last edited: May 9, 2017
  43. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    I've PMed you back with the only solution that came to my mind, but the short answer is: I doubt it'll work well, because of the distorted perspective objects won't ever be properly aligned.
     
  44. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    52
    When is this available? Is this error fixed? I tried redownloading the package and importing into project.

    NullReferenceException: Object reference not set to an instance of an object
    BaseCRTEffect.ProcessEffect (UnityEngine.Texture src, UnityEngine.RenderTexture dest) (at Assets/UltimateCRT/Scripts/BaseCRTEffect.cs:700)
    CRTEffect.OnRenderImage (UnityEngine.RenderTexture src, UnityEngine.RenderTexture dest) (at Assets/UltimateCRT/Scripts/CRTEffect.cs:8)
     
  45. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    1. Have you downloaded the latest 5.6 patch? The link is further up this page.

    2. Try disabling any other post-processing scripts if you have any.

    3. The new version isn't out yet. The asset store will tell you when it is.
     
  46. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    52
    Thanks just saw the comment about the patch to install. Ive done that and its fixed the error.
     
    b005t3r likes this.
  47. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    52
    My final problem is that it seems like Multi camera set up isnt working.
    The main camera with the CRT effect script on it should be set to CLEAR FLAG = solid color, Right?? when doing this currently even in 5.6patch build the other cameras arent rendered and i think thats causing other rendering issues too for me. CRT_Errors_01.jpg CRT_Errors_02.jpg
     
  48. Tombros

    Tombros

    Joined:
    Jan 19, 2013
    Posts:
    14
    Set it to "depth only" and stick every other camera into the "other cameras" section of the script.
     
  49. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    52
    Thanks that helped.
     
  50. b005t3r

    b005t3r

    Joined:
    Dec 29, 2016
    Posts:
    46
    Guys, the new version is out. Please give it a go and if there still are any problems, please post them here.

    The first camera should be set to clear the background with a solid color and every other camera should be set to do nothing. The last camera to render should have the filter added.
     
unityunity