Search Unity

Cinematic Image Effects (Pre Release) package

Discussion in 'Image Effects' started by willgoldstone, Dec 8, 2015.

  1. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    What tree system are you using? Speedtree?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    The gbuffer does get forward rendered opaque objects rendered into it though prior to the forward rendering pass. Right now it renders them black across all gbuffer channels for the purpose of getting proper depth, but that causes problems for post process effects that use the gbuffer normals. It would be awesome if there was a shader pass for "ForwardDeferred" to render normals, depth, and maybe some specular smoothness values to the gbuffer so that opaque forward rendered objects could still take advantage of these kinds of post process effects.
     
  3. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,783
    Yep SpeedTree. There is definitely something really bad going on with their shaders. If the sun shines through the leaves the colours are terrible. This never used to be an issue so it's been introduced in newer versions of unity.

    Just FYI, Unity is responsible for these shaders, not SpeedTree.
     
    Last edited: Apr 21, 2016
    einWikinger likes this.
  4. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Did you try reimporting the folder. They work properly for me on 5.4 beta 16(ish).
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    well i don't have beta 16. . . .
     
  6. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    sure, but it also works here on 14 and 15 :) Just right click the cinematic effects folders and select reimport.
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    hippocoder, Peter77, Rycons and 4 others like this.
  8. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    We're seeing lots of issues with speedtree shaders as well.

     
  9. looki666

    looki666

    Joined:
    Sep 5, 2013
    Posts:
    79
    Same problems in Deferred - with viewpoint against sun .
     
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Alright i'll try it later, haven't tried reimporting the files
     
  11. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225

    TAA has some really nice advantages when it comes to effects that can build up results over multiple frames :) Normal sample count here is 24 ;)
     
    Paulohmm, ZJP, hippocoder and 3 others like this.
  12. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    making that *.gif my desktop background...
    scratching lines on wall and counting days for beta16 relise...
     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I know right? Tim's just flaying us alive with this stuff.
     
  14. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Lets not get too far ahead of ourselves here though just yet. The version we we have currently has some known issues that make it a bit hard to use in general scenes (the issues are not hard to fix, we just need to DOWIT).

    Currently they are:
    • Clamping of HDR result, leading to broken bloom
    • Need some tonemapping / inverse tonemapping in the effect because HDR can lead to weird issues
    • Transparency not rendering after TAA (easy fix, we just did a dumb thing and i've fixed it locally)
    • Need to do de-jitter in separate image effect AFTER transparent rendering, whereas TAA happens after opaque :/ something something uber effect needed
    • Still a bit too blurry for our liking (hardest to fix)
    These things are why it's still in a separate branch, when this is done we will bring it into trunk :)
     
    AdamGoodrich likes this.
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I guess combining the post eventually will allow you to amortize a lot of it, such as your AO example above. Maybe possible for bloom and DOF too, which could offset the cost a lot from fixing up HDR and so forth (if it's at all costly).
     
  16. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    :)
     
    Martin_H, Paulohmm and hippocoder like this.
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    your jedi mind trick not gonna work. . . . .
     
  18. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    So... does that mean we ARE (possibly) getting an uber effect out of this?? Don't want to read too much into it but if that's the case...

     
    hippocoder likes this.
  19. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I'd be happy with just an improved SSAO, ie with complete features like min/max distance, near/far distance falloff, given enough settings you can tailor an effect better.
     
  20. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    This is caused by the SoftOcclusionLeaves shader's not using the proper render queue. If you look at the source of that shader, you can see it says "Queue" = "Transparent-99", which is a value (2901) that falls out of the range of what Unity considers as "geometry". What this means is that when updating the depth texture, the leaves get ignored.

    To fix this, copy the source of TreeSoftOcclusionLeaves.shader into your project, and change the "Queue" = "Transparent-99" line into "Queue" = "AlphaTest". After this, any new materials created using this shader will have the proper render queue and will work nicely with DoF effects.

    You probably want to fix existing materials too as the render queue value was serialized into material files when they were created and won't change automatically. To change it, select the material and go to the debug mode of the Inspector, change the value of the "Custom Render Queue" field to something between 2450 and 2500.
     
    Martin_H and Lightning-Zordon like this.
  21. theprotonfactor

    theprotonfactor

    Joined:
    Oct 10, 2014
    Posts:
    140
    Beta 16 is live. Time to try some TAA!!!
     
  22. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Tried both but it does nothing :(
    Please check attached package - thank you!
     

    Attached Files:

  23. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    457
    Does it works ?
     
  24. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    I imported your package and couldn't see the kind of artifacts in your previous screenshot anymore. Can you attach your screenshot of Treescene.unity here? Also, can you try the workaround on the same scene that produced your original screenshot?
     
  25. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Of all the times for this thread to go a bit quiet, I didn't expect it to be just after TAA was available via motion vectors in 5.4b16!

    I tried it but I am not best suited to giving initial feedback because I've had the luxury of completely avoiding all forms of anti-aliasing until now, I had the luxury of waiting till TAA was available. But this makes me ill equipped to rate the solution in its current state or compare it to others.
     
    Devil_Inside likes this.
  26. theprotonfactor

    theprotonfactor

    Joined:
    Oct 10, 2014
    Posts:
    140
    I've been skimming through Nvidia's PostWorks and it seems like a working plugin for TXAA is now possible. Although the new AA is way more practical, so its probably not be worth the effort. Unity's TAA seems to work pretty well but I haven't found a good scene to properly test it out yet.
     
  27. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    There seems to be an error if SMAA (TAA branch) is enabled before running the scene. Quick workaround, add:

    Code (CSharp):
    1. if (source == null) return;
    in OnRenderImage() of SMAA.cs.

    Testing it on a simple scene with a spinning cube, the temporal aliasing finally gets rid of the crawling pixels along sharp edges. On the flipside, depending on the Fuzz Size the vertices of the cube will jitter. You have to tweak a bit to find the balance between anti-aliased edges and fuzzy vertices. But it looks promising, temporal aliasing is clearly part of the secret sauce that make Unreal and Crytek look so smoothly and cinematic. Now I'm going to try how it looks with a more complex scene, especially specular highlights.
     
  28. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    In the Corridor Demo, SMAA with Temporal enabled unfortunately still has a lot of aliasing. The Temporal Anti Aliasling script on the other hand fares much better, but it also adds more blur (with the default settings, haven't tweaked yet).
     
  29. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    123
    Is someone getting spammed by these?

    Kernel index (-1) out of range.

    I'm using 5.3.4p4
     

    Attached Files:

  30. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Here´s the screenshot:



    On both scenes I imported the TreeSoftOcclusionLeaves.shader from the shaderspackage changed its name to "NatureEdited/Tree Soft Occlusion Leaves" and changed the lines 18 and 102 to "Queue" = "AlphaTest" as you described.
     
    Last edited: May 3, 2016
  31. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    I'm not so sure if that even can look better with image effect DOF. Does anyone have a technically identical usecase where it looks like the photoshop mockup?

    In my opinion you are using way too much DOF here, try turning it down a lot and see if the artifacts are still noticable at all. Do you have an actual usecase that you could show, something from a game you are working on maybe?
     
  32. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    My example scene from above is just a very quick setup to show the problem.
    Of course there are technical usecases (e.g Tiltshift, artistic styles....):

    Despite this, if Unitys posteffect provides these DOF-ranges (which is very cool and useful) it should work together with the provided shaders, no?
     
    Last edited: May 3, 2016
    DxStd_IgnatPribylov likes this.
  33. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    So that second issue with the tree leaves looks like a bug. Would you be able to raise it here: https://bitbucket.org/Unity-Technologies/cinematic-image-effects so we can investigate? (with small attached reproduction project).

    With regards to transparency + DOF, it's an unsolved issue in the whole area of realtime computer graphics.
     
    AcidArrow likes this.
  34. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Done

    Yes, I knew about this, hopefully there´s a chance to fix the problem.
     
  35. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Im loving the new bloom effect. Quick question, what exactly does the "high quality" flag do?

    Also, is this new bloom suitable for high end mobile devices?
     
  36. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Actually I tried the bloom effect on an LG G4 and it creates big white squares wherever it would normally put a bloom effect. Is this a known issue? Is there a particular camera setting or other setting that need to be set to enable this?
     
  37. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi

    I am just wondering whether it is possible to attach the TonemappingColorGrading script to multiple cameras, because I am getting some very strange results.

    I have attached one to a Camera that uses a render texture which appears to work fine.

    However I have then attached it to another camera that is using a layer mask set to say "Counters". However when I change the settings on this one it seems to affect other cameras within the scene (that render other layers e.g. "background") that do not have this script attached to them.

    So is it possible to have multiple instances of this script attached to different cameras, each with different settings?

    thanks

    Nalin
     
    Martin_H likes this.
  38. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Happens when using linear color space and deferred rendering. Terrain highlights make it look like plastic, grass and trees break. It's hardly a new bug too. IIRC the first time I heard of it was during the closed beta for 5.0 and was about how the standard shader's roughness range just doesn't extend far enough for terrains.

    One question:
    I'm using the cinematic effects (BitBucket version) and they also show in the scene view. However, this makes working on UIs impossible since everything glows. Is there a way of turning that off without having to disable all the scripts?
     
  39. ArthurT

    ArthurT

    Joined:
    Oct 26, 2014
    Posts:
    75
    You can toggle the rendering for them in the scene view from the "skybox/lens flare" drop down, where you can disable only the image effects but leaving the rest on.
     
    TheSniperFan likes this.
  40. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    On GDC they said that some of those effects are working on mobile. Bloom, tonemapping and DoF in particular. What's the performance of those new effects?
     
  41. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Bloom doesnt seem to work on mobile. When i enable it on my lg g4, it shows big white squares everywhere.
     
  42. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Does anyone else have issues with Screen Space Reflections and Unity Grass? Reflective objects seem to be rendering on top of the grass. Not sure how to fix this. I guess I could try a 2 Camera setup, but that sounds like a stupid workaround.

     
  43. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    457
    Sure it is not the AO ?
     
  44. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Yeah, I tried that. It looks like it. But it is not.
     
  45. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    This is a bug in unity itself. Your workaround will work, but it's not a perfect fix (source should never be null). I've made a change that fixes this issue and it should be in a 5.4 beta soon.
     
    movra likes this.
  46. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    I responded to this in your thread :)
     
  47. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    I'm not sure I fully understand your setup. Do you have a multi-camera setup (with different depth on each one to set the rendering order) ? And when you add the TonemappingColorGrading script on one of your cameras it's also applied to the camera rendered before it ? In this case that's the expected behavior as in multi-camera setups each camera uses the result of the previous cameras as its background (which will thus be affected by any post-processing effect applied at this point and forward).

    If I misunderstood you, could you please send me a minimal repro-scene so I can see what's going on ? Thanks !
     
  48. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,828
    Hello,
    I was wondering if Unity would consider to maintain some comments in the standard assets scripts which explain any updates made to the scripts. This would apply to camera effects scripts, character controller scripts, etc.
    The problem is when the standard assets are update, there is really no way to easily determine if something changed, other than to analyze and compare the scripts. If each file had some change log, it would be much easier to determine what changed. In the past I had to do a file compare of the DOF script to see what changed, because our scripts which communicate with the DOF script were no longer worked. It was then determined that the DOF script had changed and operated differently.
    This would apply to the shader files too.
    Thanks
     
    Last edited: May 24, 2016
    hopeful likes this.
  49. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    Can't you use camera depth in order to filter the background layer in the foremost camera?

    Like:

    float rawDepth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, newUV);
    if (rawDepth < 1.0) { rawDepth = 0; }
    return color1 * (1.0 - rawDepth) + color2 * rawDepth;

    This is what I did for this artwork since I rendered the background mountains and sky with a different camera and didn't want it to be affected by the tonemapper.
     
    Last edited: May 25, 2016
  50. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Although it's not the case for all standard assets, the Cinematic Image Effects package is actually open source and we use version control (mercurial, in this case) so you can follow any modification made to a source file and see what changed exactly with each update (you can also easily revert to an older version). Go here and click on a commit hash to see a version diff :)
     
    ArachnidAnimal likes this.