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

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    That could work, depending on if it's fast :)
     
  2. HunterPT

    HunterPT

    Joined:
    Nov 11, 2011
    Posts:
    38
    While being able to render shadows in all light types in forward mode is nice, I somewhat doubt that it will result in a very good performance when compared to deferred rendering, and yes deferred rendering like everything does have it's trade offs, however IMO they are really small in comparison to the benefits.
     
    Last edited: Jun 12, 2013
  3. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    I tried Marmoset bumped specular IBL shader on android but i dont see any IBL or specular highlights on device. Does it really support android !. I am testing it on amazon kindle fire. Please assist me with this if it skyshop supports android.
     
  4. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Others have also reported problems with Android shaders not working. I finally got my android tablet over the weekend and am looking into it.
     
  5. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    I'm very interested in buying this but I really need it for mobile.

    Performance wise, is it suitable for actual mobile games or just presentations?

    Thanks,
     
  6. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Mobile performance is comparable to Unity's standard shaders right now. On a third generation iPad performance is not affected by scene complexity (the vertex shaders are identical to Unity's) but can be limited by fill-rate. This means performance improves by lowering the app resolution and minimizing overdraw and blending. These are typical performance constraints of iOS apps - lots of pixels to render on a Retina display. I have also heard good things about iOS phone performance from people on these forums, smaller screens but similarly beefy GPUs.

    Mobile performance will only be improving over time as I learn more about Unity's own mobile implementation. I am also patiently awaiting Unity 4.2 to fix a compiler bug that will make shader work straight forward and allow me to release the mobile shaders with full source.
     
  7. Mark Duffill

    Mark Duffill

    Joined:
    May 2, 2013
    Posts:
    21
    Hi,

    We are now testing on android devices (Nexus 10 Jelly Bean 4.2.2) and are having a few issues:

    The device doesn't support linear colour space so fallbacks to gamma. But as a result the skyboxes are rendered over bright as they are generated in linear space/HDR images. Does this mean we need to manually generate the cubemaps/skyboxes in gamma space?

    We used a normal none HDR image for one and the skybox appears fine.

    Also the normal shaders don't work with transparency, I'm guessing the mobile ones do. However we've modified the normal shaders to add some custom effects. What is the difference between the normal and mobile shaders so we can replicate this? (If possible you can private message me a single uncompiledmobile shader?)

    Kind Regards
     
  8. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Dayum. So the BG of that image is the panorama?


    Nice!


    Very cool!


    So glad to see more and more people interested in using this for game development. The lighting looks fantastic!
     
  9. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    Im testing it in im got some problems with the shadows.

    What it can be?

    $error.png

    the white pixels over the rock.

    Just in case, im not using camera effects.

    EDIT:

    Testing a bit more, i found that the problem is only present when i use the render type Forward, with Deferred Lighting the white points over the shadows disappear but i lose the antialias.

    So the problem is the antialias of the object with specular over shadows.
     
    Last edited: Jun 14, 2013
  10. Mark Duffill

    Mark Duffill

    Joined:
    May 2, 2013
    Posts:
    21
    Bit further investigation reveals that it is falling back to the fallback shaders in all cases, hence everything looks wrong.

    I'll try to have a look at what the nexus 10 doesn't like in the shaders.

    PS Notice the mobile shaders basically use the mobile include to turn off features.

    Ta
     
  11. Mark Duffill

    Mark Duffill

    Joined:
    May 2, 2013
    Posts:
    21
    Looks like the bug for texCUBElod doesn't work in android either.

    Is there a work around so that we can get "shininess" emulated on mobile. Currently everything is super reflective as its effectively ignored.
     
  12. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    The Sky object fails to auto-detect Android's lack of linear-space rendering so you will need to select each Sky, disable "Auto-Detect Color Space" and disable "Linear Space" manually. This will be fixed in the upcoming patch.

    The differences are:
    No MARMO_HQ - some normalizations and expensive calculations are bypassed on mobile.
    No MARMO_SKY_ROTATION - sky rotation involves per-fragment matrix multiplies and is basically a no-go on mobile, where fill-rate is so precious.
    No linear-space rendering - sRGB texture sampling is generally not available on mobile hardware, which is a shame.

    And lastly, for mipmapped gloss to work, the compiled shader results need to be text-edited by hand. You need to search and replace

    textureCubeLod
    with
    textureCubeLodEXT

    and

    #extension GL_ARB_shader_texture_lod : enable
    with
    #extension GL_EXT_shader_texture_lod : enable

    This is a Unity compiler bug I'm told is fixed in 4.2, no idea when that's due out though. Because of this, normal Marmoset shaders basically won't work on a mobile platform. They will compile to using ARB_shader_texture_lod, crash, burn, and default to Unity's Diffuse shaders.
     
  13. MatzeOGH

    MatzeOGH

    Joined:
    Mar 20, 2013
    Posts:
    10
    I cant get the Self Illumin shader to work
     
  14. Havoccdesign

    Havoccdesign

    Joined:
    Jun 15, 2013
    Posts:
    1
    Thanks! This post has been useful!

    The 1st option worked very well (haven't tested the 2nd one as I don't know where to put the line.) when it comes to using the basic skyshop shader, but when I try to fix it for the more complex shaders like the ones with opacity/transparancy and that stuff, that line of code isn't even in there. Are there any fixes that you know of for these shaders??

    (Or if monkeyscience maybe knows a fix/loophole, not having shadows from point-lights is really bothersome to me)

    Thanks again : )
     
  15. user150221

    user150221

    Joined:
    Nov 10, 2012
    Posts:
    25
    In addition to my previous questions (quoted at the bottom):

    Do you have any plans on supporting AO maps or bent normal maps? AO alone is good at providing information for specular occlusion; since light is not reaching these areas, there should be little to no specular. And of course can also be used to darken the albedo.

    Bent normals improve upon AO, and are often called Directional Occlusion (DO). It's the average direction of the unoccluded rays for any given point, whereas AO is just the percentage of occlusion. It's often computed in real-time, in screenspace (SSDO). But it could also be done offline, per-object. xNormal can generate bent normals.

    Maybe both of these things are generally too expensive, but could at least be used for showcasing objects with a "high-end" shader. Personally for me my target is high-end PCs, or "next gen" systems.

    You can find information here:

    - GPU Pro 3 (Excerpt)
    - Whitepaper (PDF): http://www.mpi-inf.mpg.de/~ritschel/Papers/ScreenSpaceBentCones.pdf
    - http://pages.cs.wisc.edu/~ltokheim/ambenv/

     
  16. LarryGary

    LarryGary

    Joined:
    May 25, 2013
    Posts:
    20
    jonwd7: I can't comment on your technical questions or features that will be added in the future, however, you can add AO to your diffuse and specular maps currently, as a simple multiply in Photoshop. The Vespa example asset has AO baked from Xnormal applied to both the diffuse and specular, which works quite well, provided you have a unique uv set of course.
     
    Last edited: Jun 16, 2013
  17. user150221

    user150221

    Joined:
    Nov 10, 2012
    Posts:
    25
    Of course. But I consider baking AO to diffuse to be one of the great "evils" of game design currently. For example you can't NOT sample the AO if the pixel in question is being directly illuminated. This leads to things looking dirty, since the AO never goes away under direct illumination.
     
  18. br0kenp0ly

    br0kenp0ly

    Joined:
    Jun 3, 2008
    Posts:
    481
    Extremely cool project indeed :) Been a Marmoset user for a while now, so seeing this amazing tech inside Unity is pure awesomeness!

    I made a small skateboard scene yesterday,which looks good on Windows, but has some weird artifacts when viewed on a mac:

    $skateproject.png

    $Screen Shot 2013-06-16 at 4.37.02 PM.jpg

    Any ideas why this is happening?

    Feel free to check out the webplayer too:

    http://rockandroald.net/skateboard.html



    Keep on rocking!

    Roald
     
  19. Mark Duffill

    Mark Duffill

    Joined:
    May 2, 2013
    Posts:
    21
    Thanks for the reply.

    I'll leave the sky rotation disabled then seeing as its expensive and try the work arounds later.

    I've also implemented a decal and refraction shaders using your IBL stuff and all it looks very nice! Although it's a shame grabpass is to expensive on mobiles at the moment.

    Thanks

     
  20. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Whoa, that is quite trippy. I'm guessing this is caused by one of the many post effects you've got going on, I'm seeing some depth biasing issues. Try disabling them one by one.
     
  21. Mark Duffill

    Mark Duffill

    Joined:
    May 2, 2013
    Posts:
    21
    Well that kinda works. Is there an easy way to find out why on a mobile device a shader is bombing and using the fallback?
     
  22. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  23. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi imtrobin, That is just sick! Love the transforming robot! just insane.

    Cheers, Roy
     
  24. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
  25. xadhoom

    xadhoom

    Joined:
    Sep 2, 2010
    Posts:
    91
    The model looks great on my system. How did you achieve having everything compiled into an exe file?
     
  26. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Thanks Roy.

    Is there a way to detect that? Bummer if I cannot detect this and it screws up like this on player's PC.

    I use Molebox to make single exe
     
  27. xadhoom

    xadhoom

    Joined:
    Sep 2, 2010
    Posts:
    91
    Thanks!

    Maybe you could query the SystemInfo.
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Very crazy looking model... I love the details. And when I set the resolution to Full HD, the viewer screws up. I have a GTX 670m
     
  29. xadhoom

    xadhoom

    Joined:
    Sep 2, 2010
    Posts:
    91
    I made another test of your demo and it works for all resolutions (up to 1680x1050) except for 1920x1080 (windowed or fullscreen). At this res I get the same artifacts like your second screenshot.
     
  30. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    412
  31. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    wow. you guys got good cards.
     
  32. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hi everybody,

    First of all I would like to say that Marmoset Skyshop is an awesome and powerful tool !

    From what I've read in the previous post I am also interested in an integration for interior lighting and reflection. Do you plan to integrate a Box Projected Cube Environment Mapping system or maybe I misunderstood the use of the system ?

    Do you have any idea when you will release a runtime access for all computing functionalities ?

    Thanks a lot for your answers and of course your fantastic tool !
     
  33. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    Is it compatible with Flash?
     
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    PURCHASED!! Let's Rock!!
     
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    This tool is definitely worth it... and I even like that it works extremely well with dDO... though I had to tweak my textures because the results were not similar to marmoset toolbag, but definitely a must buy.
     
    Last edited: Jun 21, 2013
  36. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I have not tested anything in Flash so the official stance is going to have to be: no flash support :-(.
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Hey monkeyscience, are there any settings to set up the light probes similar to your demo?
     
  38. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    So there are two ways of thinking about light probes:

    1. The most straight-forward way is to treat them as bounced light from direct light sources only, in which case you light probe your scene as you normally would; no sky lighting, just direct lights hitting and bouncing off of surfaces. Compositing light probe lighting with IBL in this case is very easy, just add them together (as Unity does by default).


    (right-click/view image to enlarge)

    The downside to this method is a scene with no direct lights will not be illuminating any bright red walls in your scene and hence no color bleeding or bounced light, even if the IBL sky is bright and sunny.

    2. The other method is to include your sky image in the light-probe baking itself, this is where Lightmapping Extended and Beast's advanced baking options come into play. If you press the "Use as GI" button on any cubemap slot in Skyshop, that image will be used as the ambient light in your light probe bake. This is how the "mopedProbed" scene is set up as well.

    Now, in theory you could turn off diffuse Skyshop lighting entirely and let light probes do 100% of the diffuse work (specular reflections still need to come from cubemaps). However Unity's light probes ignore normal-maps.



    This is why I prefer compositing the IBL and probed lighting 50/50. Set your Sky object's "Diffuse Intensity" to 0.5 and set Beast's IBL intensity to 0.5 as well. When rebaked and added together, the composite should look something like this:


    (right-click/view image to enlarge)

    Further Reading:
    These images are pulled from the advanced baking posts in the Skyshop WIP thread and will eventually make their way to a written tutorial. Check them out here:

    More on compositing light probes

    Simple vs. Light-Emitting IBL in Beast
     
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I will give this a try... Ive been having a blast all day with Skyshop...testing out a new probe that I made and the results are very satisfactory...I will also try out the 50/50 composite and see what I get out of the bake. Thanks again for the awesome tools... I will post a render shortly. And I am also trying to get point lights to cast shadows and I have not been successful. But I will wait on that :)

    EDIT: For some strange reason, I am not getting any result from the probes on my model... the probe lighting is only appearing on a part of the model... that is rather strange.
     
    Last edited: Jun 22, 2013
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
  41. RUBILYN

    RUBILYN

    Joined:
    Jun 22, 2013
    Posts:
    54

    Hi EVERYONE ! thanks for the Tips And Insights in Sky shop !





    This External baking for Oclusion Efect is amazing !

    Can please Someone Share With us The Proper Code for Achieve Ambient Oclusion / By External Baking Light Map As Posted in this Thread Before ?

    Its something Reaaly needed as Skyshop base Shaders lack Depth ...
    They all look too much Flat / Without Dirt or Ambient oclusion ...

    THANKS SO MUCH !

    KYO



    PS: BY THE WAY !


    Iv Been trying to Make SkyShop Based / Powered Custom Shaders .
    I referenced myself on the Available Documentation. And its Seams Quite easy ...
    ( DeskTop Only of course )

    And here is a Custom Merge of SkyShop SHader With Base Difuse , Specular Over Transparency
    This way we can Make Dirt and Oclusion Efects Over SkyShop Base shader.



    Here you got the Mixed EXTRA Shader Code For you To use it :

    http://unity3dlabs.blogspot.pt/2013/06/unity-3d-shaders-repository-marmoset.html


    Please, Use, Improve, And make your own And Share Variants Using Same technique in this Thread.


    PS: Would reaaly love to see Marmoset Funcionality in Strumphy Shader Editor ...
    Would make Building and sharing of custom shaders More easy!

    PS.PS: There is not even need to say or remind that you must OWN Marmoset for this Code to work : )
    .. as it Needs the MarmosetCore.cginc's For it to work .


    Knoledge is power ...

    SO PLEASE ! LETS DO A SKYSHOP USERS SHADERS LIBRARY !
    Share your CUSTOM Marmoset SHaders EXTRA Code Presets With us !


    More to come from me...
    As i Would reaaly love to have a Whole Gamut of Custom Shaders Available for everyone To Share and Do variances of it !



    ITS A COOL IDEA !
    WE ALL NEED A USERS MADE FULL LIBRARY WITH MORE CUSTOM MARMOSET SHADERS !!

    If you are around / And like the idea ! - Join in here : http://forum.unity3d.com/threads/187309-SHADER-SHARING-The-SKYSHOP-CUSTOM-SHADERS-Thread


    THANKS SO MUCH !!
    FOR THIS WOUNDER FULL PRODUCT !!


    It reaaly raises Unity to Levels never reached before !

    CHEERS !



    KYO
     
    Last edited: Jun 22, 2013
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Here is some fun with dDo and Marmoset Skyshop... I am definitely gonna enjoy this... texturing time... 2hrs

    $Diebitches.jpg $DesertEagleMarmoset.jpg
     
  43. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    +1 cant agree more:D

    @Neptune_Imaging Fantastic gun, really awesome.
     
  44. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    +1 for both! :)
     
  45. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    I am not sure I can share how I implemented Ambient Occlusion-variants of the Skyshop shaders here. But I guess, if you bought Skyshop, I should be able to share freely with you.

    I better ask the man himself:
    monkeyscience: I have created my own versions of your Diffuse, Specular, Specular/Bumped; but with an extra texture that uses UV2 for ambient occlusion. They also ignore the real time lighting (have added a #define for that, something that can easily be changed), this is to increase the performance. Since Specular/Bumped already had lots of textures my current implementation to add AO to that shader is to use the alpha channel of the main diffuse texture. (still using UV2 for that).

    Do you want these shaders from me? I would rather see you add them to your general library.
     
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Thanks man... that is the gun that belongs to my Blade model... the quality of the textures in dDo is amazing... now I still wish Skyshop worked with deferred rendering. I added the tag "fullforwardshadows" in the shader and point lights still don't cast shadows. :( Deferred Rendering support and Skin Shading are definitely my top needs right now.
     
  47. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    @Horp That would be sweet... all kinds of variants... and I think we could try and add Deferred variants of these shaders as well...

    @3DLABS Those shaders look AWESOME!!
     
  48. BradHerman

    BradHerman

    Joined:
    Jan 10, 2013
    Posts:
    21
    When I switch from Diffuse IBL to Mobile/Diffuse IBL Skyshop looses the rotation of the sky maps on my surfaces.
    In this case I don't need the skys to rotate on my mobile device, however I need to orient them correctly to start with (-90 on rZ)
    Is there a way to rotate the initial state in the SkyShop interface?
     
  49. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Marmoset is really wicked.

    Does anyone here know if this will work with MESH BAKER from the Asset Store?

    Thanks.
     
  50. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    re: disabling realtime lights -
    The benefit to having AO separate and not baked into your diffuse texture is you can occlude IBL but not direct lighting. If you disable real-time lights, there's little reason to have a separate map :-/. The equivalent would be baking your AO into diffuse and specular textures.

    btw, the core shaders already have #defines for disabling dynamic lighting: MARMO_SPECULAR_DIRECT and MARMO_DIFFUSE_DIRECT.

    re: second UV set -
    I'd rather not introduce a new UV set for the same reasons I conjoined diffuse/spec/normalmap tiling: I ran out of shader interpolants very fast, with the need for world reflections and world normals. The UV-set ought to be either Beast's lightmapping UVs or shared with d/s/n.

    I would really like to stick AO into one of the alpha channels of existing textures. How does Diffuse.alpha sound to people? That channel is currently only used by transparent shaders. Spec alpha is taken by gloss (very important IMO) and normalmaps are RGB-only in Unity, afaik.

    I've also entertained the idea of sampling and multiplying Beast light-probes and lightmaps with IBL instead of adding them to the result. This way you can bake AO with Beast and probes give your dynamic objects (somewhat) directional occlusion from static level geometry. Downside: it would break bounced lighting and color bleeding which still has to be added to IBL.

    What I would love is if Unity had some sort of dual-lightmap setup where one channel of one texture set contained occlusion, or better yet: a map of vectors pointing to the direction of least occlusion (not unlike bent normals) and an occlusion scalar to define a cone around that vector. Directional IBL occlusion! You know you want it.
     
Thread Status:
Not open for further replies.