Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] VHS Pro - Analog video signal and CRT screen emulation

Discussion in 'Assets and Asset Store' started by vladstorm_, Sep 12, 2015.

  1. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    I already tried to handle this before but its bit tricky / I'll take a look on it later again / I'll put it in the list. it's kinda sometimes looks weird but most of the time ok. You can use standard unity fisheye after VHS shader instead for now, as a hot fix /
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    I'm not sure what you mean by effect editor.
     
  3. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    no worries i found out how to do what i wanted. dang. sometimes some things are SO not obvious in unity. i'm spending hours for some dumb things.
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    But won't you run into the same issue as before if you create the material thru code? The idea of shader_feature is that the multi-compile it's driven by the material. In this case, you do not create the material from scratch in your script, you just add a reference to it.

    The material would be setup up using the standard Unity material inspector for example, means the user has to assign the VHS shader to the material and specify inside the material which features to use.
     
  5. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    yea i know what you meant. that's what i'm trying to do. the problem is that i have several passes and a lot of other stuff. i can't put everything just into one single material. plus, i have some defines in a couple of passes which you have to switch simultaneously. i'll try to go step by step. and do the best i can.
    at least i hope the effect will compile not that long when i'll use shader_feature.
     
  6. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    Hooray! so i rewrote everything with shader_feature. now it builds really fast!
    but if you want to switch some features you will have to uncomment multi compile defines.

    now, i'm planning to add a couple of features and test everything again. then i'm gonna write a documentation and then gonna submit everything...
     
    Last edited: Jan 10, 2016
  7. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    I made soft fisheye edges. They will be in the next version.
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    very nice! can it be tweaked? I want the fisheye edge falloff very small, tight, just a mild fuzz really to hide the aliasing pixels from it :)

    Another thing, those yellow bars that go up with static, I was wondering if we can tweak the colour for that, or the intensity ?

    Thanks for hard work! much appreciated!
     
  9. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    yea the cutoff could be tweaked.
    >yellow lines
    dunno. will see. i can maybe add more control. the thing is i can make this effect even more complicated but there are other things also should be done.
     
  10. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    added adjustable phosphor trail color
     
    hippocoder likes this.
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You are basically the god of retro dreams.
     
  12. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    lol / thank you / i hope ill finish another plugin some day which emulates old video cards
     
    hippocoder likes this.
  13. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    working on new fisheye mode
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    haha!
     
    Peter77 likes this.
  15. tomnullpointer

    tomnullpointer

    Joined:
    Sep 20, 2010
    Posts:
    142
    Hi,

    This is a great shader, and works fine in the IDE but when i try it in a build i get the magenta screen of death :(
    and the error

    WARNING: Shader Unsupported: 'Hidden/postVHSPro_Second' - Pass '' has no fragment shader
    WARNING: Shader Unsupported: 'Hidden/postVHSPro_Second' - Setting to default shader.

    any ideas what this could mean? does the shader require a specific pipeline to be enabled in builds or something?
     
  16. tomnullpointer

    tomnullpointer

    Joined:
    Sep 20, 2010
    Posts:
    142
    I also get this error when trying to make build with just the default VHSPro demo scene

    Shader error in 'Hidden/postVHSPro_Second': unable to unroll loop, loop does not appear to terminate in a timely manner (690 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number at line 197 (on d3d9)
     
  17. tomnullpointer

    tomnullpointer

    Joined:
    Sep 20, 2010
    Posts:
    142
    hmm just to follow this up, i think its a problem with directx9, we had our project in dx9 mode for the build (and dx11 in the editor), So maybe the shaders aren't compatible with dx9 :(
     
  18. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    i had similar error before. i should check. its usually under windows on some machines. i hope i know what is the problem.
    also i'm gonna make the building process faster in the next update.
     
  19. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    front page! hooray!
     
  20. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    to fix this you can go to the file and replace the line 197
    to this one
    Code (CSharp):
    1. for (int ii = 0; ii < taps % 1023; ii++){
     
  21. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    I'm gonna submit update in the very end of January / very beginning of February.
    It will make building process much faster and reduce the build file size.
    I just have to polish everything.
     
  22. proskub

    proskub

    Joined:
    May 15, 2014
    Posts:
    6
    Can someone please outline how they're able to get this to work on mobile (iOS specifically)?

    I saw some posts about it previously, but haven't been able to deduce from those how to properly get this to work for mobile yet. Thanks!
     
  23. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    i guess the most important part - you have to remove the part with the MovieTexture because unity doesn't support it on mobile. and the rest should work... i hope)
     
  24. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
  25. proskub

    proskub

    Joined:
    May 15, 2014
    Posts:
    6
    Horz - I commented out all mentions of MovieTexture in "postVHSPro.cs" but the effect still doesn't work when the build target is iOS. Can you think of anything else I should do or identify the steps to make it work? Your support here would be a huge help as I purchased this to use with an iOS game.
     
  26. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    i didnt make mobile optimization yet. I never wrote that iOS is supported. but some people wrote that it works and usually MovieTexture is a problem. I still can't test my shader with a mobile device but I'm planning to make mobile support in the future.
    Do you have any errors in console?
    Especially on shader files?
    I guess when you click on shader file in the editor they write the errors there.
    It's very hard to guess things without seeing the errors.
     
  27. proskub

    proskub

    Joined:
    May 15, 2014
    Posts:
    6
    This warning shows up in the console:
    "Tiled GPU perf. warning: RenderTexture color surface (376x668) was not cleared/discarded, doing <run with profiler for info>
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material)
    postVHSPro:OnRenderImage(RenderTexture, RenderTexture) (at /Users/user/test/Assets/VHS Pro/postVHSPro.cs:408)"
     
  28. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    @proskub which version of unity are you using and system?
     
  29. proskub

    proskub

    Joined:
    May 15, 2014
    Posts:
    6
    Unity 5.3.1 on OS X El Capitan 10.11.3.
     
  30. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    i'm using the same/ it should work. when is it happening ?
    when u just put it into the project?
    or while working with it?
    - then i'd recommend to remove the component and try to add it again. and also restart unity.
    or
    when you making a build?
    or when you are making a build for mobile?
    - try to make a build for just osx - just for testing coz i dont have mobile atm. maybe the problem is with something else, i hope.
     
  31. PhosphorUnity

    PhosphorUnity

    Joined:
    Jan 22, 2014
    Posts:
    39
    Any idea when mobile would work ? Android in particular ... could really use this!!! .. doesn't mater if it is Unity 5+ for me ...
     
  32. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    i cant really say atm coz i dont have android device :< / it could work already or not / i cant say coz i cant test it unfortunately.
     
  33. proskub

    proskub

    Joined:
    May 15, 2014
    Posts:
    6
    @Horz: Quick question regarding the right edge. For whatever reason, when I put the postVHSPro script on the main camera, any Unity primitives (Cubes/spheres/whatever) that get close to the right edge of the camera viewport stretch like crazy. This is with the default postVHSPro script settings, just turned off fisheye and signal noise to make it more clear, and default Unity primitives at 1/1/1 scale (image attached). Same Unity version + OS X version mentioned before.

    Any idea what's causing this and how to resolve it?
     

    Attached Files:

  34. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    can u tell me your email address / ill write you / we should try to solve it
     
  35. proskub

    proskub

    Joined:
    May 15, 2014
    Posts:
    6
    Glad to help solve it anyway I can – will send you an email with a sample project with the bug now!
     
    vladstorm_ likes this.
  36. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    so, this right-edge problem is a unity bug / i just got the same behaviour with standard Vignette shader.
    I should report about this....
     
  37. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
    i commented out all lines that include "movieTex", is that enough?
     
    Last edited: Feb 11, 2016
  38. allornothingJM

    allornothingJM

    Joined:
    Feb 3, 2015
    Posts:
    20
    First off - loving this :)

    Wondering if you can help with a compiler error though when building for PC:

    Shader error in 'Hidden/postVHSPro_Second': unable to unroll loop, loop does not appear to terminate in a timely manner (690 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number at line 197 (on d3d9)

    The build continues but when we run the game the effects aren't visible :( Works fine in editor, just not in PC build
     
  39. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    try to replace the for-line with this
    Code (CSharp):
    1. for (int ii = 0; ii < taps % 1023; ii++){
     
  40. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    Good news. v1.3 is finished. Final tests and I'm gonna submit it next days
     
  41. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    Important Note: Migrating to v1.3

    So, I submitted v.1.3. It uses shader features instead of multi compiles.
    The new approach has lot of advantages.
    But you unfortunately will have to set all the values again. Sorry about that.
    The best thing to do is:
    1. Update VHS Pro plugin
    2. Create a new instance (VHS Pro component on camera)
    3. Manually copy values from the old one to the new one.
    4. Delete the old one
     
  42. doubledope

    doubledope

    Joined:
    Jan 8, 2014
    Posts:
    4
    Hi!

    First of: Thank you for making this plugin! I think it's awesome :)

    I just bought it today and for some reason when I try to make a build (both 32/ 64 bit) it will hang at: "Building additional assets". Although there is still loads of activity on my CPU for the shader compiler I don't think waiting more than 30 minutes is intended behavior eventhough my CPU is only a low clock speed i3.

    Deleting the VHS pro folder allows me to make builds again.



    Furthermore everytime I save there is a warning about:
    Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    RenderTexture has been leaked 3 times.

    Double clicking show that it must be a render Texture used by your script. This is easily fixable by changing the HideFlags:
    "Any assets that don't have their HideFlags set to a variation of HideAndDontSave, and aren't referenced by another 'root' such as a GameObject, are 'cleaned'." (source: http://answers.unity3d.com/questions/38960/cleaning-up-leaked-objects-in-scene-since-no-game.html)

    I will no longer receive this message when I delete the VHS script on my camera and run the scene once.

    Thanks in advance!

    [edit] Just thought I should mention it: I am running Unity 5.2.0f3
    Updating is not possible due to other plugin compatibility.
     
    Last edited: Mar 11, 2016
  43. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    hi , i just submitted the update / its not hanging - its usually just taking forever to build. however, in version 1.3.1 it works differently. and not it shouldn't take that much time.

    >hideflags
    thank you / ill read about it
     
  44. doubledope

    doubledope

    Joined:
    Jan 8, 2014
    Posts:
    4
    Thanks for the reply!

    I thought I had the latest version as you said in the post just before mine that you had submitted an update, but it turns out I had 1.2.1 installed. Must have taken the asset store a little while to actually publish the update.

    Now that I updated to 1.3.1 it build almost instantly. Thanks a lot :)
     
    vladstorm_ likes this.
  45. iLoveVHS

    iLoveVHS

    Joined:
    Jun 20, 2016
    Posts:
    1
    Is there an instructions on how to add video to VHS Pro? Because i don't know how to add video to VHS Pro?
    I know somepeople may find it difficult to try add video to VHS Pro, especially me. But if you give me an instructions i will appreciate it.
     
  46. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    you shud make a video texture and drop it to bypass texture in vhs pro for example
     
  47. ZeldaS

    ZeldaS

    Joined:
    Jul 3, 2013
    Posts:
    3
    sale please. I must buy one
     
  48. BloodRedDeer

    BloodRedDeer

    Joined:
    Feb 11, 2016
    Posts:
    1
    I assume the shader works perfectly fine with xboxone and ps4 rendering platforms? Has anyone tested this?
     
  49. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Just a quick one to say this is now broken on Unity 2017, hopefully we can get a fix?

    Shader error in 'Hidden/postVHSPro_Second': unable to unroll loop, loop does not appear to terminate in a timely manner (690 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number at line 199 (on d3d9)

    Compiling Fragment program with VHS_OLD_THREE_PHASE VHS_CUSTOM_BLEED_ON VHS_SIGNAL_TWEAK_ON
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA
     
  50. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    @Horz
    Any updates on compatibility for Unity 5.6.1f1? :)