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

Aubergines PostPRocess Effects Released in Assetstore

Discussion in 'Assets and Asset Store' started by aubergine, Jun 23, 2011.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Can you elaborate, i didnt quite understand.
     
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    For example, I'm trying to make a security TV camera view. I use another camera to draw to a rendertexture, and display that rendertexture on the screen. I add the effect Security Effect on the camera, and the rendertexture does not update.

    Repro. using sample scene
    1. Duplicate main camera camera, change to render to a rendertexture.
    2. Draw rendertexture on the screen using a quad/ or any thing. Rendertexture is not updated.
     
  3. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Ah, as i understand you want to apply the effect on a temporary or a custom render texture rather than the screen outcome.
    Do you use a custom Render() command to render your other camera? Or do you just let it render when its his turn?
     
  4. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Well, nevermind that. For a security camera effect im sure you are using a tiny low res temporary render texture. No need to use an image effect on it. As its slightly overkill.
    I will write you a custom object space shader to do the same effect, so you can apply the material on your security tv screen.

    Just let me know which effect(s) you want to combine and send me a small sample scene, please use the email adress provided in readme file.
     
  5. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Thanks .Actually, I need quite a high resolution 512x512.

    I found out why it's not working in the rendertexture. When I set AntiAliasing in RenderTexture to something other than None, it will not render. Maybe it's running out of texture memory?
     
  6. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    I see, i have no idea without seeing in action really and i dont have means to test it right now. Maybe submit a bug report?

    But before that, try it with one shader and remove the antialiasing/half pixel checks from the vertex shader (#if HALF_PIXEL...#endif #if D3D9... #endif)
     
  7. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  8. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    If it Works in another Project but not with your big Project, that means some other script/shader is overwriting something.
    Or while you duplicate the camera, you forget to set some details. Instead of duplicating, please re-create the camera and its texture/depth variables.
    Also check your Project for leaks. And re-start unity if needed.
    If still doesnt solve, i think it is as you say some texture count limit of your graphics card or something else to do with unity itself.
     
  9. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I'm not sure what you mean. Of course I have set it correctly ,or it would not work. It works only if I turn of antialiasing in the rendertexture.

    I'm thinking it's a Unity issue, like many others. Works great in small scenes, but fails on big ones. No warnings/errors, nothing.
     
  10. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  11. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Oh, okay i just checked nightvision v2, and it only applies the _NoiseTex in the start function, forgot to add it to OnRendreImage

    Add this line:
    base.material.SetTexture("_NoiseTex", NoiseTex);
    somewhere at the top of OnRenderImage() function.

    And then when you enable/disable the effect, it will bring back the noise again.

    Also for your first issue;

    I tried with the demo scene;
    *setup some objects behind with a new created camera, disabled guilayer/audio listeners, added SecurityCamera and NightVisionV2 (after doing the above change).
    *Set the camera to render to a rendertexture (default values)
    *Created a quad with unlit material to show the outcome, attached the rendertexture as _MainTex of this unlit material.
    Pressed play and it works, even i disable/enable the effect (on the second camera) couple times.

    Here is my camera setup:



    EDIT: This is appearently a Unity bug though, when you set a texture to a uniform variable, it should be there until you close the game/editor. Atleast it used to be.
     
    Last edited: Oct 15, 2014
  12. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Ok, second issue fixed. My first issue, I can't reproduce in smaller project, only in my large project. Even with your sample scene in the big project, it happens.
     
  13. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Very odd, but that probably means some other script or shader is interfering. Without seing all your Project files, all i can advice is to start a new Project and add your other scripts one by one until you find what is interfering.
    Do you get any error or warning messages at all? (try reimporting everything to see all warnings and errors.)
     
  14. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I tested on another machine which has a better graphic card, and there's no problem there. The problematic one was a Quadro
     
  15. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    So, you should still file a bug report. Even if its not a bug, unity should give support to a variety of graphic cards.
     
  16. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  17. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Well, to be precise the issue is a "limitation of the certain graphics card" rather than a "unity bug". Still, its Unity responsibility to find a solution. But i doubt they will be able to find time for such minör details while they are busy with Unity 4.6 and 5.0 (Which was in my opinion a stupid idea to announce the 5.0 release, although great idea for bringing in more money)

    Sorry i cant be in much help with your issue as its out of my boundaries.
     
  18. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    No worries. Just wished that there is a warning or error rather than being failing sliently.
     
  19. pfernan

    pfernan

    Joined:
    Jan 13, 2015
    Posts:
    10
    Hello,

    I want to apply an effect to a camera that draws the background, and then render the main camera over it (without the effect applied to this last camera).
    Does this effects work on individual cameras?

    Also, it seems all links and your website is down, so I can't see the web demo at all :/


    Thanks
     
  20. willtrax

    willtrax

    Joined:
    Feb 9, 2013
    Posts:
    14
    I've been using the BlurH/V and scanline(security cam) shaders and have run into a problem.

    It doesn't appear that either of these effects are resolution independent. The visual effect is vastly different for someone running the game at 720p compared with someone running at 1080p.

    Any suggestions for a workaround?

    I would hate to have to scrap the shaders but results need to be consistent across all resolutions. Any advice would be appreciated. thanks
     
  21. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    The effects are resolution Dependent, thats why the difference occurs.

    What you must do is;
    *Do your adjustments on your default resolution, lets say 1024x768
    *And in your code make a float named "ratio = 1"
    *When the resolution changes to lets say 640x480, your variable will be "ratio = 0.625" (640 / 1024)
    So, for the BlurH and V, you must multiply the "blurStrength" value with this ratio value,
    And for the Security Camera effect, you must multiply it with the "thickness" value.

    It will show a small difference if your aspect changes from 4:3 to lets say 16:9 or otherwise, if this is a problem, we have to modify the shaders.

    Let me know if this helps.
     
  22. willtrax

    willtrax

    Joined:
    Feb 9, 2013
    Posts:
    14
    Aubergine, thank you for the fast response. I had actually tried that approach, but after taking a second look, it appears that I neglected to convert the screen resolution to a float before calculating the resolution adjustment ratio. I think I have everything I need now to compensate for resolution changes.

    Thanks for your help.
     
  23. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    No problem, let me know if you need anything else. Also good luck with your game.
     
  24. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Now you can upgrade your pack to TOZ Image Effects for Unity 5.x for only 30$
    (Upgrade is free if purchased after approx.: Mar 18, 2015)