Search Unity

TOZ Blur (Per Object)

Discussion in 'Assets and Asset Store' started by aubergine, Dec 20, 2016.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Selective blur effect per object.
    You define which objects to blur with an individual variable.
    Works on mobile and desktop.
    Compatible with Single Pass Stereo Rendering.
    Compatible with GPU Instancing.

    It works with any unity provided shader including the standard ones as well as any custom shaders which follow unity RenderType naming schemes.

    Blur is occluded properly with any of the above mentioned shaders.

    WEBGL DEMO

    Buy From:
    ASSETSTORE
    TOZ MARKET


    Web Demos:

     
    Last edited: May 30, 2020
  2. pixelshader

    pixelshader

    Joined:
    Dec 14, 2012
    Posts:
    17
    hi, does the asset work with VR? Specifically Steam OPENVR?
     
  3. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    I didnt try steam openvr but it Works with cardboard type vr, just like any other image effect i think it is the same procedure.
     
  4. caoyuxi

    caoyuxi

    Joined:
    Jul 9, 2015
    Posts:
    10
    got this type of error in SteamVR :

    Attempting to release RenderTexture that were not gotten as a temp buffer
    UnityEngine.RenderTexture:ReleaseTemporary(RenderTexture)
    TOZ.Buffers.Render_VariableMask:OnPostRender() (at Assets/TOZ/_Shared/Scripts/Buffers/Render_VariableMask.cs:59)

    the last line of RenderTexture.ReleaseTemporary(maskTexture);
     
  5. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878

    Do you have any other script using the temporary rendertexture during the same render cycle? Does steam vr render to a texture?
    Try with deleting the last line.
     
  6. pixelshader

    pixelshader

    Joined:
    Dec 14, 2012
    Posts:
    17
    hey,

    Thanks for all the responses.

    Steam Vr does not render to a texture. You cannot delete the ReleaseTemporary mask cause it creates a memory problem. However even with some errors it works, so I am assuming its something to do with the pipeline of post processing.
    I am getting close to making this work with Steam VR. I have 2 questions.

    1) How are objects being rendered identified? I am unable to add different objects to blur, even though I add the Blur Controller script. Does the shader support multi materials? Any specific needs that we should know on the mesh?

    2) There is an offset when VR is enabled in Unity. I am assuming this can be fixed by tinkering with positions, but not sure, any ideas could be helpful.
     
  7. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    If Temp rendertexture error occurs, i think there is a bug with unity itself cause as seen in the script it is 2 lines of code provided by unity and it is really a temporary texture. But it may be a problem with steamvr overriding the temp rendertex somewhere along the render pipeline.

    1- Objects are identified by their materials(1st material actually if the object has multiple materials, it doesnt check for multiple materials) RenderType property. If it is a type known by unity (Opaque, TransparentCutout, Tree...etc and normally its not supported by unity but i added support for Transparent types as well) The script injects extra variables to render the object as blurred one.

    If you need support for multiple materials, its easy to add it by modifying the BlurController.cs but i dont want to add it to the assetstore pack, if its really necessary i might send you a modified script.

    2- By offset you mean Half texel offset? I mean just a a few pixels or a huge offset?

    Anyways i will check out this steamvr thing and try to fix things for you, but i just had a major surgery 2 weeks ago and i still cant stand up. It will take some time.
     
  8. markzorn

    markzorn

    Joined:
    Oct 6, 2016
    Posts:
    12
    Any issues using this in 2d? Also your web player seems to be broken.
     
  9. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Doesnt matter 2d or 3d as long as your objects use correct shaders (that means the shaders use standart RenderType names and that means Opaque, TransparentCutout, Tree...etc) I also added support for Transparent RenderType, that means your sprites can also be blurred.
     
  10. deraggi

    deraggi

    Joined:
    Apr 29, 2016
    Posts:
    88
    Hi aubergine,

    hope you recovered well from your surgery.

    I have the exact same requirement as pixelshader, I would like to know if it's possible to use this effect in OpenVR / SteamVR.

    Thanks!
     
  11. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Please direct me where to get/download this steamvr and openvr packages.
     
  12. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    Hey, Is it optimized on mobile devices ? Both Android and iOS
    I've tested some blur shaders but non of them are fast and drop many FPS.
    Is there any .apk file that I can test it on my phone ?
     
  13. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Hi,

    The effect is mobile friendly, surely there will be an impact but just slightly. Shader itself checks and arranges quality depending on mobile or desktop platform.
    Sorry no apk.
     
  14. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Just submitted the new v2.0 update to the AssetStore. It will take some days until it will be alive on the Assetstore, but you can also buy it right now from TOZ Market.

    Check the new webgl demo to see it in action.
     
  15. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Celebrating my 10th year on the AssetStore, this package and many more are FREE to download for the following 10 days!!!