Search Unity

Sunshine! - Official Thread

Discussion in 'Assets and Asset Store' started by PolyVector, Aug 1, 2013.

  1. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    They were properly set up in the last version, I must have accidentally swapped them out at some point during testing. I'll fix this in the next release.
     
  2. meganuke

    meganuke

    Joined:
    Aug 23, 2013
    Posts:
    15
    oh,, i dont have latest version, i have the previous one.

    ok, it worked!!, i managed to made it work on the ouya.!!!

    thanks!! its a great asset!!

    one advice: create another sample scene: sunshine_sample_OUYA_tegra3
     
  3. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I'm so glad it worked out. There's a lot of performance considerations on the Ouya, like running in 720p being much faster than 1080, and making sure to limit the shadow casters to the bare minimum, but you'll get the hang of it.

    Let me know if you have any other questions. :)
     
  4. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    196
    Hello. I installed Sunshine (Desktop/dx11/Deferred-Linear/Volume Scattering enabled/Shadow mapping - disabled) and have it working with Unistorm very nicely.

    I am not using the sunshine shadows and do not need them. I would like to free up as many shader keywords as possible so that I can install Lux/AFS3 and RTP. Does anyone know which shaders I can safely delete from the Sunshine folder? I am only using the volume scatter in deferred so I don't need to use so many shader keywords (I think)

    Also I have a sun and a moon light directional light. I added a second sunshine prefab to my scene for the moon and it seems to be working ok. Is this alright to do? The docs say I should only have one sunshine in the scene and the dev took the time to make a debug msg warning me about the second sunshine instance. Is there a better way to do this?

    Thanks
     
  5. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    The only shaders you need in this situation are Shaders/Sunshine.cginc and anything in Shaders/Core/*... Other shaders can be safely deleted.

    The main problem with using two Sunshine prefabs is that one will override the other's settings since they are accessed through a "singleton". I would recommend adding a script that assigns Sunshine.Instance.SunLight to your Sun or Moon light depending on the time of day.

    Sunshine can only support a single Directional light anyway due to the way it integrates with Unity.
     
  6. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    hi,
    great asset, looks really, really awesome in my scene.
    i tried to implement oculus support, but it won't let me attach the master camera. it always stays with "none (sunhine camera)".
    when i open it, i have the left camera as an option, but i can't select it, in the end i get the sunshineeffect on one camera only. what am i missing?
     
  7. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Make sure you add the SunshineCamera script to both the left/right eye camera, they should take care of the Scatter/Shadow effects in both eyes.

    If you still have trouble, feel free to send me a small scene showing the problem and maybe I can spot what the issue is.
     
  8. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    thanks! the script was missing, now it works. :)
    but now the shadows wander around when i move :D
     
  9. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Remember you can set one SunshineCamera instance to be a Master, and one a Slave to prevent the shadowmaps from being created 2x per frame. It's a pretty big performance boost.

    Are the shadows wiggling, or completely wrong?
     
  10. Winterspree

    Winterspree

    Joined:
    Jan 8, 2013
    Posts:
    4
    Hi PolyVector,

    Thanks for a great product!

    I noticed a problem when trying to use Sunshine! and Shader Forge shaders that use alpha cutout. Sunshine will refuse to let cut out objects cast shadows until the alpha is at maximum (that is, no cut out). So, instead of casting shadows as you would expect from a cut out, you have either no shadow and cutout or full shadow and no cut out.

    Seems to be a problem with the shader function clip() but as I am not a very adept shader programmer (hence I use shader forge) I am not entirely sure. Would you know any solution to this off the bat, or is it possible for you to look into this?

    Thanks a lot,
    Robin
     
  11. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    It sounds like what is happening is that the alpha cutoff level (or global variable name for it) in the Shader Forge shader is different from Sunshine's Occluder shader. If you take a look in Sunshine Occluder.shader, you'll see that cutoff is specified by the _Cutoff global.
    Code (csharp):
    1. fixed _Cutoff;
    If your Shader Forge shader is using a different global variable for that purpose, you could rename it to "_Cutoff" to match Sunshine's.

    If all of your shaders use Shader Forge, and they share the same code for controlling alpha cutoff, you could alternatively edit Sunshine Occluder.shader to match your Shader Forge shaders.

    Hope that helps. :)
     
  12. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    sorry, i didn't have the time to test your suggestions.
    i set up sunshine completly new and the moving shadows are gone now. it looked like they were moving with the camera. when i took a step forward, they moved foward also. but this is gone now :)
    how do i set up a camera as slave? i could assign the right camera as master, but i didn't find a slave-option. at the moment i have doubled my drawcalls.. ;)
    thanks for your help!
     
  13. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    The shadows moving with the camera is a known problem with the Rift + Unity's built-in shadows in the Deferred renderer. Are you sure you're rendering Sunshine Shadows? You have to enable "Custom Shadows" in Sunshine's settings, otherwise it just does volume scatter with built-in shadows.

    The Master/Slave option is in SunshineCamera, which should be attached to both of your left/right cameras.
     
  14. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    ah, ok. it seems most of the problems are caused by the rift prefab. i am getting a black screen now and this problem is described there also. thanks for the hint :)
    for the master/slave. i have the script on both cameras. i can assign the right camera as the master on the left camera script. it won't let me assign anything on the right camera. i have the master-field, but it won't let me assign anything.
    so i guess, sunshine handles the other camera automatically as a slave?
     
  15. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Correct, you can only set one as Master, then Sunshine takes care of the rest. This should immediately reduce your drawcalls/fill in the stats.
     
  16. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    thanks a lot for help!!
     
  17. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501

    Thanks PolyVector for the product.
    My Sun light was changing color at run-time.

    I'm new in c# . At line 912 in script "Sunshine.cs" void Update () section
    I add this line of code into your script and works grate!

    Code (csharp):
    1.  
    2.  
    3.                 ScatterColor = SunLight.color;
    4.  
    5.  

    Regards, Alan
     
  18. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    I'm making a 10 km map with clouds at 2 km altitude. I'm looking for cloud shadow system. I do not need small shadows. I need big god ray environment.
    any suggestions? Do you think is possible to make it work?
    I'm trying with your product and I'm new in c#.
     
  19. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Sunshine's cloud shadows are essentially a cookie texture that's projected from a virtual plane.

    You'll want to set the "Overcast Texture" to something like the included sample cloud textures. This texture can be a RenderTexture if you want to get fancy and generate dynamic clouds at runtime.

    You'll want to use the "Plane Height" option to set the virtual plane's height to 2km.

    If you need the scatter/god rays to be affected by the overcast texture make sure to check "Use Overcast" in the Scatter settings. This does make the Scatter effect more expensive, but you can adjust the Resolution/Quality of the effect to compensate if needed.

    Hope this helps.
     
  20. shadowndacorner

    shadowndacorner

    Joined:
    Mar 9, 2013
    Posts:
    16
    I bought this while it was on sale last week, pretty freaking awesome stuff so far! I was wondering if you would consider implementing reflective shadow mapping, if only for the first cascade. I haven't looked through the code much yet, but I wouldn't think that it would be *too* huge of a thing to implement, given the fact that you should already have most of the information you'd need from your shadow pass.
     
  21. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Oh, so glad you're enjoying it. RSM is actually on my (rather massive) list of possible features. I've read up on the technique in the past, and I think it may be technically possible. To be honest though, I'm a little hesitant to even prototype that feature since Enlighten in Unity 5 will probably do a far better job of calculating light bounces.
     
  22. Tristan-Moore

    Tristan-Moore

    Joined:
    Aug 22, 2014
    Posts:
    18
    Does Sunshine work with Marmoset shaders for terrain and terrain details? We're really interested in using Sunshine but I was concerned about the replacement shaders for terrain, specifically grass and foliage.
     
    Last edited: Aug 29, 2014
  23. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    It's hard to say without digging through the shaders, but they may be hard to integrate in the Forward Renderer since terrain shaders tend to use up all available interpolators and leave few constant registers.

    Sunshine will most likely automagically work with Marmoset in the Deferred renderer.

    In either renderer, Sunshine can perform its Volumetric Scatter/Lighting without any integration issues by simply combining them with the built-in shadows. If you go this route, be sure to delete Sunshine's "Deferred" shaders and restart the Editor to avoid conflicts.
     
  24. Tristan-Moore

    Tristan-Moore

    Joined:
    Aug 22, 2014
    Posts:
    18
    Thanks for the response, from my understanding in the documentation sunshine brings in its own shaders for tree creator trees and grass, which Marmoset also does for their IBL effects on those objects. I really want to take advantage of Sunshine's optimizations for how often shadows get updated (we have a day night cycle and it would be super helpful from what I've seen), do you think we'd be able to manually merge the required functionality for the grass/tree shaders with the Marmoset ones or would we have to avoid using the Sunshine shadows?

    I only bring up because I've seen shaders conflict in packages before and I would love to take full advantage of both feature sets. Thanks!
     
  25. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Sunshine is specifically designed to integrate into other shaders, the included replacement shaders are more of a convenience for the basic set included in Unity. Sunshine should integrate with *most* shaders out there, with some work, but there are of course exceptions.

    If you pick up Sunshine, I'm always here to help with integration if you have trouble with specific shaders/packages. Of course if it doesn't work out for any reason feel free to take a refund, no questions asked. I try to keep my packages as risk-free as possible.
     
  26. Tristan-Moore

    Tristan-Moore

    Joined:
    Aug 22, 2014
    Posts:
    18
    Thanks! I appreciate your help. I saw Sunshine and Shadow Softener and I thing we're going to pick both up. They look great! Thanks for the prompt replies.
     
  27. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    No problem! If you wish to use them together, I highly recommend using Shadow Softener for all shadows, and Sunshine for volume lighting. This means you'd want to delete Sunshine's Deferred shaders and disable "Custom Shadows". It's just easier to manage this way.
     
  28. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    It doesn't work with Unity5.
    invalid subscript 'cust_sunshine_lightData' 'SunshineLightAttenuation': no matching 1 parameter function
     
  29. Fabian Schempp

    Fabian Schempp

    Joined:
    Jun 1, 2013
    Posts:
    17
    Hi, I would like to use the standard-assets-tesselation-shader with Sunshine. How do I have to modify it work with Sunshine?
     
  30. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I don't think Unity 5 is available to people who preordered yet (unless I missed it?) so for the time being Sunshine is not supported in that version.

    I can't actually test this since Unity doesn't support tessellation on Macs, but here's how I modified one of the tessellation examples to compile on my machine (I had to deviate from the manual a little bit):

    Code (csharp):
    1.  
    2. Shader "Tessellation/Bumped Specular (displacement)" {
    3. Properties {
    4.     _Color ("Main Color", Color) = (1,1,1,1)
    5.     _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
    6.     _Shininess ("Shininess", Range (0.03, 1)) = 0.078125
    7.     _Parallax ("Height", Range (0.0, 1.0)) = 0.5
    8.     _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
    9.     _BumpMap ("Normalmap", 2D) = "bump" {}
    10.     _ParallaxMap ("Heightmap (A)", 2D) = "black" {}
    11.  
    12.     _EdgeLength ("Edge length", Range(3,50)) = 10
    13. }
    14. SubShader {
    15.     Tags { "RenderType"="Opaque" }
    16.     LOD 800
    17.    
    18. CGPROGRAM
    19.  
    20. // Include Sunshine functionality:
    21. #include "Assets/Sunshine/Shaders/Sunshine.cginc"
    22.  
    23. // Multi-compile for different filters:
    24. #pragma multi_compile SUNSHINE_DISABLED SUNSHINE_FILTER_PCF_4x4 SUNSHINE_FILTER_PCF_3x3 SUNSHINE_FILTER_PCF_2x2 SUNSHINE_FILTER_HARD
    25.  
    26. // Require SM 3.0 on Desktop platforms:
    27. #pragma target 3.0
    28.  
    29. // Use the sunshine_surf_vert modifier, and exclude prepass/forwardadd to cut waste.
    30. #pragma surface surf BlinnPhong addshadow vertex:disp tessellate:tessEdge exclude_path:prepass noforwardadd
    31. #include "Tessellation.cginc"
    32.  
    33. struct appdata {
    34.     float4 vertex : POSITION;
    35.     float4 tangent : TANGENT;
    36.     float3 normal : NORMAL;
    37.     float2 texcoord : TEXCOORD0;
    38.     float2 texcoord1 : TEXCOORD1;
    39. };
    40.  
    41. float _EdgeLength;
    42. float _Parallax;
    43.  
    44. float4 tessEdge (appdata v0, appdata v1, appdata v2)
    45. {
    46.     return UnityEdgeLengthBasedTessCull (v0.vertex, v1.vertex, v2.vertex, _EdgeLength, _Parallax * 1.5f);
    47. }
    48.  
    49. sampler2D _ParallaxMap;
    50.  
    51. sampler2D _MainTex;
    52. sampler2D _BumpMap;
    53. fixed4 _Color;
    54. half _Shininess;
    55.  
    56. struct Input {
    57.     float2 uv_MainTex;
    58.     float2 uv_BumpMap;
    59.     // Required Sunshine Params:
    60.     SUNSHINE_INPUT_PARAMS;
    61. };
    62.  
    63. void disp (inout appdata v, out Input o)
    64. {
    65.     float d = tex2Dlod(_ParallaxMap, float4(v.texcoord.xy,0,0)).a * _Parallax;
    66.     v.vertex.xyz += v.normal * d;
    67.     SUNSHINE_WRITE_SURF_VERTEX(v, o)
    68. }
    69.  
    70. void surf (Input IN, inout SurfaceOutput o) {
    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.     o.Specular = _Shininess;
    76.     o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
    77. }
    78. ENDCG
    79. }
    80.  
    81. FallBack "Bumped Specular"
    82. }
    83.  
    84.  
     
    Last edited: Sep 3, 2014
  31. Fabian Schempp

    Fabian Schempp

    Joined:
    Jun 1, 2013
    Posts:
    17
    Code (csharp):
    1. Properties {
    2. _Color ("MainColor", Color) = (1,1,1,1)
    3. _SpecColor ("SpecularColor", Color) = (0.5, 0.5, 0.5, 1)
    4. _Shininess ("Shininess", Range (0.03, 1)) = 0.078125
    5. _Parallax ("Height", Range (0.0, 1.0)) = 0.5
    6. _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
    7. _BumpMap ("Normalmap", 2D) = "bump" {}
    8. _ParallaxMap ("Heightmap (A)", 2D) = "black" {}
    9.  
    10. _EdgeLength ("Edgelength", Range(3,50)) = 10
    11. }
    12. SubShader {
    13. Tags { "RenderType"="Opaque" }
    14. LOD800
    15.  
    16. CGPROGRAM
    17.  
    18. //IncludeSunshinefunctionality:
    19. #include "Assets/Sunshine/Shaders/Sunshine.cginc"
    20.  
    21. //Multi-compilefordifferentfilters:
    22. #pragmamulti_compileSUNSHINE_DISABLEDSUNSHINE_FILTER_PCF_4x4SUNSHINE_FILTER_PCF_3x3SUNSHINE_FILTER_PCF_2x2SUNSHINE_FILTER_HARD
    23.  
    24. //RequireSM3.0onDesktopplatforms:
    25. #pragmatarget3.0
    26.  
    27. //Usethesunshine_surf_vertmodifier, andexcludeprepass/forwardaddtocutwaste.
    28. #pragmasurfacesurfBlinnPhongaddshadowvertex:disptessellate:tessEdgeexclude_path:prepassnoforwardadd
    29. #include "Tessellation.cginc"
    30.  
    31. structappdata {
    32. float4vertex : POSITION;
    33. float4tangent : TANGENT;
    34. float3normal : NORMAL;
    35. float2texcoord : TEXCOORD0;
    36. float2texcoord1 : TEXCOORD1;
    37. };
    38.  
    39. float_EdgeLength;
    40. float_Parallax;
    41.  
    42. float4tessEdge (appdatav0, appdatav1, appdatav2)
    43. {
    44. returnUnityEdgeLengthBasedTessCull (v0.vertex, v1.vertex, v2.vertex, _EdgeLength, _Parallax * 1.5f);
    45. }
    46.  
    47. sampler2D_ParallaxMap;
    48.  
    49. sampler2D_MainTex;
    50. sampler2D_BumpMap;
    51. fixed4_Color;
    52. half_Shininess;
    53.  
    54. structInput {
    55. float2uv_MainTex;
    56. float2uv_BumpMap;
    57. //RequiredSunshineParams:
    58. SUNSHINE_INPUT_PARAMS;
    59. };
    60.  
    61. voiddisp (inoutappdatav, outInputo)
    62. {
    63. floatd = tex2Dlod(_ParallaxMap, float4(v.texcoord.xy,0,0)).a * _Parallax;
    64. v.vertex.xyz += v.normal * d;
    65. SUNSHINE_WRITE_SURF_VERTEX(v, o)
    66. }
    67.  
    68. voidsurf (InputIN, inoutSurfaceOutputo) {
    69. fixed4tex = tex2D(_MainTex, IN.uv_MainTex);
    70. o.Albedo = tex.rgb * _Color.rgb;
    71. o.Gloss = tex.a;
    72. o.Alpha = tex.a * _Color.a;
    73. o.Specular = _Shininess;
    74. o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
    75. }
    76. ENDCG
    77. }
    78.  
    79. FallBack"BumpedSpecular"
    80. }
    [/QUOTE]

    Thank you for the fast response.
    To bad it looks like the out param of the vertex shader is not allowed with tesselation.
    Is there another way to do it?
     
  32. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Looks like the forums stripped out a lot of formatting, let me try pasting it again:

    Code (csharp):
    1. Shader "Tessellation/Bumped Specular (displacement)" {
    2. Properties {
    3.     _Color ("Main Color", Color) = (1,1,1,1)
    4.     _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
    5.     _Shininess ("Shininess", Range (0.03, 1)) = 0.078125
    6.     _Parallax ("Height", Range (0.0, 1.0)) = 0.5
    7.     _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
    8.     _BumpMap ("Normalmap", 2D) = "bump" {}
    9.     _ParallaxMap ("Heightmap (A)", 2D) = "black" {}
    10.  
    11.     _EdgeLength ("Edge length", Range(3,50)) = 10
    12. }
    13. SubShader {
    14.     Tags { "RenderType"="Opaque" }
    15.     LOD 800
    16.  
    17. CGPROGRAM
    18.  
    19. // Include Sunshine functionality:
    20. #include "Assets/Sunshine/Shaders/Sunshine.cginc"
    21.  
    22. // Multi-compile for different filters:
    23. #pragma multi_compile SUNSHINE_DISABLED SUNSHINE_FILTER_PCF_4x4 SUNSHINE_FILTER_PCF_3x3 SUNSHINE_FILTER_PCF_2x2 SUNSHINE_FILTER_HARD
    24.  
    25. // Require SM 3.0 on Desktop platforms:
    26. #pragma target 3.0
    27.  
    28. // Use the sunshine_surf_vert modifier, and exclude prepass/forwardadd to cut waste.
    29. #pragma surface surf BlinnPhong addshadow vertex:disp tessellate:tessEdge exclude_path:prepass noforwardadd
    30. #include "Tessellation.cginc"
    31.  
    32. struct appdata {
    33.     float4 vertex : POSITION;
    34.     float4 tangent : TANGENT;
    35.     float3 normal : NORMAL;
    36.     float2 texcoord : TEXCOORD0;
    37.     float2 texcoord1 : TEXCOORD1;
    38. };
    39.  
    40. float _EdgeLength;
    41. float _Parallax;
    42.  
    43. float4 tessEdge (appdata v0, appdata v1, appdata v2)
    44. {
    45.     return UnityEdgeLengthBasedTessCull (v0.vertex, v1.vertex, v2.vertex, _EdgeLength, _Parallax * 1.5f);
    46. }
    47.  
    48. sampler2D _ParallaxMap;
    49.  
    50. sampler2D _MainTex;
    51. sampler2D _BumpMap;
    52. fixed4 _Color;
    53. half _Shininess;
    54.  
    55. struct Input {
    56.     float2 uv_MainTex;
    57.     float2 uv_BumpMap;
    58.     // Required Sunshine Params:
    59.     SUNSHINE_INPUT_PARAMS;
    60. };
    61.  
    62. void disp (inout appdata v, out Input o)
    63. {
    64.     float d = tex2Dlod(_ParallaxMap, float4(v.texcoord.xy,0,0)).a * _Parallax;
    65.     v.vertex.xyz += v.normal * d;
    66.     SUNSHINE_WRITE_SURF_VERTEX(v, o)
    67. }
    68.  
    69. void surf (Input IN, inout SurfaceOutput o) {
    70.     fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
    71.     o.Albedo = tex.rgb * _Color.rgb;
    72.     o.Gloss = tex.a;
    73.     o.Alpha = tex.a * _Color.a;
    74.     o.Specular = _Shininess;
    75.     o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
    76. }
    77. ENDCG
    78. }
    79.  
    80. FallBack "Bumped Specular"
    81. }
    Edit: Ah, I see it still doesn't like the 2 parameter version of disp()... hmmmm
     
    Last edited: Sep 3, 2014
  33. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Unfortunately it looks like you're right that the out param simply is not allowed with tessellation in Unity. Sunshine absolutely requires that data to function, so it appears that Sunshine isn't compatible with tessellation.
     
  34. Fabian Schempp

    Fabian Schempp

    Joined:
    Jun 1, 2013
    Posts:
    17
    :( thats sad. I hope they change it in future versions of Unity.
    I will find a non tesselation solution.
    Thank you.
     
  35. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I hope so too.

    You might get around that restriction by using the Deferred renderer, since the shadow calculations are performed in screen space and the shader wouldn't need modification. Then again, switching renderers is usually a pretty big decision.
     
  36. Fabian Schempp

    Fabian Schempp

    Joined:
    Jun 1, 2013
    Posts:
    17
    Sounds interesting. I will give it a try.
     
  37. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey,

    Did anyone ever successfully get this working with Alloy? I know there was talk ... what was the outcome? Is anyone able to share how they did it, as I doubt I would figure it out on my own?

    Also, whats the "Manually update shadows! Think of it as "baking" at runtime for level editors!" mean? I have a dungeon generated at run time, and shadows kill performance ... is that something that would help, or am I just hoping thats what it means? :).

    Is this predominately used for outdoor scenes, or would this be a benefit in a purely indoor environment? I'm running the Alloy shaders with deferred, no directional light (only points) ... its a dungeon ;).

    PS: I already purchased this a long time ago ... I just haven't explored it very much, so I don't know if it can benefit my current project.

    Thanks!,
    Dale
     
  38. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    In your case, Sunshine will be of no help, since it's only used for a single directional light. It's primarily for outdoor scenes, correct.

    If you do wind up using a directional light, it definitely can work with Alloy. In the Deferred renderer, Alloy has a few commented changes to their own copy of Internal-PrePassLighting. What you would need to do is copy these changes into Sunshine's version (Internal-PrePassLighting-40) and then delete Alloy's copy. After an editor restart, the two can be successfully combined.

    "Manually update shadows" simply means that the shadowmap doesn't need to be generated every single frame. You can choose to update it every X frames, after the player moves X amount, or manually refresh it from code. Many users have used this feature to only update the shadowmap when the level changes, which is why I liken it to runtime "baking".
     
  39. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Ah ok, thanks! I know you guys have a shadow softener as well ... would that work with my setup? If so, what's the speed? I can't really afford to make shadows answer slower.

    Thanks again,
    Dale
     
  40. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Shadow Softener does work on all light types, but unfortunately it doesn't have any ability to speed up shadows like Sunshine. It's simply augmenting the built-in shadow filtering to be higher quality, which is inherently a bit slower.
     
  41. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Interesting, thanks. If I can speed some things up elsewhere I may pick that up at some point then. Thanks!
     
  42. dshewmaker

    dshewmaker

    Joined:
    Oct 31, 2013
    Posts:
    18
    Sunshine Mobile Sample flashes the entire screen on my HP Slate 8 Pro. It has a Tegra 4 processor.

    Has anybody else experienced this?

    It also does it to my actual game also.
     
  43. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Does the robot demo work for you? I'm using a Nexus 7 2013 (also a Tegra 4) for testing and haven't experienced this.
     
  44. dshewmaker

    dshewmaker

    Joined:
    Oct 31, 2013
    Posts:
    18
    Yes the robot demo APK works, but the mobile demo scene that I build in unity does not.

    Testing some more if I turn of Volumetric scattering the flickering stops.
     
  45. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    I would also suggest turning down the lightmap resolution to see if it's related to memory usage. I've seen fullscreen flickering in Unity when VRAM is low (with and without Sunshine).
     
  46. dshewmaker

    dshewmaker

    Joined:
    Oct 31, 2013
    Posts:
    18
    I have set resolution to Eighth and sample quality to low and it still flashes/fickers full screen. I tried the opposite just in case with same results.

    I can't think of any more settings to try out.
     
  47. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    If the Light Resolution is low too, I'm a bit stumped. Does this happen in a blank project as well? I'm wondering if it's conflicting with another asset in some way.
     
  48. dshewmaker

    dshewmaker

    Joined:
    Oct 31, 2013
    Posts:
    18
    I haven't tried a blank project. I will try that.

    In further testing if I build with development build it still flickers, BUT if I attach the profiler it stops flickering, but of course jerks around and is slow.
     
  49. dshewmaker

    dshewmaker

    Joined:
    Oct 31, 2013
    Posts:
    18
    Thanks for the pointers.

    In a new project it works fine. Must be some project setting.
     
  50. PolyVector

    PolyVector

    Joined:
    Dec 24, 2011
    Posts:
    765
    Yeah, that is definitely strange. If you keep having trouble, feel free to PM me a scene that reproduces the flickering and I'll see if it's something I can fix on my end. If all else fails and it simply doesn't work for your project, hit me up for a refund.