Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Scion - Filmic Post Processing

Discussion in 'Assets and Asset Store' started by Aieth, Jul 9, 2015.

  1. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    Thank you for the in depth explanation! I'll admit I only understand about half of it because I have no shader programming experience, but I understand that there are technical limitations to the number of tweakable settings we can have.

    I've spent the past one and a half days messing around with parts of the shaders to see if I can get the bloom to look more like what I was expecting it to look like. The whole Scion package is a really huge and complex beast, and glancing over the code looking for the place where I can tweak a few things I'll have to flat out admit that about 90% of the things you wrote are waaay beyond my knowledge. You have my utmost respect and I'm really thankful that you've put in all the hard work and made this excellent PostFX solution!

    Trying different things out, for the first time I really looked at the corridor example scene that comes with Scion and it occurred to me that a good portion of why certain aspects of Scion don't work out for me is that my usecase is something like an aerial drone perspective with the screen being roughly 200m wide, and out of the box Scion seems to be a better fit for AAA first person shooters.

    The problem that I have with the bloom effect is that it makes the image blurry and reduces contrast a lot, especially if the screen is full of small detailed shapes. This is a lot less problematic in a SciFi indoor environment with mostly bigger high contrast shapes and lights. To me high bloom values looked like there was a thin film of vaseline smeared over the lense of a camera and in my personal usecase this was an even bigger issue. I guess the solution that works best for my usecase might break down on others where the out of the box approach is the right fit. For me it's not a better-or-worse question, I was just looking to add a different look as an option. So my newly defined goal was to make as few changes as possible to the shader and retain the original functionality without overwriting it.

    I ended up only changing CombinationPass.shader in two places, and so far that seems to do what I want. I have basically thrown a solid day of pure mindless trial and error at the shader until it looked ok. The original bloom is lerped with the image and I wanted it to be an additive blend, but the original bloom overall is too bright for that. I think that is the main reason why some people where asking for a threshold level. It was probably not that they absolutely needed the threshold, they most likely just wanted the bloom to be more pronounced on very bright areas and almost nonexistent in non-bright areas. So instead of adding a threshold I just did some very weird math to the bloom texture and composed it over the image with a mix of lerps and straight up adding the values. The result looks pretty much like I want it to, but I would not have been able to plan this. It's pure trial and error madness that does not seem to have a significant impact on performance on my system, but it might very well be entirely unsuitable for mobile GPUs because I'm using sqrt() two times and I could imagine that to be costly. I was surprised not to see the FPS drop, but then again... I basically have no shader knowledge, so there very well may be glaring flaws in my code that I don't know about.
    One more thing I want to mention, is that I solved having the old approach present as an option by splitting the BloomIntensity slider. 0 to about 0.7 now is mapped to the old 0-1.0 range and about 0.7 to 1.0 is the place where my new solution lives on the slide. I think that is because you did some math to the number before it gets passed to the shader and I'm ok with having only the small part of the slider for my blending solution.

    In CombinationPass.shader I changed this in " float3 SampleOnlyBloom(float3 clr, float2 screenUV)"

    Code (csharp):
    1.  
    2.      /////////// old vanilla code /////////////////
    3.      //  clr = lerp(clr, bloomTexture * BloomBrightness, BloomIntensity);
    4.      //////////////////////////////////////////////
    5.  
    6.  
    7.      //////////// begin new code //////////////////
    8.      if (BloomIntensity <= 0.5) {
    9.        clr = lerp(clr, bloomTexture * BloomBrightness, BloomIntensity * 2.0);          
    10.      }
    11.      else {
    12.        half3 blm = bloomTexture;
    13.        blm = sqrt(bloomTexture)*bloomTexture;
    14.        blm = pow(saturate(bloomTexture),2) / saturate(blm + 0.1);
    15.        blm *= sqrt(blm);
    16.        blm = lerp(blm,bloomTexture,saturate(bloomTexture));
    17.        clr = lerp(lerp(clr, clr + BloomBrightness * blm, BloomIntensity * 2 - 1), clr, saturate(clr) * 0.5);
    18.      }
    19.      ////////////// end new code //////////////////
    20.  



    and in "float3 SampleBloomDirt(float3 clr, float2 screenUV)" I changed this:
    Code (csharp):
    1.  
    2.      /////////// old vanilla code /////////////////
    3.      //   clr = lerp(clr, bloomTexture * BloomBrightness, BloomIntensity);          
    4.      //   clr = lerp(clr, bloomTexture * LensDirtBloomBrightness, saturate(dirtMask*LensDirtBloomEffect));  
    5.      //////////////////////////////////////////////
    6.  
    7.  
    8.      //////////// begin new code //////////////////
    9.      if (BloomIntensity <= 0.5) {
    10.        clr = lerp(clr, bloomTexture * BloomBrightness, BloomIntensity * 2.0);          
    11.        clr = lerp(clr, bloomTexture * LensDirtBloomBrightness, saturate(dirtMask*LensDirtBloomEffect));  
    12.      }
    13.      else {
    14.        half3 blm = bloomTexture;
    15.        blm = sqrt(bloomTexture)*bloomTexture;
    16.        blm = pow(saturate(bloomTexture),2) / saturate(blm + 0.1);
    17.        blm *= sqrt(blm);
    18.        blm = lerp(blm,bloomTexture,saturate(bloomTexture));
    19.  
    20.        clr = lerp(lerp(clr, clr + BloomBrightness * blm, BloomIntensity * 2 - 1), clr, saturate(clr) * 0.5);
    21.        clr = lerp(clr, bloomTexture * LensDirtBloomBrightness, saturate(dirtMask*LensDirtBloomEffect));
    22.      }
    23.      ////////////// end new code //////////////////
    24.  
    If you want to try it, just replace what I have commented out as "vanilla code" with the sections that I have posted above. I give no warranties of any kind of course :rolleyes:. I just fixed an error I had in the slider value remapping and made last minute changes to the code. There may still be other bugs.


    So far I didn't touch the lensedirt code. It would be pretty easy to split the lensdirt bloom intensity slider in the same way and introduce an alternative blending method. But I'm not sure if I even want to. The current implementation that makes the bloomed areas look blurry actually makes a lot of sense for lense dirt since it can't be caused by anything else other than dirt on the lense. I think having an option to have a similar additive blending like for the normal bloom could have some value for artistic decisions though. I might even play around with that and see if it works better for my usecase or not, but at the current time there is no need in doing that for me.

    Seeing how relatively easy it was to make some changes to the look that Scion delivers I'm confident that some other aspects could be customized to personal preferences as well and I had a lot of fun experimenting with the shader. I also learned a few things here and there. I highly recommend buying this package, now even more so than before!
     
  2. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Can also confirm scion works very well with the new shaders and SSR effect.
     
    GameTechnix likes this.
  3. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    A little bug:
    DepthOfField adaption speed only works when the focus gets closer.
     
  4. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Bit of scion bump, trying to recreate 'ratto vision', i think i should increase the focus range really and bouncing forth between the dof and camera settings is a bit of a pain, but i like scion a lot

     
    Exbleative, punk, Ghosthowl and 2 others like this.
  5. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I just added Scion post process and the camera view is inverted and the player ship is duplicated with a strange color only when i turn on DOF.
     
  6. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    What Unity version is this, what OS are you running, is MSAA on and are you running OpenGL/DX9/DX11?
     
  7. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    It works both ways, but the effect ends up more noticeable when getting closer. It's the same thing with exposure, one way looks like it's faster than the other.
     
  8. Quique-Martinez

    Quique-Martinez

    Joined:
    Oct 1, 2013
    Posts:
    141
    Had a similar issue. Disabling antialiasing on Quality settings worked for me.
     
    zenGarden likes this.
  9. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You are telling me that some we can't use Anti Aliasing with Scion DOF ?
     
  10. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    you could probably use it as image effect instead of the anti aliasing from quality settings
     
  11. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It ptoduced black screen if i am not wrong, i' ll make a try.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,026
    Scion performs best with HDR and Deferred. Both of those don't work with MSAA.

    You can use post process AA though.
     
    Martin_H and zenGarden like this.
  13. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    449
    Looks like the Carbine from Halo. I like the hexagonal details on it. Looks really dandy.
     
  14. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    Is there any way to make the lens flare work like the human eye? i.e. lens diffraction only at the same place as bloom. Currently there is this strange bad digital camera lens simulation where the lens flares are mirrored around different lenses in the camera glass.

    I can't seem to turn of the mirroring effect and localize the lens flare at light hotspots only.
     
  15. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    It is the carbine from halo :p
     
  16. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    449
    That's really neat, you did a good job recreating it.
     
    Last edited: Feb 18, 2016
  17. Quique-Martinez

    Quique-Martinez

    Joined:
    Oct 1, 2013
    Posts:
    141
    I was using a camera fx for AA. Indeed Not all algorithms worked, some of thme produced that clack screen. Good luck.
     
  18. BigBot

    BigBot

    Joined:
    Sep 6, 2013
    Posts:
    1
    Hey @Aieth , any news on the WebGL compatibility ?
    We're using Scion a LOT in our project, but after the webplayer was killed, we had to switch to WebGL, but Scion goes blackscreen there.
    I read a comment of yours from few weeks ago, about looking into that. Any news?
    Thanks!
     
    jakovd and Deleted User like this.
  19. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
    Hello, I am strongly considering purchasing scion at my earliest opportunity.
    However I am wondering if scion supports volumes?
    For example, lets say I have one room that I want to be very bright I would want bloom to be turned up higher, but another room I would want it to be lower.

    Would it be possible to adjust the settings by using volumes?
    Thanks!
    --Joshua
     
  20. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    Looks like this asset is designed to do exactly what you want:
    https://www.assetstore.unity3d.com/en/#!/content/52850
     
    jammer42777 likes this.
  21. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
  22. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings Scion.

    I wanted to mention that I updated our Scion yesterday and it broke a bunch of our code that is not Scion's code. It's because Scion includes a ton of Unity assets that are not needed for Scion(but using in the demo I suppose). We have the project in REPO of course. We are just restoring scripts that were broken due to the update so no biggie.

    I would like to offer the suggestion of going about offering demo content like some other asset sellers do though - through a link in a readme in the project to download everything else. The Scion package should just be what is needed to run Scion. It really stinks when a project has all sorts of included extra scripts and assets in it - on update people have to carefully sort through what's in the package and remove all kinds of stuff. If you miss something and it happens to be the same script you have, but yours is custom, it gets overwritten. Don't even get me started on someone who might be new to Scion or Unity - it just creates a mess when the package has this much stuff in it. Anywho, great product, its in our live game on Steam, just annoyed about the clutter. :p
     
    Last edited: Mar 15, 2016
    montyfi, bac9-flcl and Martin_H like this.
  23. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Got error on 5.4beta10 with empty project and only Scion package imported:

     
  24. Xenonus

    Xenonus

    Joined:
    Jun 26, 2014
    Posts:
    53
    Yep, confirming the above in 5.4beta10:

    Assets/ScionPostProcess/Scripts/InspectorAttributes/Editor/InspectorAttributesEditor.cs(341,30): error CS0121: The call is ambiguous between the following methods or properties: `UnityEditor.EditorGUI.Vector4Field(UnityEngine.Rect, UnityEngine.GUIContent, UnityEngine.Vector4)' and `UnityEditor.EditorGUI.Vector4Field(UnityEngine.Rect, string, UnityEngine.Vector4)'
     
  25. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    145
    Same error for me too. Running Unity 5.4b10 on OS X 10.11.3. Happy to temporarily edit the script if you can provide a fix.
     
  26. dxmachina

    dxmachina

    Joined:
    Jul 4, 2012
    Posts:
    64
    Have the same issue. Sticking with 5.3.4 for now... but Scion is the only asset that is problematic for me in 5.4 (so far). If it didn't look so frickin good with Scion it wouldn't be a problem. :)
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Hey guys... i don't know if anyone is using UFE, but when I install this with Scion in my project, Scion breaks with it...

    I get this error when I have UFE installed in my project...

    Removing UFE fixes this...

    EDIT: Removing a conflicting script helped with this.
     
    Last edited: Mar 27, 2016
  28. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    I would like an official fix or recommendation on how to fix it as well. I'm running 5.4 too.
    I did make a change to a script to get rid of the warning for now, but I'm totally clueless what I really changed there. I can't fully remember to be honest. I think I just double clicked the error message and changed the null to "" in that line. So if anyone is feeling adventurous... give it a shot.

     
  29. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    @Cascho01, @Xenonus, @dxmachina, @Martin_H:

    I posted the fix to this issue a page back.

    Cause:

    Unity v5.4 added an additional overload to the UnityEditor.Vector4Field(). It can now accept both a string and a GUIContent for its second argument (as opposed to only a string). As null is valid to represent both strings and GUIContent structs, the call is now considered ambiguous. The fix is to provide a value that is definitively of either the type string or GUIContent.

    Solution:

    On line 341 in InspectorAttributesEditor.cs, replace null with any of the following:
    • ""
    • string.Empty
    • new GUIContent()
    • GUIContent.none

    This will fix the issue.

    Hope that helps!

    Be well!
    - S.

    PS: @Martin_H's solution is absolutely valid. Just wanted to provide the reasoning behind the error and any alternatives. Personally, I prefer "string.Empty" as it is the most explicit with less overhead than creating a GUIContent.
     
    Martin_H likes this.
  30. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    I totally missed that you posted it already, thanks for sharing! I'm much more comfortable knowing this actually works and I didn't do anything horribly wrong. Thanks a lot!
    Would (string)null also be ok? At least it seems to work and is closer to the original.
     
    S_Darkwell likes this.
  31. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    Yes, though I imagine there would be additional overhead from typecasting.

    Additionally:
    (type) typecasting performs additional checks to ensure that the value is not null, though in this case it wouldn't result in an error.
    "As" typecasting skips that additional check.

    So:
    Code (CSharp):
    1. (string)null
    is more expensive than:
    Code (CSharp):
    1. null as string
    And, I suspect either method is more expensive than "string.Empty" which is the same thing. You could even use default(string) if you wanted.

    - S.
     
    Martin_H likes this.
  32. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    Very interesting. Thanks a lot for the explanation! I'll go with string.Empty then.
     
    S_Darkwell likes this.
  33. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    145
    S_Darkwell likes this.
  34. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Cant seem to run this anymore getting this: Combination shader not supported on this platform.
    It has worked in the past so not sure what I've done to make it stop working.
     
  35. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    @Aieth I think there is a way for scion to get pass the shader keyword limit to implement the so much needed additional features, the shader has to be built in editor with a script that allows customer to choose the which aspect will be toggle-able in runtime, so the shader built from script will have always on effects(no keyword spent), effect to be toggled (key word cost), always disabled effect (keyword not spent), this way scion can get much needed additional features!
     
  36. bakanekofr

    bakanekofr

    Joined:
    Feb 28, 2014
    Posts:
    121
    Purchased your asset some times ago, but I actually started using it just yesterday, and I love it!

    Are you still working on it? Optimizing or adding effects? Motion blur in the same pipeline would be awesome!

    Here's 2 shots from one of my WIP games called Light Fairytale:





    Cheers!
     
    Tethys likes this.
  37. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Ehi Aieth,
    Scion was not updated since November 2015. Asset is still alive? :)
     
  38. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    any chance to update this asset ? it's no more compatible with the latest unity versions
     
  39. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Probably best to send @Aieth a PM or email, as he hasn't visited the forum in a month.
     
  40. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    There will be a new patch out before 5.4 leaves beta. I don't have a lot or free time these days and I'm not using Unity in my day to day work, so forum visits have become rather sporadic. Mostly fixes, but I will make sure thresholding is there in the next patch as it has been the most requested feature.
     
    SAOTA, S_Darkwell and Martin_H like this.
  41. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Sad to hear that Scion will be left by the wayside. Adding a threshold to lens flare and dirt, etc is the most needed fix though so I'm glad that one is still coming.
     
  42. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    Left by the wayside is kind of exaggerating :) I will patch all compatibility issues and fix any potential bugs. The thing is, as a developer it is often hard to motivate adding features post release as the financial payoff is rather low to say the least. And as being able to pay my rent hinges on making money, well, you can see the issues. Perhaps the situation would have been different if the Asset Store supported DLC, subscriptions or some other way of getting paid for continuous development.
     
  43. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    I totally understand. Especially since the future development of the free cinematic image effects seems to aim to pretty much offer most of what Scion does for free. I sometimes think the asset store concept must be unviable for the majority of developers of code assets, simply because it requires too much maintainance and support for too little long term sales. Would you consider developing another big code/shader asset in the future? Or have you completely gone back to regular work?
     
    Tethys likes this.
  44. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    576
    Hello im trying to make objects pop in/out of dof range and it works only when closer to camera, why doesnt it work when object is far from camera?
     
  45. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    If I'm understanding correctly what you are trying to do, the reason is that real cameras can't do that either and Scion is emulating a camera. Might have more luck with other DOF effects that don't try to give a realistic representation of how a camera works.
     
  46. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    576
    real cameras can do that, that why we have macro shots
     
  47. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    For real-life digital cameras, four factors affect the depth-of-field.
    • Aperture
    • Sensor size
    • Lens focal length
    • Distance of focal point to camera
    Depending upon your sensor size, it can be difficult if not impossible to photograph subjects with a narrow depth-of-field, even with very low apertures.

    I'm not certain exactly what (if any) sensor size Scion emulates, but it's normal that the more distant the focal point, the wider the depth of field.

    - S.
     
    Last edited: May 5, 2016
    Martin_H likes this.
  48. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    576
    do you see the picture? i did such photos myself
     
  49. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    Yes. Your subject is very close to the lens, thus allows for a narrow depth-of-field.

    My understanding of your earlier post is that you wished to do the same with a subject further from the lens, which is far more challenging for cameras to do.

    For example:

    This image was shot at f/1.4 with a 50mm lens and a Nikon full frame sensor.

    Even with that low aperture and decently-large sensor, there is a rather wide depth-of-field.

    - S.
     
    montyfi, Tethys and Martin_H like this.
  50. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    Additionally, I apologize. There is a fourth factor as well:
    • Lens focal length
    It's late where I am.

    Adding that fourth one to my original response.
    - S.
     
    Martin_H likes this.