Search Unity

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
  2. MaxB

    MaxB

    Joined:
    Jun 13, 2013
    Posts:
    13
    It appears I'm getting a bunch of "Pass 'FORWARD' shader state not supported" for the mobile shaders.

    Do these mobile shaders only work on iOS?
     

    Attached Files:

  3. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Cool, these are very useful. It looks like your infrequent spikes are coming from SkyManager.SeekNewRenderers(), this is the call that goes looking for dynamic renderers without SkyAnchors attached to them. I wish I had a more hierarchical search for these but I'm having to rely on Unity's brute force FindGameObjectsOfType. Some sort of sectors... or sectrs of levels might be nice :).

    I'm noticing some other overhead in SkyBlender that could be avoided by caching things once a frame instead of once computed per renderer. The biggest perf hit you are seeing is from having 4700 dynamic objects moving around, being checked for blending and sky triggers every frame. If you can get that number down you'll improve your perf greatly.

    Make as many objects "static" as makes sense for your game. You could also mess around with a custom object layer that you tell the SkyManager to ignore when doing auto-apply stuff.
     
  4. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    what about disabled obects does skyshop processes those?

    also I have nowhere near as many as 4700 enabled dynamic objects in my scene
     
    Last edited: Aug 11, 2014
  5. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    About the memory leaks on iOS (those with the repeated creation of materials and assets), it seems to be fixed now!
    Thanks :)
     
  6. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    what about disabled obects does skyshop processes those?

    also I have nowhere near as many as 4700 enabled dynamic objects in my scene
     
    Last edited: Aug 11, 2014
  7. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    Just curious, are there plans to integrate Skyshop with the upcoming PBR shaders in Unity 5? Any other changes or plans for Skyshop + Unity 5?

    Also, I was watching a video about Unity 5. It seems in addition to the new PBR shaders, there are reflection probes as well. Where does skyshop fit in with all of the new stuff coming in unity?

    I'm assuming they let you play around with a beta or something - you're probably under an NDA, just curious if you could shed any light on the upcoming situation with unity 5 + skyshop.
     
  8. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Hey monkeyscience,

    OpenGLES error 0x0502 in /Users/alex/Desktop/WeRFootballiOS/Classes/Unity/GlesHelper.mm:528

    Load times seem to be decreased. We go from about 25 seconds to 13 seconds, so pretty much half.

    However, the console in xcode gets spammed (recursively) with:

    OpenGLES error 0x0502 in /Users/alex/Desktop/WeRFootballiOS/Classes/Unity/GlesHelper.mm:528

    Any ideas?
     
  9. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Inactive objects are ignored everywhere including in the SkyManager.FindObjectsOfType search.

    Looks like static objects still run SkyAnchor.LateUpdate and Apply and probably for complicated reasons. Seems like there's room for improvement here, I'll add it to my list.

    So then if SkyAnchor.LateUpdate is getting called 4153 times a frame, you've got 4153 objects with SkyAnchors somewhere in the level but most of them are probably static level geometry, skipped by the costly SkyManager.LateUpdate.
     
  10. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Hmmm, that file's not one of mine, it is something Unity generates for the XCode project. What's on line 528? A brief google search doesn't turn up much, except an old restart-and-pray solution posted a while back.
     
  11. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    That worked! How bizarre!
     
  12. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
  13. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Hi monkeyscience,

    Everything seems much better in terms of performance and memory. However, the Mamoset/Mobile/Bumped Specular IBL Fast, seems to triple the load time, from 6 secs up to roughly 18 secs. The Skin Fast shaders seem to work fine and load (along with everything else) in the 6 secs.

    Anything we can try to reduce this? Blending and box projection are disabled.
     
  14. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Great thanks for checking it out :)
     
  15. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    Ok so now my character which looks great in editor looks very dark on the IPad. It seems like he lost the specular and emissive properties (i'm using Self-Illuminating Specular Bumped Mobile shader). Any idea?
     
    Last edited: Aug 14, 2014
  16. sam.ibbitson

    sam.ibbitson

    Joined:
    Jun 4, 2011
    Posts:
    33
    Hey guys, we've been using Skyshop (and other Marmoset products) for almost a year now. I thought I'd share a quick screenshot of the shaders being used in our new game, Bushido.



    [high res link: here]

    Thanks goes out to the Marmoset team for putting together such an awesome tool.

    Cheers,
    Sam
     
    Fab4 likes this.
  17. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Sounds like the material is falling back to unity shaders. The Self-illumin Specular Bumped shader is not supported on iOS because the device does not support enough texture units.

    I'd recommend either using non-bumped shaders or switching to Self-illumin Bumped Specular Fast. Specular Fast combines the diffuse and specular textures into one map: diffuse RGB and gloss in A.

    I should probably axe that shader combination from the mobile list, nothing but trouble. Maybe I can replace it with glow in the diffuse alpha or something.
     
  18. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    This looks great! Do you have videos or a demo or anything? I want to see him spill IBL-rendered blood!
     
  19. Sikkey

    Sikkey

    Joined:
    Jul 30, 2014
    Posts:
    5
    How can I do? Make a default sky?

    the error log:
    MissingReferenceException: The object of type 'MeshRenderer' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.get_gameObject ()
    mset.SkyApplicator.RendererInside (UnityEngine.Renderer rend) (at Assets/Marmoset/Skyshop/Script/SkyApplicator.cs:113)
    mset.SkyManager.RegisterApplicator (mset.SkyApplicator app) (at Assets/Marmoset/Skyshop/Script/SkyManager.cs:270)
    mset.SkyApplicator.OnEnable () (at Assets/Marmoset/Skyshop/Script/SkyApplicator.cs:49)

    I use 'load scene additive' function. Every scene has a sky. I load scene by code:
    unload last scene_object(with sky) and then load new scene_object(with sky)
    So a get this error, please help
     
  20. sam.ibbitson

    sam.ibbitson

    Joined:
    Jun 4, 2011
    Posts:
    33
    We're working on it :) ! We'll be releasing some new in-game videos soon, but you can see an earlier version of the map (still using Skyshop shaders) in one of our video blogs:
    .
     
  21. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Looks really nice!!
     
  22. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I downloaded the latest skyshop and very much hoping to get better Iphone 4 performance.

    I tested the included demo scenes with Marmoset Mobile shaders and the result is a bit disappointing. 4-7 FPS. Really not useable at all.

    Can anyone give some tips as to how to get better FPS on Iphone 4 (IOS 6.1)?

    Cheers.
     
  23. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Could you give us some details of what your scene consists of? What Marmoset shaders are you using? If you have Unity Pro you could profile the scene, that would tell you exactly what's killing your frame rate.
     
  24. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    As an example, I took the ManagerDemo scene that is included in the package, changed all of the shaders to Marmoset/Mobile and then published the project. Here are some screen shots.

    IMG_0325.jpg
    IMG_0324.jpg

    The profiler is not really showing what the problem could be.

    ProfileSkyshopIphone4.jpg
     
    Last edited: Aug 17, 2014
  25. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    Heya Poolts, any chance you can test any of the other Bumped Mobile (non Specular) shaders, and see if those take 18 seconds to load? I'm noticing the exact same results using skyshop 1.7, specifically its the bumped shader that takes forever to load for me.
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey Monkeyscience, I have a question about the new probe captures tools... (Finally breaking it in) I am trying to create a skybox probes but the button to create a new skybox is not there... though the one with the specular is. Do you have any tips for getting that button to return. Thanks man. Screenshot 2014-08-17 13.30.29.png
     
  27. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    Very cool
     
  28. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455

    Hello,

    Any idea when you will improve "the static objects still run SkyAnchor.LateUpdate and Apply" ?
     
  29. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    Ok.. I'm not sure what happened. But now it seems that it just started working o_O. Does that even make sense? I didn't change to the Fast version.
     
  30. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Great job man!!!
     
  31. Sikkey

    Sikkey

    Joined:
    Jul 30, 2014
    Posts:
    5
    ios skymanager must check "dynamic materials" and uncheck the others. otherwise you'll get many shader compile error:
    ============================================================
    Shader error in 'Marmoset/Mobile/Specular IBL': '_MainTex_ST' : redefinition at MarmosetSurf.cginc(95)
    Shader error in 'Marmoset/Mobile/Specular IBL': 'worldN' : no such field in structure; 'constructor' : can't convert; 'assign' : cannot convert from 'structure' to 'vec3' at MarmosetSurf.cginc(102)
    Shader error in 'Marmoset/Mobile/Specular IBL': 'uv_MainTex' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec2' to 'structure' at MarmosetSurf.cginc(157)
    Shader error in 'Marmoset/Mobile/Specular IBL': 'worldN' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec3' to 'structure' at MarmosetSurf.cginc(158)
    Shader error in 'Marmoset/Mobile/Specular IBL': 'worldRefl' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec3' to 'structure' at MarmosetSurf.cginc(159)
    Shader error in 'Marmoset/Mobile/Specular IBL': 'worldPos' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec3' to 'structure' at MarmosetSurf.cginc(160)
    ============================================================
    Shader error in 'Marmoset/Mobile/Self-Illumin/Specular IBL': '_MainTex_ST' : redefinition at MarmosetSurf.cginc(100)
    Shader error in 'Marmoset/Mobile/Self-Illumin/Specular IBL': 'worldN' : no such field in structure; 'constructor' : can't convert; 'assign' : cannot convert from 'structure' to 'vec3' at MarmosetSurf.cginc(107)
    Shader error in 'Marmoset/Mobile/Self-Illumin/Specular IBL': 'uv_MainTex' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec2' to 'structure' at MarmosetSurf.cginc(162)
    Shader error in 'Marmoset/Mobile/Self-Illumin/Specular IBL': 'worldN' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec3' to 'structure' at MarmosetSurf.cginc(163)
    Shader error in 'Marmoset/Mobile/Self-Illumin/Specular IBL': 'worldRefl' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec3' to 'structure' at MarmosetSurf.cginc(164)
    Shader error in 'Marmoset/Mobile/Self-Illumin/Specular IBL': 'worldPos' : no such field in structure; '' : unsupported construction; 'assign' : cannot convert from 'vec3' to 'structure' at MarmosetSurf.cginc(165)
    ============================================================

    Our artist like to use Self-Illumin&Glow shader, that look great at iphone. Can you fix it?
     
  32. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Hi,
    I get the following errors when running our app on iPad Air:
    WARNING: no native support for texture format 5, converting to 4!
    WARNING: no native support for texture format 5, converting to 4!

    WARNING: Shader Unsupported: 'Marmoset/Mobile/Specular IBL' - Pass 'FORWARD' shader state not supported

    WARNING: Shader Unsupported: 'Marmoset/Mobile/Specular IBL' - Pass 'FORWARD' shader state not supported

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

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

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

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

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

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

    Works on older iPads (2,3,4) but with poor performance.
    We use the latest skyshop version.
     
    Last edited: Aug 21, 2014
  33. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Since your warnings are all in specular shaders, I'm guessing mip gloss and the shader_texture_lod extension are misbehaving.

    According to Apple the iPad Airs use the new A7 GPU and support OpenGL ES 3.0. You should open your project's "Player Settings" up in Unity and see if the problem goes away when you set the "Graphics Level" setting to "Force OpenGL ES 2.0". It could be that Unity's shader compiler is not configuring the 2.0 extension right when rendering in 3.0.

    Let me know how it goes, we may have to bug Aras about this.
     
    Last edited: Aug 21, 2014
  34. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    You typically don't want to probe your skybox from the scene with a custom cubemap. The skybox is only used to render the backdrop and you don't want your backdrop of the scene to contain an image of the scene. So omitted all the GUI for it.

    The Skyshop window has a button for a new Skybox cubemap if you need it.
     
    KRGraphics likes this.
  35. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Could you make sure you have a clean install of Skyshop 1.09 and if you are still getting these errors, please email info@marmoset.co with as much info as you can get me.

    I'm working on a version of the glow shaders that will work on iOS. A good work-around for now: use Self-Illumin shaders without Bump.

    Edit: or use Self-Illumin/Bumped Specular Fast with combined diffuse-specular maps
     
    Last edited: Aug 21, 2014
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Good to know.
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Actually, how can I control the mipmap chain in creating the spec cubemap? I saw this in the creating of the cubemap from panorama, but not for sampling the custom probe, unless I missed something.
     
  38. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    That worked, thanks!
     
  39. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    Ok i'm still getting weird results. I'll start from the beginning:
    1) Tried to use Mobile Self-Illuminating Bumped Specular. Looked dark on the scene with no illumination or gloss on an ipad.
    2) After compiling it through xcode it looked ok (should it? you said it's not supposed to work on ipad). For some reason it was dark on versions uploaded to test flight by the auto builder machine we have.
    3) Tried changing it to Mobile Self-Illuminating Specular (no normal map) and still dark.

    Any idea what might cause it or how to fix?
     
  40. Sikkey

    Sikkey

    Joined:
    Jul 30, 2014
    Posts:
    5

    I had clean and install again, so the bug fixed. Thank you!
    Note for everyone: You must delete all the files of marmoset before update.
     
  41. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Hello,

    Any idea when you will improve "the static objects still run SkyAnchor.LateUpdate and Apply" ?
     
  42. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455

    ANy idea when you will improve SkyAnchor.LateUpdate?
     
  43. Marcan888

    Marcan888

    Joined:
    Aug 29, 2014
    Posts:
    3
    Hey guys, it's my first time posting here ! I have a question wich is probably so simple for all of you. I work on a game right now and we're using Skyshop to light the level. But this thing is happening and I don't know what to do about it. All my skinned meshes are not lighten by the sky. It stays black. But the rest of the meshes that are not skinned are.

    I use marmoset bump specular ibl on the models. Is there something I need to check in the materials ? Thank you for helping me !

    Marcan
     

    Attached Files:

  44. StarHunter32

    StarHunter32

    Joined:
    Feb 10, 2013
    Posts:
    99
    Hello. May be I don't see it, but is there a material with possibility to apply a reflection glossiness map so we have different specular sharpness on the object?
     
  45. Sikkey

    Sikkey

    Joined:
    Jul 30, 2014
    Posts:
    5
    How about compress the cubemap?What's your solution?
    The cubemap use a lot of memory. Every cubemap nearly 10MB! I need use more cubemap on ios.
    So I test pvrtc this afternoon.
    1. rend cubemap by unity&marmoset
    2. split the six images of cubemap and export
    3. compress the images to pvrtc
    4. create empty cubemap, use pvrtc instead
    5. set the new sky&spec to sky settings
    It maybe look find in the editor. The cubemap reduce to 100KB from 10MB!
    My project became larger, so I just test for one scene in the editor.
    Does it will work on ios? Or Is there some bug? I had searched the internet, seems everyone said the cubemap only can be png, or unity use as png.
    May I use this optimization scheme in the whole project? How about your experience?
     
  46. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Hello Marcan,
    Do you see any console errors when this happens?
    Also, what platform are you developing for? If mobile, make sure to use Marmoset/Mobile shaders.
     
  47. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yes, the alpha channel of the specular map is the gloss term, darker alpha values = blurrier reflections. Blurry reflections are supported on all platforms except Android, unfortunately, GPU limitation. Gloss maps on Android do still affect direct light specular highlights though.
     
  48. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Compressing RGBM cubemaps is tough, you need a format that preserves the alpha channel but also compresses the RGB and A components consistently. A lot of DXT compression methods compress alpha differently (and often at a much lower quality) which introduces a lot of banding when you decompress and multiply decompressed RGB by decompressed A. Not sure what PVRTC does with alpha, if anything.

    Best way to shrink cubemap size is to cut the resolution in half. That 10mb cubemap turns into a 2mb cubemap if you just halve the resolution of each face. You'll get blurrier specular reflections but at run-time, on a complex, normal-mapped surface you'll barely notice it.

    You do want to keep your skyboxes high res though, they fill a large portion of your screen and might be worth the large file size.
     
  49. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    They said Unity 5 would introduce Cubemap Compression, we all need that for our cubemaps, and im pretty sure when they announced unity 5 would have reflection cubes, they ran into the same problem. 10 cubes alone makes your file size much bigger.
     
  50. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Hi monkeyscience,
    is it possible that the Mobile/Specular IBL und Mobile/Bumped Specular IBL shaders in 1.7+ are less performant than in pre 1.7 Versions (especially on older devices like the iPhone 4)?
     
Thread Status:
Not open for further replies.