Search Unity

Shadow Softener - Official Thread

Discussion in 'Assets and Asset Store' started by PolyVector, Sep 11, 2013.

  1. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Well, a good first step is to try out the example scene, and make sure that works.

    As for trying it out in your own scenes:

    If you're using the Deferred Renderer, everything should pretty much just work.

    If you're using the Forward Renderer, you'll need to edit shaders you want to receive softer shadows. You can do this automatically in many cases by simply right clicking on the shader and choosing Create->Shader (Shadow Softener). This will copy the shader and make a "softer" version of it.

    That's pretty much the basics. I have a plan for the next release to make this process even simpler by making the required edit be a single line of code that works with almost any shader.

    Hope that helps. :)
     
  2. robot-ink

    robot-ink

    Joined:
    Jul 1, 2011
    Posts:
    18
    vert/frag support would be awesome!

    thanks for the support and great asset
     
  3. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Thanks!

    Preliminary support for Vert/Frag is in my working copy (single line of code to add!), so it should be in the next release... I just need to find time to finalize/test/document. ;)
     
  4. Skunkie

    Skunkie

    Joined:
    Jul 2, 2012
    Posts:
    75
    Shadow Softener 1.3.0 has hit the Unity Asset Store

    [1.3.0]
    • Improved the basic method of integration. Now a single line is all you need in most cases!
    • New UsePass technique works with Vert/Frag shaders, like those produced by Shader Forge!
    • Simplified the Shader Converter to use UsePass. More advanced features now must be manually configued.
    • Updated Documentation.
    • Fixed Deferred+Spot shadows in all versions of Unity.

    Pretty big fundamental change in how you integrate Shadow Softener into your projects. We're hoping this makes it a lot easier for everything and gives quicker results. As always please get in touch if you have any issues.
     
  5. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    That's great news! The new Shader Converter tool sounds really neat! Can't wait to try it.
     
  6. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Just a question for everyone: I was trying to develop my own shadow filter, but got stuck on how to access the shadowmap. does anyone know how to do this? sorry if this is the wrong place to ask.

    -FuzzyQuills
     
  7. FogGobbler

    FogGobbler

    Joined:
    Mar 25, 2009
    Posts:
    147
    Hi guys,

    I´m having trouble to make ShadowSoftener work together with the Alloy Physicallly Based Framework shaders. I tried the converter and adding manually, but I´m not sure, if I´m doing it right. Alloys shaders run in deferred mode.

    Thankful for any help,
    Michael
     
  8. FogGobbler

    FogGobbler

    Joined:
    Mar 25, 2009
    Posts:
    147
    Never mind. I think I got it working :)
     
  9. unity_sg

    unity_sg

    Joined:
    Sep 14, 2010
    Posts:
    95
    Hi, I just buy your product and it looks great.
    I''ve just importated the package in a new project (DX11, deferred lighting, and Unity 4.3.4) and the shadows works fine.
    But, when I change the shader off the ground in your demo (per example for standard Unity diffuse shader), no shader appears on it0
    Could you explain me what am I doing wrong please ?

    Edit : The deferred lighting mode is set on your camera on the demo scene :)
     
    Last edited: Mar 7, 2014
  10. unity_sg

    unity_sg

    Joined:
    Sep 14, 2010
    Posts:
    95
    This interests me too ...
    It could be awsome to make them work together
     
  11. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Sorry this took me so long to reply, never got an email!
    Have you had a look at the Normal-Diffuse (Custom Filter).shader sample that's included? Access is pretty straightforward for Directional and Spotlights. The various macros used are mostly for compatibility between platforms.

    If you're in the Deferred renderer, the shader you use shouldn't matter, any deferred shader should automatically use Shadow Softener. Make sure you restart the editor, and you can configure the shadows from Shadow Softener/Shaders/Deferred/Resources/ShadowSoftenerConfig.cginc. If that doesn't work, make sure you don't have any other versions of Internal-PrepassLighting or InternalPrePassCollectShadows in your project.
     
  12. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I'm very sorry I never responded, the forums haven't been emailing me updates... might have to switch to rss or something. :/
     
  13. ZinniaSun2000

    ZinniaSun2000

    Joined:
    May 25, 2013
    Posts:
    1
    I want to change my TransparentShadowReceiver.shader using Shadow Softener, but the shader is error. Anyone Help Me, Please?


    Code (csharp):
    1. Shader "Selfmade/TransparentShadowReceiver"
    2. {
    3.  
    4. Properties
    5. {
    6.     // Usual stuffs
    7.     _Color ("Main Color", Color) = (1,1,1,1)
    8.     _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)
    9.     _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
    10.     _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {}
    11.  
    12.     // Bump stuffs
    13.     //_Parallax ("Height", Range (0.005, 0.08)) = 0.02
    14.     _BumpMap ("Normalmap", 2D) = "bump" {}
    15.     //_ParallaxMap ("Heightmap (A)", 2D) = "black" {}
    16.    
    17.     // Shadow Stuff
    18.     _ShadowIntensity ("Shadow Intensity", Range (0, 1)) = 0.6
    19. }
    20.  
    21.  
    22. SubShader
    23. {
    24.     Tags {
    25.     "Queue"="AlphaTest"
    26.     "IgnoreProjector"="True"
    27.     "RenderType"="Transparent"
    28.     }
    29.  
    30.     LOD 300
    31.  
    32.  
    33. // Main Surface Pass (Handles Spot/Point lights)
    34. CGPROGRAM
    35.  
    36.    
    37.     #pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview
    38.  
    39.         half _Shininess;
    40.  
    41.         sampler2D _MainTex;
    42.         float4 _Color;
    43.         sampler2D _BumpMap;
    44.         //sampler2D _ParallaxMap;
    45.         float _Parallax;
    46.        
    47.         struct v2f {
    48.             V2F_SHADOW_CASTER;
    49.             float2 uv : TEXCOORD1;
    50.         };
    51.  
    52.         struct Input {
    53.             float2 uv_MainTex;
    54.             float2 uv_BumpMap;
    55.             //float3 viewDir;
    56.         };
    57.  
    58.         v2f vert (inout appdata_full v) {
    59.             v2f o;
    60.             return o;
    61.         }
    62.  
    63.         void surf (Input IN, inout SurfaceOutput o) {
    64.             // Comment the next 4 following lines to get a standard bumped rendering
    65.             // [Without Parallax usage, which can cause strange result on the back side of the plane]
    66.             /*half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w;
    67.             float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir);
    68.             IN.uv_MainTex += offset;
    69.             IN.uv_BumpMap += offset;*/
    70.  
    71.             fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
    72.             o.Albedo = tex.rgb * _Color.rgb;
    73.             o.Gloss = tex.a;
    74.             o.Alpha = tex.a * _Color.a;
    75.             //clip(o.Alpha - _Cutoff);
    76.             o.Specular = _Shininess;
    77.             o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
    78.         }
    79. ENDCG
    80.  
    81.  
    82.  
    83.         // Shadow Pass : Adding the shadows (from Directional Light)
    84.         // by blending the light attenuation
    85.         Pass {
    86.             Blend SrcAlpha OneMinusSrcAlpha
    87.             Name "ShadowPass"
    88.             Tags {"LightMode" = "ForwardBase"}
    89.              
    90. //      CGPROGRAM
    91.  
    92. // Upgrade NOTE: excluded shader from DX11 and Xbox360; has structs without semantics (struct v2f members lightDir)
    93. //#pragma exclude_renderers d3d11 xbox360
    94. //          #pragma vertex vert
    95. //          #pragma fragment frag
    96. //          #pragma multi_compile_fwdbase
    97. //          #pragma fragmentoption ARB_fog_exp2
    98. //          #pragma fragmentoption ARB_precision_hint_fastest
    99. //          #include "UnityCG.cginc"
    100. //          #include "AutoLight.cginc"
    101.  
    102. //          struct v2f {
    103. //              float2 uv_MainTex : TEXCOORD1;
    104. //              float4 pos : SV_POSITION;
    105. //              LIGHTING_COORDS(3,4)
    106. //              float3  lightDir;
    107. //          };
    108.  
    109. //          float4 _MainTex_ST;
    110.  
    111. //          sampler2D _MainTex;
    112. //          float4 _Color;
    113. //          float _ShadowIntensity;
    114.  
    115. //          v2f vert (appdata_full v)
    116. //          {
    117. //              v2f o;
    118.  //               o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
    119. //              o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
    120. //              o.lightDir = ObjSpaceLightDir( v.vertex );
    121. //              TRANSFER_VERTEX_TO_FRAGMENT(o);
    122. //              return o;
    123. //          }
    124.  
    125. //          float4 frag (v2f i) : COLOR
    126. //          {
    127. //              float atten = LIGHT_ATTENUATION(i);
    128.                
    129. //              half4 c;
    130. //              c.rgb =  0;
    131. //              c.a = (1-atten) * _ShadowIntensity * (tex2D(_MainTex, i.uv_MainTex).a);
    132. //              return c;
    133. //          }
    134. //          ENDCG
    135.         }
    136.    
    137.    
    138. }
    139.  
    140. FallBack "Transparent/Cutout/VertexLit"
    141. }
     
  14. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Did your shader work to begin with? It looks like the shadow collector portion is commented out, and it just renders solid black for me.

    Here is a working sample of a transparent shadow receiver:

    Code (csharp):
    1. Shader "Transparent Sample" {
    2.  
    3. Properties
    4. {
    5.     _ShadowColor ("Shadow Color", Color) = (0,0,0,1)
    6. }
    7.  
    8. Category {
    9.     Blend  SrcAlpha OneMinusSrcAlpha
    10.  
    11.     Lighting Off
    12.     Zwrite OFF
    13.     LOD 300
    14.  
    15.     SubShader
    16.     {
    17.         UsePass "ShadowSoftener/PCF8X8"
    18.         Tags { "RenderType"="Transparent" }
    19.  
    20.         CGPROGRAM
    21.  
    22.         #pragma surface surf Custom
    23.  
    24.         struct Input {
    25.             float2 pos : POSITION;
    26.         };
    27.  
    28.         uniform float4 _ShadowColor;
    29.  
    30.         void surf(Input IN, inout SurfaceOutput o)
    31.         {
    32.             //Pass through shadow colour to lighting model
    33.             o.Albedo = _ShadowColor.rgb;
    34.             o.Alpha  = _ShadowColor.a;
    35.         }
    36.  
    37.         half4 LightingCustom(SurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
    38.         {
    39.             half4 c;
    40.             c.rgb = s.Albedo.rgb;
    41.             c.a   = s.Alpha * 1.0f-atten;
    42.             return c;
    43.         }
    44.         ENDCG
    45.     }
    46. }
    47. Fallback "VertexLit", 2
    48. }
    Here's the same shader with Point/Spot support:
    Code (csharp):
    1. Shader "Transparent Sample" {
    2.  
    3. Properties
    4. {
    5.     _ShadowColor ("Shadow Color", Color) = (0,0,0,1)
    6. }
    7.  
    8. Category {
    9.     Blend  SrcAlpha OneMinusSrcAlpha
    10.  
    11.     Lighting Off
    12.     Zwrite OFF
    13.     LOD 300
    14.  
    15.     SubShader
    16.     {
    17.         Tags { "RenderType"="Transparent" }
    18.  
    19.         CGPROGRAM
    20.  
    21.         // Shadow Softener requires Shader Model 3.0:
    22.         #pragma target 3.0
    23.          
    24.         // Define the Shadow Filter you wish to use:
    25.         #define SOFTENER_FILTER PCF8x8
    26.          
    27.         // Include Shadow Softener:
    28.         #include "Assets/Shadow Softener/Shaders/ShadowSoftener.cginc"
    29.          
    30.         // Use the addshadow flag to generate the required shadow passes
    31.         // Optional: Use fullforwardshadows to enable Forward Rendered Spot and Point shadows.
    32.         #pragma surface surf Custom addshadow fullforwardshadows
    33.  
    34.         struct Input {
    35.             float2 pos : POSITION;
    36.         };
    37.  
    38.         uniform float4 _ShadowColor;
    39.  
    40.         void surf(Input IN, inout SurfaceOutput o)
    41.         {
    42.             //Pass through shadow colour to lighting model
    43.             o.Albedo = _ShadowColor.rgb;
    44.             o.Alpha  = _ShadowColor.a;
    45.         }
    46.  
    47.         half4 LightingCustom(SurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
    48.         {
    49.             half4 c;
    50.             c.rgb = s.Albedo.rgb;
    51.             c.a   = s.Alpha * 1.0f-atten;
    52.             return c;
    53.         }
    54.         ENDCG
    55.     }
    56. }
    57. Fallback "VertexLit", 2
    58. }
    Hope this helps. :)
     
  15. Skunkie

    Skunkie

    Joined:
    Jul 2, 2012
    Posts:
    75
    For the rest of the week PolyVector and I are going to be at GDC!

    Unfortunately that means we’re not going to be available for support until next week. So hang tight!

    If you’re going to be at GDC, don’t be afraid to say hi out on the expo floor. You can find us on the official GDC app and I’ll be posting all our antics on Twitter.
     
  16. Skunkie

    Skunkie

    Joined:
    Jul 2, 2012
    Posts:
    75
    And we're back. We're trying to catch up with all PMs/emails/posts. Bare with us please.
     
  17. rezilausiv

    rezilausiv

    Joined:
    Nov 18, 2010
    Posts:
    126
    Hi

    That Shadow Softener looks great!
    Just a question: Would this ever work for Unity Android (free or pro) too?
     
  18. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Thanks. :)

    I believe it does work with Android on devices that support GLES 3.0.

    I'm not sure about Unity Android Free, but if you're allowed to use shadows it should work. :)
     
  19. Deleted User

    Deleted User

    Guest

  20. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    It's just my own take on bilinear PCF, there's no dithering like that GPU Gems technique.

    You're correct that "Kernel" is the appropriate term. :)
     
  21. Leanimal

    Leanimal

    Joined:
    Sep 1, 2013
    Posts:
    28
    I can't get anything other than the shader from the example scene to work on iOS. And this shader only rendered shadows at full strength. None of the other included shaders worked at all on mobile. Tried converting unity and SF shaders, and both show the soft shadows in the editor and game view, but not when building to mobile device. Tried every level of quality settings for build, no difference. Any suggestions?
     
  22. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Hi Leanimal,

    Assuming you're targeting ES2 devices, make sure you are using the shaders that start with Mobile/*. Desktop Unity shaders used with Sunshine require Shader Model 3.0 (or ES3) to function. Sometimes configuring "Shader Set" to "Mobile" in Sunshine's settings can help things too.

    Let me know if that helps.
     
  23. Leanimal

    Leanimal

    Joined:
    Sep 1, 2013
    Posts:
    28
    I'm using Shadow Softener, not Sunshine. All the shaders I am testing work fine on mobile, they just don't show the effect of Shadow Softener. I have attached a Mac (working softening) vs iOS (no softening) comparison. The iOS shader is a converted version of the Mobile/Bumped Spec shader, as you suggested.
     

    Attached Files:

    • $iOS.png
      $iOS.png
      File size:
      740.2 KB
      Views:
      1,068
    • $Mac.png
      $Mac.png
      File size:
      392.9 KB
      Views:
      1,108
  24. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    *facepalm*... Sorry, I'm a bit overworked at the moment! :oops:

    I'll look into this and see what's going on, thanks for bringing it to my attention.
     
  25. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Okay, so after some digging around, I can't see anything wrong with the shaders, apart from them requiring Shader Model 3.0 for the Shadow Softener passes... Are you sure that your iDevice supports OpenGL ES 3.0?

    Apple has a compatibility chart here
     
  26. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    Just bought this because i had troubles with Unity's bad shadow technique.
    But i'm a bit dissapointed, short range shadows are fine indeed, but long range shadows are..well...bad..
    Look at the arm of my player, that is a shadow cast by a tree like 40 behind me in shadowrange,
    it shows enourmous enlarged pixels on the arm, so the further you go, the worse it becomes..especially on smooth surfaces.



    or am i doing something wrong ?
    set my shadows to hard on the single directional light i'm having.
    using deffered rendering, quality all at the highest possible values, standard 7x7 filtering..
     
  27. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Sorry for the late reply, the forums didn't email me for some reason.

    The higher the filter kernel, the more you can potentially see the effects of the Shadow Biasing. There's no built-in mechanism for per-texel shadow biasing (Since Unity only uses a single sample), so Shadow Softener attempts to estimate this... I would try adjusting the Light's Shadow Bias first, but if you still have trouble feel free to PM me a test scene and I'll see if I can work out a solution for you.
     
  28. Leanimal

    Leanimal

    Joined:
    Sep 1, 2013
    Posts:
    28
    I am using forward rendering on an iphone 5s that does support OpenGL ES 3.0, so that's not the issue. I looked at the shaders and attached three for comparison here: the basic mobile diffuse shader, the converted mobile diffuse shader, and the full forward sample shader (which was the only one that worked for me on the 5s). I noticed the additions to the full forward shader not present in my converted shader, but the documentation seemed to indicate these were only necessary if using spot lights? (I am only using one directional light).

    Also, when I did try to make the additions manually, the compiler couldn't find the path to the Shadow Softener at this line:
    #include "../../ShadowSoftener.cginc"

    Do I need to change this or move the .cginc file?

    Also, will Shadow Softener work in deferred rendering with only OpenGL ES 2.0?
     

    Attached Files:

  29. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I'll try out your shaders tonight on my Nexus 7 (closest thing I have to an iPhone) and see what's going on. As for the include path, it has to be relative to where you place the shader. The simplest solution is to make the path absolute:
    #include "Assets/Shadow Softener/Shaders/ShadowSoftener.cginc"
    I'll make this change in the next release to be more clear.
     
  30. Leanimal

    Leanimal

    Joined:
    Sep 1, 2013
    Posts:
    28
    Thanks for looking into this!
     
  31. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    Thanks, but it seems that it was a glitch and after restarting my PC the pixelated effect was gone, all is good now !
    So after some testing i can definitely say that these shaders are way better then the Unity shaders, it even resolved
    the glitching with shadows with a low near clipping value and large far clipping values, so this is probably my best buy yet on the store.
     
  32. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Ohhhh, okay! Unity sometimes requires that the Editor is restarted after swapping out Deferred shaders, so that probably is all that was going on.

    I should have thought of that sooner, but I'm glad it's working for you now.
     
  33. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Oops, I completely missed this question. Shadow Softener always requires SM 3.0 to my knowledge.
     
  34. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Okay, I finally figured out what's going on. Basically, Unity processes shadows differently on Mobile. It doesn't actually use a ShadowCollector pass, so the only way to get ShadowSoftener to override shadow sampling on GLES is to do the more "advanced' method of integration where you include ShadowSoftener.cginc just like the Full Forward sample...

    On my Nexus 7, the Full Forward sample shader works as-is.

    I'll update the documentation in the next release to reflect this requirement.
     
  35. JuanCamiloAlcaraz

    JuanCamiloAlcaraz

    Joined:
    Apr 30, 2014
    Posts:
    7
    Hi, I am working with custom shaders most precisely Marmoset Skyshop shaders. https://www.assetstore.unity3d.com/#/content/8880 for an IOS development. Do you know if the ShadowSoftener works on this kind of shaders? do you know how complex may it be the integration?. btw, I am using a single directional light in forward rendering mode over a single object with multiple materials (Iphone 4S or above). I will wait for your answer to buy it inmediately.
     
  36. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    No, i restarted the editor after installing the package, like was stated in the documents, i literally had to restart my PC to get it right.
    I guess Unity got unstable in memory, that sometimes happens with computers and software.
    Even a program restart sometimes aint enough, i had this happen before, it's just a hardware error.
    Sometimes a power reset can do wonders in resetting the IC's.
     
    Last edited: Apr 30, 2014
  37. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Unfortunately, OpenGL ES 3.0 is required for Shadow Softener, so it won't run on an iPhone 4S. Integration is a few lines of shader code with mobile devices at the moment, but for most desktop uses it's a single line that can be automatically added by the built-in converter.

    I've had that kind of thing happen with my computer after running VMWare, something gets out of whack until a reboot. :)
     
  38. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Hi, how do i remove shadow softener from my project? When I delete the folder my materials get screwed up. Thanks
     
  39. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    You should be able to delete the folder, and restart the Editor. Restarting is necessary to make sure the Deferred shaders get switched back.

    Of course, if you have any materials pointing to Shadow Softener shaders, you'll want to point them to something else or they'll turn pink.
     
  40. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
  41. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Unfortunately this wouldn't be possible because Shadow Softener simply modifies the filtering of Unity's built-in shadows. Techniques like VSM require a different shadow pass, a fatter rendertexture, and additional blur passes. It would require changes to the way Unity and ShaderLab work internally.

    That said, it would be pretty cool if it were possible!
     
  42. Skunkie

    Skunkie

    Joined:
    Jul 2, 2012
    Posts:
    75
    Unity 4.5 has been released and we know a lot of you will probably jump on upgrading with such vast improvements to stability. We have not tested Shadow Softener yet and we won't get a chance to until this weekend.

    If you do happen to upgrade, please feel free to report any issues you might find, but keep in mind we won't be able to address anything until this weekend.

    As always we thank you all for your patience.
     
  43. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Well... technically/in theory it's totally doable to fully replace the shadowcaster/shadowcollector passes with custom Cg code... but yeah, I wouldn't want to be the one to tackle or even prove this tbh, they sound scary to me :D probably a can of worms, that.

    Also, a shadow technique that does a blur pass sounds a bit overkill indeed. Unity's built-in soft shadows are plenty soft, and Shadow Softener's are the Softest Everest. Also this technique seems to have been cutting edge some 6-8 years ago, so I wouldn't be too optimistic that it does add a lot of value on top of today's / Shadow Softener's PCF..
     
  44. tobischw

    tobischw

    Joined:
    Aug 28, 2012
    Posts:
    21
    Hi,

    every time I try to convert a shader to the Shadow Softener, I get this error (I'm using Unity 4.3):

    Code (CSharp):
    1. ArgumentException: Empty path not allowed
    2. System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.IO/StreamReader.cs:159)
    3. System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding)
    4. (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string,System.Text.Encoding)
    5. System.IO.File.ReadAllText (System.String path, System.Text.Encoding encoding) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.IO/File.cs:587)
    6. System.IO.File.ReadAllText (System.String path) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.IO/File.cs:582)
    7. ShadowSoftenerConverter.GenerateSofterShaders () (at Assets/Shadow Softener/Scripts/Editor/ShadowSoftenerConverter.cs:71)
    8. ShadowSoftenerConverter.OnGUI () (at Assets/Shadow Softener/Scripts/Editor/ShadowSoftenerConverter.cs:54)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    12. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    13. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)
    14. UnityEditor.HostView.Invoke (System.String methodName)
    15. UnityEditor.HostView.OnGUI ()
    16.  
    I'm on a Mac, if that helps.
     
  45. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I can't seem to get this to happen (I'm on a Mac too). Would it be possible to PM me a project that reproduces this bug?
     
  46. tobischw

    tobischw

    Joined:
    Aug 28, 2012
    Posts:
    21
    Hi,

    it's a completely fresh, simple project with a model and textures on the ground, and when I try to apply the shader it gives me that error. I'm using ShadowSoftener 1.3, too.

    I'll attach a project once I get off work.

    Thanks.
     
  47. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Dear PolyVector,

    I don't understand how to setup shadow softener with deferred rendering and Skyshop with a simple directional light (sun).

    I need to illuminate ad interior vehicle so I have object that receive and cast soft shadows at the same time.

    I read your pdf but I cannot find any practical guide.

    With Forward Rendering I use your custom shader with cginc for the receiver, but I cannot work with deferred + skyshop.

    I hope in your support :)

    Thanks
     
    Last edited: Jun 10, 2014
  48. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Hi!

    I'm very sorry for the late reply, the new forums don't seem to email me when there's a post.

    I think the problem is that both Shadow Softener and Skyshop replace the Deferred shaders that come with Unity. In order to work together they will have to be merged somehow... The relevant shaders are Internal-PrePassCollectShadows, and Internal-PrePassLighting. If combining these two sets of shaders is too difficult, feel free to PM me a small project and I'll take a look at it to see what's possible.
     
  49. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I should have mentioned, I believe other people have had sucess deleting Shadow Softener's copy of Internal-PrePassLighting and restarting the editor. This allows Skyshop to do its thing with lighting, and Shadow Softener to affect directional light shadows. It's a quick compromise without having to try to merge such complex shaders.
     
  50. CaseJnr

    CaseJnr

    Joined:
    May 14, 2014
    Posts:
    43
    Has anyone got this working on an iPhone or iPad? I have devices that support OpenGL ES 3.0 but the shadows aren't soft like they are in editor.