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. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Hello Recon03, sorry to hear about your trouble. Looks like your email fell through the cracks of the internet before reaching support@marmoset.co. Could you PM or email me the details again?

    General advice for seeing black trees or objects is:
    1. Make sure there's a sky and sky manager in the scene, these scripts are required to get lighting data to all shaders.
    2. Make sure all your tree assets are using Marmoset/Nature/ shaders, there is no simple way to globally replace the shaders tree assets use.
    3. Make sure there are no shader or script errors printed to the Unity console (and tell us if anything is).

    Please also let us know what version of Skyshop and Unity you are using, what OS you are running Unity on, and what your target platform is.
     
  2. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    This is not a bug. The specular sharpness values Marmoset shaders use have a weird range of 2-8, they are used to pick a mipmap level from the specular cubemap. Unity used to hide the type-in value all together and it didn't matter but changing the range now would break everyone's existing materials :(.
     
  3. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    This is a Unity 5.0.0 downloading skyshop for Unity 4 issue. See this earlier post.
     
  4. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Skyshop works with any skyboxes that are cubemaps. AllSky looks to provide images for individual faces of cubemaps, I'm not sure if they ship prefabs or Unity cubemap assets along with them. You may have to build your own cubemaps from the faces before processing them with Skyshop. http://docs.unity3d.com/Manual/class-Cubemap.html
     
  5. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    This was a bug pointed out in an earlier post. Skyshop 1.12 shaders function and render in non-legacy Deferred shading, but because of how the surface shaders are configured, they draw in a separate pass using Forward rendering tech (along with blended materials and a few other things). Functional, not optimal :).
     
  6. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Thanks for posting this, it gave me a nice head start. Though I should say, I did have to change a few things and add some lightmapping and GI #define blocks that Unity's built-in lighting.cginc uses.

    One function needed:
    #ifdef UNITY_LIGHT_FUNCTION_APPLY_INDIRECT

    And another had a big if/else block of:
    #if defined(DIRLIGHTMAP_SEPARATE)

    The whole file is a wall of code I'm not going to paste here but I'll be releasing a 1.12.1 hotfix soon. Stay tuned!
     
  7. stevesan

    stevesan

    Joined:
    Aug 14, 2011
    Posts:
    65

    Sounds good. If at all possible..I hope the hotfix is isolated...we've hacked up marmoset cginc's quite a bit for our project (Subnautica), so upgrading is a pain :( Not your fault tho.
     
  8. stk_uriziel

    stk_uriziel

    Joined:
    Apr 17, 2015
    Posts:
    6
    Is the problem in post # 2303, associated with the devices with PowerVR SGX gpu has been resolved?
    Last I tested the game from a friend who used SkyShop 1.7 and Unity 4.6.4 and the game does not load on my tablet Lenovo uses sgx 544, stopped at the splashscreen.

    Please let me know if the new versions of SkyShop fix these problems, because I'm going to buy a license to my own game.
     
  9. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    The hot fix will only modify the MarmosetDirect.cginc file. If stuff's working for you, by all means ignore it :). Skyshop 1.12.0 will run and render in Deferred mode, just using Forward rendering.

    Yeah, Skyshop 1.7 is now 5 versions out of date and lots of improvements have been made in terms of mobile support, including fallbacks for the shader_texture_lod extension.
     
  10. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I took another look at the call order and as I think you're right, game objects that are turned to static at run-time will still end up in the dynamic SkyManager list. I'm not sure when I'll get around to reworking this system to be more robust though.

    As a work-around you could call the following on every renderer you've set static:
    Code (csharp):
    1. skyManager.UnregisterRenderer(Renderer rend);
    2. skyManager.RegisterNewRenderer(Renderer rend);
    SkyAnchor will change it's internal isStatic bool with OnEnable(), which you could also call yourself or retrigger.

    With regards to performance, blending doesn't cause much of a hit. What you're after is disabling the Auto-Update feature. You'll find a checkbox for it in the SkyManager inspector. This is the overarching bool around the SkyManager update loop that will disable sky triggers and local skies from being applied. Auto-Update causes material instances to fragment (bad for batching) and has CPU overhead that periodically searches your entire scene for new dynamic objects.
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Hi,

    I have a Skyshop version that had no SkyManager (i think, i am 99% sure it only had a Sky module and worked)

    I get pink material no matter what i try with the new version and unity 5 shaders

    Could it be that i will need to add the SkyManager and will my version convert ok when using the manager ?

    Also is it possible to grab the IBL from the changing procedural Unity 5 skybox ?

    Thanks
     
    Last edited: Apr 17, 2015
  12. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    You probably have Skyshop version 1.06 or earlier, it is not supported in Unity 5. Sorry :(. Please update to version 1.12. It should go fairly easily, you'll need to add a SkyManager object to your scene, and can safely turn off Auto-Update for a nice performance boost, Skyshop 1.06 scenes wouldn't need it.

    As for Unity's procedural skyboxes, unfortunately no. Skyshop uses it's own skybox cubemaps and needs to precompute it's own IBL terms from it. Runtime IBL computation is not supported.
     
  13. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705


    Yes hot-damn!
    Version 1.12.1 is out.

    Fixes include:
    - Unity 5.0.0 support (no more downloading the Unity 4 build by mistake)
    - Missing Deferred rendering functions added (Shaders no longer fall back to Forward mode)
    - Missing GI/Lightmapping functions added (may fix some lightmapping errors people were seeing)
    - ShaderForgeExtension_Unity4.zip and ShaderForgeExtension_Unity5.zip are both included and renamed for clarity (Unzip one, not both!)
    - Removed ShaderForgeExtension_106.zip, it was causing confusion (ask support@marmoset.co if you need it).
    - Added _Version.txt file

    Note: Unity 4 folks won't get much from this patch, just a renamed Shader Forge zip and updated change log. Feel free to skip it :).
     
    wetcircuit likes this.
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    I did update to the latest version and inserted the Unity 5 stuff a few weeks back and got purple everywhere, so i suppose i have to add the manager in every scene with sky.

    Will the manager automatically make the pre-manager materials i already have applied work ?

    Also will it work with the sky i had defined pre-manager right away, or i should delete and insert a new sky ? Considering the sky scipt would be the updated one.

    Thanks
     
  15. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    359
    Hi,

    I used Skyshop in Unity 4.x version of my game, but when Unity 5 came with native shaders, PBS and reflection maps, I stopped. Unity 5 had the same features I used through Skyshop, so I didn't need it anymore. It seems like the new Unity 5 shaders, reflection probes etc. are basically "Unity saw and copied Skyshop" (same way as they seem to do with NGUI).

    Now, when Skyshop is Unity 5 compatible, can you please explain what do I gain over the native Unity 5 stuff, if I start using it again?
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I would be surprised if there isn't any advantage, as Skyshop has been out longer and ought to be better prepared to handle all kinds of edge cases.

    One person above pointed out that Skyshop does have a skin shader right now (well, a beta one), while Unity 5 does not.
     
  17. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    For me personally I am able to customize skyshop to give me Box Projection on OpenGL ES2, giving even high end devices, more performance in es2 mode vs unity5 which only allows ES3 and desktop box projection. And with vertex coloring so i can use a very low draw call count as you can see from the image below. The metal, wood, tiles, marble and Flat Black surfaces are all using Box Projection. Additionally i am using a very low lightmap resolution of 4 but with skyshop im able to blend in the IBL with the lightmaps.
    box_projection_opengl_es2.jpg
    These changes are all in the game if anyone wants to test it out, You can change graphics settings in the "Customize" menu, https://play.google.com/store/apps/details?id=net.RealDefinition.ZombieOpsOnlineFree

    FYI all of the materials were each combined into single objects in 3D Max, (example: fridge doors, oven doors, drawer handles, all combined to be 1 metal object, to save on draw calls, since skyshop forces a new material instance, since theres no planned solution for a shared material for a local sky, like a specialized skyanchor that just changes a sharedmaterial rather than an GameObject's material)

    Also monkey, i did have Auto-update off. these are local skys inside each house, i turn them off until you are close to the house, and that seems to reduce the SkyshopAnchor lateupdates to just 8 at a time (i remove lateupdate anyway though),
    however, there are many objects and on every late-update to do all these calculations to determine if it should blend and how to blend, even though auto-update is off. There should be a bool to turn off "Blending Calculations" before they even begin. a bool is very cheap compared to all of the method calls, and on every single object in the scene that uses box projection or sky anchoring.

    SkyManager.lateupdate is another problem you forcing it to update every single lateupdate. There should be an event called to switch immediately and/or blend, and if necessary a co-routine to run the blending. We're all paying the price for blending every single frame, even if we dont use it.

    With lateupdate removed, those 2 dont even show up in the profiler, vs any percentage you see when you profile mobile devices.
     
    Last edited: Apr 18, 2015
    hopeful likes this.
  18. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Do we really need this with unity5 when unity5 is a PBR itself?
     
  19. mozi_ru

    mozi_ru

    Joined:
    Nov 2, 2012
    Posts:
    9
    Thank you.

    One more issue - the "SpeedTree Billboard" shader outputs red-orange color for any tree. Please see the screenshot attached. Tested on the Conifer speedtree from Unity Standard Assets.
     

    Attached Files:

  20. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Does Skyshop works with Alloy3 shaders? or it has its own shaders?
     
  21. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    sent
     
  22. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    you might as well ask "Do we really need a new Star Wars movie now that we are all grown up..." :rolleyes:
     
  23. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I asked the folks at Rust and they said Alloy3 shaders no longer supports Skyshop IBL data. They were already wrestling a combinatorial explosion of shader variants and Skyshop was not helping.
     
  24. jr83

    jr83

    Joined:
    Oct 15, 2013
    Posts:
    2
    It seems that the hair shader anisotropy does not work anymore :(
     
    2dchaos likes this.
  25. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Well this is embarrassing. That is a very specific shade of tree billboard in your screenshots, "Debug Red", and it should not have shipped. I've fixed it and released a patch last night:

    HOT FIX 1.12.2
    - No more red SpeedTree billboards
    - No more errors about broken skybox materials in Unity 5
     
    Dannyoakes likes this.
  26. Batigol

    Batigol

    Joined:
    Oct 17, 2012
    Posts:
    234
    The marmoset shader got problem on ipad
    Does anyone know how to fix?
    I use Marmoset/Mobile/Specula IBL
     

    Attached Files:

    • 01.jpg
      01.jpg
      File size:
      36.4 KB
      Views:
      840
  27. Redbeetle

    Redbeetle

    Joined:
    Dec 20, 2013
    Posts:
    7
    hello monkeyscience?

    where is my specular in marmoset leave?
     
    Last edited: Apr 27, 2015
  28. 2dchaos

    2dchaos

    Joined:
    Sep 11, 2013
    Posts:
    63
    Having trouble with this too.
     
  29. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    @monkeyscience
    Is there any way to convert skyshop-made skybox to be compatible with Unity 5 skybox material?
    because currently I am getting this:
    Screen Shot 2015-04-27 at 6.12.35 pm.png
     
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I can see where that might not be something you want. But it is kinda cool looking. :)
     
  31. Redbeetle

    Redbeetle

    Joined:
    Dec 20, 2013
    Posts:
    7
    Please make a Triplanar Terrain shader for Skyshop
     
    ina likes this.
  32. directx

    directx

    Joined:
    Dec 11, 2014
    Posts:
    47
    can i use this with android mobile games ?
     
  33. directx

    directx

    Joined:
    Dec 11, 2014
    Posts:
    47

    can u tell how get this look please help
    please upload tutorial for this
     
  34. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    Is it possible to have Marmoset change skymaps at runtime?

    Say, from a webcam input?
     
  35. Mant1k0re

    Mant1k0re

    Joined:
    Apr 14, 2015
    Posts:
    6
    Hey there, I was trying to follow your terrain tutorial from some time ago and no dice at all - I suppose the workflow has changed somewhat for Unity 5? First of all I can't find Import Splatmap - hello, I can't find Terrain menu either. I'm using Skyshop 1.11. Any chance someone could point me to a post defining an updated workflow? I've tried google but I haven't found anything.
     
  36. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Monkey I sent you a few PM's with no reply.... I have a water shader i'm using, its showing up black, if I use it outside of Skyshop it works fine any idea howto use my water shader in Skyshop because I believe its conflicting.
     
  37. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    This looks like a texture filtering problem. Make sure that your reflection cubemaps have trilinear texture filtering enabled on them and that no code or build optimization is disabling it. Unfortunately there's no way to check cubemap texture filtering settings in the Unity GUI, they are hidden parameters. This is likely caused by a render quality setting or custom code somewhere.

    This is an unsupported feature, sorry. I tried my best to get specular reflections on leaves to look good, failed every time. You inevitably end up with slower shaders and sparkly white noise. Billboarded leaf and normal map content is not well-suited for specular highlights.

    Looks like some tangent space changes to U5's shader system have broken the beta hair shaders. I'll do some digging.

    What you are seeing is an HDR, RGBM-encoded cubemap rendered without any decoding. To fix it, you can run the same skybox through Skyshop and convert it to an LDR image. Uncheck the HDR checkbox in your output cubemap field and compute again. LDR skyboxes should render properly as Unity 5 backgrounds.

    Yep! Remember to use Marmoset/Mobile/ shaders.

    No, sorry. Skyshop's IBL data requires preprocessing to happen in editor-mode. Currently, there is no way to feed it live data.

    Check the edit menu, "Edit->Terrain->Import Splatmaps". It should still be working...

    You water shader is probably not set up to use the Skyshop reflection cubemaps and thus reflects only direct light (and looks black when no lights are on). Does the shader have a texture slot for custom reflection cubemaps? Maybe you can attach the skyshop sky or specular cube to it by hand?
     
    2dchaos likes this.
  38. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Yes it does. I did get it working before this but it is fine in the Editor but not in play mode. its black . its for sure lightng issue with Skyshop and this water shader. I will try what you suggested I did re name it as you stated before.
     
  39. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    no go , same issue, perfect in editor mode... but play mode black.. I have the waves working.. perfectly, but black .


    Edit with directional light it works but the scene doesn't look good as it should, so how can we use custom shaders with Skyshop??
     
    Last edited: May 4, 2015
  40. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    @monkeyscience
    i might be wrong but seems editing cube maps with skyshop doesn't work (Unity 5):
    Shader error in 'Hidden/Marmoset/RGBM Convolve': Can't find include file ../MarmosetCore.cginc (on opengl)

    Compiling Vertex program with MARMO_SKY_BLEND_OFF MARMO_BOX_PROJECTION_ON MARMO_RGBM_OUTPUT_OFF MARMO_RGBM_INPUT_OFF

    Shader error in 'Hidden/Marmoset/RGBM Convolve': '' : Include callback failed at line 47 (on opengl)

    Compiling Vertex program with MARMO_SKY_BLEND_OFF MARMO_BOX_PROJECTION_ON MARMO_RGBM_OUTPUT_OFF MARMO_RGBM_INPUT_OFF

    I've had this when baking reflection probe and when tried to blur existing cube map
     
  41. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Hmmm, it seems to work for me. Your error means that the shader:
    Marmoset/Shader/Probe/Marmoset RGBM Convolve.shader

    is failing to find the header file:
    Marmoset/Shader/MarmosetCore.cginc.

    Have you moved any shader files or folders within Marmoset/Shader/ around? I would recommend reimporting at least the Marmoset/Shader directory to recreate the proper folder structure.
     
  42. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    In short: you'll need Shader Forge.

    Custom shaders need extra code added to them to perform Skyshop IBL lookups. The easiest way to do that is to author your shaders in Shader Forge. The ShaderForgeExtension.zip archive contains custom Skyshop nodes you can add to your Shader Forge graph that will add the right code in the right places.
     
  43. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    I have shader forge. I had a feeling of this,
     
  44. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    So can you not use directional lights in the scene with Skyshop??? I assume you can't since it seems to break Skyshop and looks like the lighting is handled differently. I have very limited experience with Skyshop still messing with it.
     
  45. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Skyshop looks terrible when I use directional lighting.. If I take out the directional light it looks great, still waiting for a reply, also can I please get a proper email, this has been delaying me for weeks waiting on slow replys from the site and emails I never get replies.. I need some support here this asset is killing me with my dead lines.. since the support is slow..
     
  46. ph0b0s

    ph0b0s

    Joined:
    Dec 18, 2013
    Posts:
    19
    Where can i download the 1.12.2 hotfix? I´m having an issue with objects suddenly losing the marmoset info and then recovering it (blinking). That seem to be something related to the broken skybox bug. I´m using unity 4.x, don´t know if I need some specific version on skyshop that is "stable" for Unity 4.
     
  47. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @monkeyscience I have a particular scenario setup that I was wondering if it was possible to accomplish with your plugin.

    I need to setup a scene with HDRI, but the HDR image/texture I use is incoming from a real-world camera setup that streams live images as textures into Unity. I was wondering is it possible to use your tool to automatically update the HDRI and lighting at runtime? Is it possible to do every frame, every few frames, or even every few seconds?
     
    Last edited: May 15, 2015
  48. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Is there a better way to contact someone for support for this asset does anyone know???
     
  49. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    You can update to the latest version through the Unity Asset Store. Or if you've purchased from us directly, log into your customer account at http://marmoset.co and re-download it. In either case you'll want to delete the Marmoset/ folder from your project entirely and import the package again.

    Note that when updating from the Asset Store, you'll want to be using Unity 4 to get the Unity 4 compatible version of Skyshop, or Unity 5 for the U5 version. The zip file for our direct customers contains both U4 and U5 packages.
     
    Last edited: May 15, 2015
  50. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I'm afraid there is no way to do that in Skyshop. The IBL processing is set up to change the cubemap assets on disk, in editor mode. I never got runtime cubemap updates working properly.
     
Thread Status:
Not open for further replies.