Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Marmoset Skyshop - Image-Based Lighting Tools [RELEASED]

Discussion in 'Assets and Asset Store' started by monkeyscience, May 31, 2013.

Thread Status:
Not open for further replies.
  1. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    are you planning on fixing any memory leaks?
     
  2. Sikkey

    Sikkey

    Joined:
    Jul 30, 2014
    Posts:
    5
    - Completed reload, in 0.339 seconds
    -------- GLSL error: ERROR: Implementation limit of 32 varying components exceeded. Unable to allocate 'xlv_TEXCOORD3'.

    when i use assetbundle to load a scene. It'll make a memory leak problem.

    It‘s fine with only one scene(the loading scene), but I need load the others T_T.

    I use these shaders : "VertexColor/Marmoset Bumped Specular IBL", "Illumin/Marmoset Bumped Specular IBL" , "Marmoset Bumped Specular Glow IBL"

    Please help. :(
     
  3. bbedwell

    bbedwell

    Joined:
    Nov 5, 2012
    Posts:
    37
    Has anybody had success using Skyshop with a time of day extension (Time of Day, Mobile Sky System,etc.)?

    We want to show a dusk to dawn sky scenario while using Skyshop's ability to blend HDR skies.
     
  4. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yeah this is a bug I've resolved and will be patching in the next day or two. Basically glow, vertex color, and vertex occlusion shaders won't load on iOS right now, not enough vertex interpolants on the device.

    Also make sure you are using Mobile/ shaders on mobile platforms. The standard shaders won't load on iOS for a slew of reasons.
     
  5. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Of course! :p
     
  6. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    359


    Skyshop rules, this shaders are amazing.
     
  7. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    nice looking spidyyyy
     
  8. JCG_Hart

    JCG_Hart

    Joined:
    Jul 31, 2014
    Posts:
    1
    Hey Monkey Science,

    I'm just wondering if have /or plan to start testing skyshop with iOS8? currently the shaders come out black which is fine all things considered but I'm really hoping to use your shaders in a project but iOS8 will be released (by current rumour calculations) momentarily after we complete it.

    Thank you :)
     
  9. ultraschall

    ultraschall

    Joined:
    Feb 14, 2013
    Posts:
    30
    Hello Monkey Science,

    your product is really fantastic and it would be great to get some status about the following topics:

    1. Roadmap for iOS 8 compatibility

    2. iOS > Shader Unsupported & Loading Time

    When Testing on an Iphone 5, we get > 20 seconds load time with the following errors
    WARNING: Shader Unsupported: 'Marmoset/XYZ' - Pass 'FORWARD' shader state not supported
    WARNING: Shader Unsupported: 'Marmoset/XYZ' - Pass 'FORWARD' shader state not supported


    Thanks in advance.
     
  10. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    Hi,
    I get lots of shader errors using the mobile shaders on Android (nexus 10, galaxy tab 2 7", galaxy tab 3 10" ...).
    See attachment for error log.
     

    Attached Files:

  11. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    116
    We have a game which is using 1.03 and we are not able to upgrade (tried and it broke loads of things - reset all the shaders in our scenes - and really short on time).

    We are having the issue that quite a few experienced with Android and transparent shaders with reflections going nuts... is there a simple fix that we can use to sort this? What would you recommend?

    Thanks!
     
  12. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Where can I find the Shader Forge Extention zip file used in this tutorial? I would like to IBL in my shader creation. Thanks.
     
  13. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Are you seeing broken shaders or just the errors reported in the log? The shaders in question all attempt to use EXT_shader_texture_lod OpenGL extension, fail (because it is not supported on Android devices), and fall back to using specular Marmoset shaders that do not use mipmapped gloss.

    It could be that the shader fallback system is working correctly but still printing out the original error message. In which case, sorry for the console spam :(. However if you're seeing black or non-reflective shaders on the device, something else is broken.
     
  14. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Uhm, I guess I could get you an old build of Skyshop 1.04? It was a drastic change as well and started requiring Unity 4.2, but if you're interested, send support@marmoset.co an email with your invoice ID.
     
  15. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    The zip file is named "ShaderForgeExtension.zip" should be in the Marmoset/ folder of your project after you import Skyshop from the Asset Store.

    Be sure to extract it in place so that it creates a Skyshop/Extensions/ directory. You'll also want to import it after ShaderForge is already in your project.
     
  16. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I'm going to try pushing out a build to fix all the shader warnings tonight or tomorrow. As for iOS8 rendering everything black, I'll need to look into it.

    Anyone know if iOS 8 requires anything fancy from the Unity end? Like GLES 3.0 support?
     
  17. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    I dont know for sure, but i remember reading that Its supposed to be automatic GLES es 3.0 support on es3 devices if the app and device supports it for IOS 8
     
    Last edited: Aug 2, 2014
  18. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Hey monkeyscience... if you guys are taking feature requests for Skyshop, could we have a feature for placing the lights in the scene... such as for the directional light, we could just drag the light icon in the editor? It will save me time from having to select the light and then pick the sky to match it to :(
     
  19. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    Hi,
    I have a problem using maroset shaders in mobile, I try to include my shaders by include maroset shaders into Graphics Settings, however, when I do this, and then build an android apk, the mobile game stucks at the splash screen, but if I remove maroset shaders inclue in graphics settings, everything is ok, not sure if you can point me in the right direction(is it becasue of the include cg files..) , all shaders are mobile shaders.
     
  20. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    did you try to wait about 5 mins to see if it loads after? FuzzyShan
     
  21. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Hi, is there a way to force the skies blending to a certain point?
    Example: I have two skies, and want to blend between them during 10 seconds. Can I force the blending to go to how it would be after 5 seconds, and continue blending from there?
     
  22. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    If I'm understanding you correctly, you want to start a blend between two skies, jump the blend timer to 5 seconds and let it blend naturally for the rest of the 5 seconds?
     
  23. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Exactly!
     
  24. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    Hi monkeyscience,

    I used the skin shader for a client's character, and basically sold the client on using Skyshop based on the results:



    Then to get it to work on their target mobile platform I switched to Skin Fast IBL. Even with all other settings being the same, the switch made the character take on a sooty appearance, with blackness corresponding with the places where there should be fairly high specular intensity, like the lips:



    Were I going for a goth look this might be perfect, but unfortunately I need the skin to be healthy and glowing. :)

    You can see those areas in the Gloss mask (which I have in the alpha of the Diffuse texture):



    I can turn the Specular Intensity down to get rid of the black, but it dulls the skin down further than I would like:



    Naturally I'm hoping for the fast/mobile shader to look as much like the regular shader as possible.

    I realize these are beta shaders so I've adjusted my expectations accordingly, but if you can offer suggestions for a fix it would be a lifesaver!

    I also noticed changing the Translucency Color does nothing as far as I can tell, as if if that color isn't present in the skin. Even without a Translucency Map it does seem like a nice color to have for warming up the shadows. Is there any way to get that working?

    Thanks!
     
  25. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    That's a tough one. It's possible and a good feature request but I'll have to get back to you with a work-around. The problem is I don't increment a timer with a dt, I just use endTime - Time.time to do the blending. this makes easy-sounding stuff really annoying to implement tho >_<.
     
    Uli_Okm likes this.
  26. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Status of Memory Leaks
    Quick update on my findings so far: Skyshop's Auto-Apply does not appear to be leaking memory but churning memory. The difference being that the memory foot-print does not grow out of control over time, but constant allocation does hit the garbage collector quite a bit when blending and projection are enabled.

    As I understand it, C# allocates a heap of empty memory (Allocated Heap) and starts filling it up with every 'new' request (Used Heap). When someone requests the last bit of empty heap space, the heap calls garbage collect. GC will free up old, forgotten memory. If GC fails to clear up enough memory from the allocated heap, the heap grows.

    If an app is leaking memory, the allocated heap number would grow because GC finds nothing forgotten to clear. If an app is churning through a lot of memory and quickly forgetting it all, the collection calls grow but the heap size remains stable.

    Take a look at these numbers the iOS console profiler is printing out. These are stats on memory allocation and garbage collection over a 30 second window. The scene is an array of 300 spheres moving between local and global skies rapidly.

    NO PROPERTY BLOCKS (Skyshop 1.08.1):
    used heap: 368640 allocated heap: 786432 max number of collections: 6 collection total duration: 8.7

    Lots of memory allocation, likely because of material instancing/fragmenting. Lots of garbage collection but a stable allocated heap.

    AUTO-APPLY, PROJ, BLEND:
    used heap: 462848 allocated heap: 786432 max number of collections: 4 collection total duration: 6.4

    Fewer collections. Same allocated heap.

    AUTO-APPLY, PROJ, NO BLEND:
    used heap: 487424 allocated heap: 786432 max number of collections: 3 collection total duration: 5.3
    Fewer collections.

    AUTO-APPLY, NO PROJ, BLEND:
    used heap: 491520 allocated heap: 786432 max number of collections: 2 collection total duration: 3.4

    Fewer collections still. In the editor profiler the memory allocation per frame gets cut in half if either projection or blending is disabled. This likely means each feature is responsible for half of the per-frame allocations.

    AUTO-APPLY, NO PROJ, NO BLEND:
    used heap: 438272 allocated heap: 524288 max number of collections: 1 collection total duration: 2.1
    Only one collection. It seems Auto-Apply has some allocation overhead but not as much as actual projection and blending code.

    NO AUTO-APPLY, NO PROJ, NO BLEND:
    used heap: 245760 allocated heap: 262144 max number of collections: 0 collection total duration: 0.0

    Disable all features and memory usages drops to zero, hurray!

    I'm not very seasoned in writing garbage collected code, so I don't actually know if these numbers are horrible or fine. Some per-frame memory use is unavoidable, obviously, but how does this look running along-side the memory churn a typical 3D game will put iOS through?
     
    Last edited: Aug 5, 2014
  27. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Looks like you've found a bug with the specular map. Open up every skin shader and comment out the line:
    Code (csharp):
    1. #define MARMO_SPECULAR_FILTER
    Some shaders have fallbacks with specular filter still enabled as well. They shouldn't. I'll be fixing this in the next release.

    Translucency color in "Skin Fast IBL" is only affected by direct lights, image-based light translucency is ignored. Regular "Skin IBL" even has a separate slider for "Sky Translucency" that tones this down.

    If you'd like to enable sky translucency, there's a quick #define you can uncomment:
    Code (csharp):
    1. //#define MARMO_TRANSLUCENCY_IBL
    Be sure to also uncomment the sliders for it up top:
    Code (csharp):
    1. //_Translucency ("Translucency", Range(0.0,1.0)) = 1.0
    2. //_TranslucencySky ("SkyTranslucency", Range(0.0,1.0)) = 0.0
    One other notable difference between Skin and Skin Fast: specular highlights only come from direct light sources, no sky reflection cubemaps.
     
  28. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    That did it! No more black highlights:



    The scene I'm using has a direct light, so if I understand you correctly that means I should be seeing the translucency. Is that correct? It's actually your Moped project I'm using for demonstrations purposes (I just hid the Moped and plopped the character in there) and the direct light under Sky1 seems to be working - I can change the direct light intensity and see it affect the character. But the default Translucency seems to not be having the slightest effect.

    This is especially obvious after I try your next suggestion:

    That works great! Gives a nice warm glow to the skin, just like I was hoping for from the default settings.

    With some fiddling with other settings I've got the Skin Fast looking way more like the default Skin:



    Thanks for the tip. And for all your other help. And for Skyshop! I seriously always mention it in the same breath when talking about how much I like working with Unity.
     
  29. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Just run into this memory issue, and I thought it was something to do with NGUI + Skyshop being in a scene together (as when I disable NGUI there are no allocations every frame) but it would appear your already on it trying to find a fix.

    I will turn off the blending and projection, and I take it this should help for now?
     
  30. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    Hi again monkeyscience,

    Still working toward getting my Skyshop character mobile-ready, I just changed a material from using the standard Bumped Diffuse IBL to the Mobile versions. When I did they turned pink.

    Clicking on the "Shader/Mobile/Marmoset Bumped Diffuse IBL" I see the error:

    redefinition of '_MainTex_ST'

    with "d3d11 90" next to it.

    Mobile/Marmoset Bumped Specular IBL has the same error, but with a "d3d11 149" next to it, and Specular IBL Fast has a "d3d11 150" next to it.

    And the two mobile bumped specular shaders have an additional error:

    "implicit truncation of vector type"

    With MarmosetSurf.cginc:43 next to it.

    But it's the mobile version of the Bumped Diffuse IBL I desperately need at the moment.

    Any help would be greatly appreciated!

    UPDATE:

    As a test I just created a new project and imported an Asset Store character and applied a Skin Fast shader to one part and a mobile Bumped Diffuse shader to another - it all seems to work fine! So I'm wondering what I could have done to break the mobile Bumped Diffuse shader in my main project.

    One thing I did that I haven't mentioned is I copied the existing Skin Fast shader and made a version of it with anisotropic highlights, based on what I saw in the hair shader. I did this because the hair shader had alpha that was causing me sorting issues, and not needing alpha for this particular hair, I decided to make my own hair shader based on the skin. And it seemed to work OK... But could my copying these shaders have broken anything?
     
    Last edited: Aug 7, 2014
  31. thehosse

    thehosse

    Joined:
    Nov 29, 2013
    Posts:
    35
    Hey MonkeyScience

    I'm having some issues getting Skyshop running on PS4, the shaders seem to compile and the package runs, but I'm presented with the unity 'blue' screen, nothing seems to render.

    Has Skyshop been tested on PS4 yet?
     
  32. brzozowsky

    brzozowsky

    Joined:
    Sep 12, 2011
    Posts:
    39
    Please make a Triplanar Terrain shader for Skyshop
     
  33. Lordinarius

    Lordinarius

    Joined:
    Sep 3, 2012
    Posts:
    94
    Hi
    I am using your CubeProbe with skyshop mobile shaders for my new pject.
    But there is something wrong with "Speculer Sharpness"

    On Unity it is ok
    onPc.JPG

    But on mobile it is working in sharpest mod
    Screenshot_2014-08-07-19-50-50[1].png
     
  34. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Android does not support mipmapped gloss cubemap reflections, it's a hardware limitation :-(. Best thing you could do is blur the cubemaps after you capture them. Load them up in the Skyshop window and hit "GPU Blur".
     
  35. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I don't have access to a PS4 dev kit, but could you give me some details? Are there errors in the console? Are you sure Skyshop is causing the blue screen? The worst thing shaders can usually do is make stuff render pink. Feel free to email support@marmoset.co if you want to debug this privately.
     
  36. Lordinarius

    Lordinarius

    Joined:
    Sep 3, 2012
    Posts:
    94
    Wow thanks . I was looking the way of bluring, but didnt know where was it . Many many thanks :)
     
  37. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705


    Skyshop 1.09 Available now in the Asset Store!


    Change Log


    Features:
    • Greatly reduced run-time memory churn in SkyAnchor and SkyManager
    • SkyManager Auto-Apply can now ignore objects by user-specified layer
    • Added "Probe Only Static Objects" toggle to hide dynamic objects when capturing cubemaps
    • Cubemaps created with the "New" button are named after the Sky object they were created for
    • Added "Bumped Specular IBL Fast" shader with Diffuse(RGB)Spec(A) to the "Mobile/Self-Illumin/" category (iOS runs out of texture samplers otherwise)
    • SkyAnchor now caches renderer.materials lists (greatly reduces memory use)
    • Added "Dynamic Materials" option to SkyManager in case material caches need to update at run-time (important if materials are added, removed, or replaced in renderer.materials).
    • Added "Skip Time" feature to SkyManager API to set/fast-forward sky blending.
    • Beta shaders are no longer zipped up in the install (hurray!)
    Bug Fixes:
    • SkyManager now only searches for MeshRenderer objects (a more robust fix for white 2D Sprites)
    • Enabled MaterialPropertyBlock code again (helps material instancing and memory churn)
    • Fixed all iOS vertex interpolant and texture sampler errors (affects mobile vertex color, vertex occlusion, and self-illumin shaders)
    • Fixed all iOS mobile terrain and vegetation shader warnings (GLES does not support vertex-only fallback shaders)
    • Changed "Action" to explicit "System.Action" everywhere
    • Removed remaining "MARMO_SPECULAR_FILTER" from all skin shaders and fallbacks
    • Exposed Translucency slider in "Skin Fast IBL"
    • Fixed D3D11 forward transparent cutout
     
    AlteredPlanets likes this.
  38. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    By the way, the memory churn is all but gone from SkyAnchor and Manager, hurray!

    Apparently even just asking for the renderer.materials or sharedMaterials arrays incurs a huge memory allocation (thanks C#)! I was doing this in multiple places, every frame, for every object.

    I've resolved to fetch and store the materials array in each SkyAnchor on Start(). Important: This means any time the list of materials a renderer uses changes at run-time, the SkyAnchor needs to be notified. Material properties can be changed without issue but if you are adding, removing, or swapping out materials from these lists, the SkyAnchor needs to update its cache.

    You can do this by hand using this call:
    Code (csharp):
    1. SkyAnchor anchor = gameObject.GetComponent<mset.SkyAnchor>();
    2. anchor.UpdateMaterials();
    Or you can enable the "Dynamic Materials" checkbox in the SkyManager to have it periodically go through all non-static SkyAnchors and update them.
     
  39. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    So many spheres are you harvesting them? lol JK
     
  40. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Haha yes, that is my memory test scene.
     
  41. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
  42. ultraschall

    ultraschall

    Joined:
    Feb 14, 2013
    Posts:
    30
    Hello, i just upgraded my project to 1.09. However i still get the following errors when publishing to iOS.

    Warning: Shader 'Marmoset/Mobile/Transparent/Simple Glass/Bumped Specular Glow IBL' exceeds the number of texture image units, marking as unsupported.

    WARNING: Shader Unsupported: 'Marmoset/Mobile/Transparent/Simple Glass/Bumped Specular Glow IBL' - Pass 'FORWARD' shader state not supported

    Warning: Shader 'Marmoset/Mobile/Self-Illumin/Bumped Specular IBL' exceeds the number of texture image units, marking as unsupported.

    WARNING: Shader Unsupported: 'Marmoset/Mobile/Self-Illumin/Bumped Specular IBL' - Pass 'FORWARD' shader state not supported
     
  43. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yeah, the glow texture adds an extra texture lookup that only iOS mobile devices can't handle. I would say just don't use those shaders. Self-Illumin now has a "Bumped Specular Fast" version that pulls gloss from diffuse alpha. My only solution if I were to patch this would be to delete those shaders, not much of a fix :-/.
     
  44. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Run a deep profile on it and show me where the hit from SkyManager or SkyAnchor actually is.

    The SkyManager combs through renderers periodically, looking for new ones, that could cause a small spike (or a large one if you just spawned 100 new bullet objects or something).
     
  45. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Last edited: Aug 8, 2014
  46. MaxB

    MaxB

    Joined:
    Jun 13, 2013
    Posts:
    13
    Should we expect Marmoset to look similar on Android? The editor looks fine but when publishing to a Galaxy S5 using ETC2 compression I get results like the image attached. Everything has been converted to Mobile/BumpSpecIBL.
     

    Attached Files:

  47. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Those shaders are falling back to built-in Unity ones. Check the ADK console for errors.
     
  48. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Expand the function calls you see spiking and take another screen cap. Deep profile means it will profile functions called from within functions. You can see exactly which block of code in a nested pile of function calls is causing the hit.
     
  49. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Oh yea these two photos are deep profiled

    its
    in the late update function

    https://docs.google.com/file/d/0Bzk28gC9LZ_HamlUbm9zUDF0ZEE

    https://docs.google.com/file/d/0Bzk28gC9LZ_HNWF3Z2NpN3hjcjg

    if that not what you are looking for then , im not sure how expand the functions
     
    Last edited: Aug 8, 2014
  50. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
Thread Status:
Not open for further replies.