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

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    OK, awesome. :)

    I'm assuming that if I buy skyshop now, I'll get these updates when they are released?
     
  2. wsz

    wsz

    Joined:
    Oct 20, 2012
    Posts:
    19
    Hi @monkeyscience, i'm having a problem. Im trying to create a hair material, and the marmoset shader dont works like the default unity shader.
    Why this happen?
    $hairMarmoset.png

    $hairUnity.png
     
  3. endikaeguia

    endikaeguia

    Joined:
    Nov 4, 2013
    Posts:
    29
    Can you post the compiled Script?. I'm a 3d modeler and have no idea about scripting
     
  4. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    if i have 1 material, used for outdoor and indoor objects, then i apply a sky renderer to the indoor objects, say 1 for bedroom, 1 for living room...ect, am i then forcing there to be multiple materials, will they all use the same sky as i change them. ...ect, it seems like its unrealistic to assume i can do all of this with just 1 material and use only 1 draw call (or acouple of draw calls) if every room uses a different material.
     
  5. ryno_coder

    ryno_coder

    Joined:
    Nov 5, 2012
    Posts:
    21
    Hello,

    I was watching your Skyshop tutorial on Terrain and Vegetation shaders - http://vimeo.com/75666307. One thing I realized is that I wasn't able to see any details for the terrain material. Is this a Unity Pro feature? $screenshot.JPG

    Regards
     
  6. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    ETA is in the coming week or two. I am putting the finishing touches on free cubemap probes (!) and lots of testing remains.

    This next release :).

    You can use any cubemaps including the skies that come with Unity as inputs to Skyshop. If they are not RGBM-compressed HDR, you'll need to uncheck the "HDR" checkbox in the input panorama field. The output can still be HDR though you'll lack the pretty bright input pixels to take advantage of all that range.
     
  7. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Were there any errors? Did any of the shaders fail to compile? Did you delete the old build of skyshop from your project first? You may also be seeing materials that have lost their shader references. Select a material that shows up pink and see what shader is assigned to it, it may say the shader is missing, in which case relocate it from the list.

    Select all assets you want to reimport in the project tab, right-click, and select "reimport". You can selectively reimport materials, prefabs, and textures this way without touching the shaders. Only the shaders are what take a *really* long time to import.
     
  8. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Absolutely! All future updates to Skyshop 1.* are free once you buy it through the asset store.

    We might consider an upgrade fee if we ever do a big Skyshop 2.0 revamp but so far nothing like that has been planned.
     
  9. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Is the material inspector just collapsed/hidden? Click the little preview sphere and see if the material settings unroll. Terrain mats should work in free.
     
  10. jforder

    jforder

    Joined:
    Jun 30, 2012
    Posts:
    22
    Hi there,

    I'm having difficulty adding blending functionality to your shaders. I'm trying to blend just the diffused textures with a Range slider. I've tried a lot of different ways to get it working. Sometimes the shader builds fine but nothing works still. Really would appreciate your help trying to get this to work.

    The way I tried is using the lerp function in the MarmosetSurf.cginc file but it doesn't seem to work.

    Hope you can help!

    Thanks.
     
  11. cadviz

    cadviz

    Joined:
    Jan 17, 2012
    Posts:
    28
    Hi...
    I'm fond of 3D architectural vizualizasion; and wish to achieve my production [still images, videos, and Real-time Interactive Architecture Visualization ] using Unity...

    Since Marmoset Skyshop, is a rendering and lighting plugin for the Unity game engine... I guess this tool may push me forward and help to reach my aim; Especially the videos showing great reality... :

    And Since a huge thread [78 pages] with white background is a pain in the eyes; I couldn't raed all posts here looking for answers for my questions; instead... I did a quick tour...

    So for this moment I have 2 questions:
    First...
    Does a building in an exterior scene [a down town street containing buildings at it's both sides] would get light only from the "sky" created by marmoset Skyshop...? OR the whole environment may affect...!!?
    _In case the answer would be that the environment doesn't affect lighting [means this is not realism case]... a new question appears... [ How to treat this issue...? ]

    Second...
    Many people talked about something called [Box Projection]...
    _Does [Box Projection] has any effect on lighting...? OR; it is just to create cubemaps for reflection?
    _Where May I find a step by step tutorial; how to use [Box Projection]?

    Best Regards
     
    Last edited: Apr 14, 2014
  12. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    The skybox, is the one, im not sure what shader is in control of the skybox, when i check render settings it says its skyshops skybox, and when i uncheck "show skybox" and then check it again, its still a pink sky.
     
  13. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    The shader for the skybox can be found in the project view under Marmoset/Shader/Resources/Marmoset Skybox IBL.shader. Select that file and see if any shader errors show up in the Inspector tab. You can try reimporting just that one shader as well, right-click and "reimport".
     
  14. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    It looks like this is a depth testing bug. What version of Skyshop are you using?
     
  15. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705


    The building would get lit by whatever single panorama you chose to process by Skyshop. If you process just an image of a panoramic sky, the building would be lit by the sky. If you were to render a panorama of your entire scene into a cubemap, and then process that cubemap in Skyshop, you could get lighting and reflections from all of the surrounding buildings as well (from one vantage point).

    If you have multiple buildings, you could render a different panorama from the position of each building, process each panorama in Skyshop, and the buildings would appear to reflect each other.



    Box projection is a way to distort reflections as objects move throughout a space. Picture a cubemap rendered from inside a rectangular room. As an object gets closer to one of the walls in the room, the reflection of the wall on the object should get bigger. But the math used for standard cubemap reflection cannot do this, every texel in the cubemap is treated as infinitely far away. Box projection distorts the reflection vector based on object position, to mimic this effect.
     
  16. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    165
    Hello!

    First let me say I absolutely love Skyshop, and sing its praises every chance I get.

    I'm trying to construct a project and a scene within that project using a combination of assets that were previously set up with Skyshop in another project, and assets that were set up with standard Unity shaders and lighting. In the previous Skyshop project I found that rebuilding could be slow, and saw a tip to load just the shaders I needed. So this time around I was careful to do so, and bit by bit corrected all the hot-pink shaderless objects, one shader at a time.

    It seems like I've managed to load in all the necessary shaders, but there's one persistent problem: I can't seem to get cast shadows to work on objects with Skyshop shaders. They're pretty clearly working on standard shader objects - there are some cars with the standard shaders, and tree shadows casting on them just fine. But with the Skyshop shader objects, it's just not happening. Like the road below the cars: it had a standard shader and when I switched it to a Skyshop diffuse, the shadows disappear.

    This is after I brought in the prefab Castle sky, and used its light as the sole light in the scene - I usually do that and it usually works just find. For instance, I used that sky and light in the old Skyshop project, and it worked great.

    I guess an easy test would be to load in all the rest of the Skyshop shaders, but again, that's the thing I'm trying to avoid, in part because I suspect I won't be able to go back from it - in a previous project with Skyshop I found I couldn't remove unnecessary shaders once they were loaded without breaking all sorts of things.

    So bottom line: I just need cast shadows, and it seems odd they're not working. And I'm hoping to avoid solutions that take hours of processing if I can (like reloading assets seems like it might - Unity gave me a warning doing so could take hours).

    Any help would be greatly appreciated!
     
  17. chakapo

    chakapo

    Joined:
    Apr 15, 2014
    Posts:
    1
    Hello!
    $explanationAR01.jpg
    sorry my English..
    Thank you.
     
  18. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    If I understand how this stuff works, if the shader doesn't have specific shadow stuff then it will fallback to the fallback shader, and if that doesn't have it, fall back to that ones fallback shader, etc until it finds one that does. I think by not including all the shaders you're breaking the fallback chain. So, open whatever shader you're using, and look at the bottom to see what fallback shader it uses. Then either import that and repeat till you get to a standard unity shader, or change the fallback to be a standard unity shader (like stock diffuse).
     
  19. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    165
    That was it exactly! The Diffuse IBL shader had its mobile counterpart as a fallback.

    Never thought to look to a shader for a cast-shadow switch.

    Thanks a ton!
     
  20. jforder

    jforder

    Joined:
    Jun 30, 2012
    Posts:
    22
    Hey :)

    Just wanted to see if you had a chance to look into my early post?

    Thanks in advance!!
     
  21. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    Heya Monkey,
    I've made some great tools for coloring multiple entire house using mobile -> vertex color -> specular IBL shader, i'm using it as a sort of PBR type setup at the moment, so it really only acts as a painted wall material. for the main material im using (with Wood, and Marble as my other 2 main mats).

    I was hoping to take it further, Is it possible to make specular react based on Vertex Color's Alpha?


    1. A super fast Shader type, would be, no specular texture, just specular based on Vertex Color Alpha. This would be super fast.

    2. However, a more reasonable Shader type, would be, to continue with the existing specular shader with texture, and just manipulate it based on the Vertex Color Alpha.

    By default when people do Color.Red ..ect or skip the alpha, it will give an Alpha of 1.0f automatically, so I believe its reasonable to just "adjust" the existing Vertex Color specular shader as an additional multiplier based on the Alpha.


    This would allow for 1 material, 1 draw call, to be used for more than 1 specular valued set of objects.

    This 1 extra feature, would allow door frames, to use the same material as the paint on the wall, just by making the doorframes more specular. Even the outside of the house could use less specular than the inside walls.

    These are just examples, same idea, painted. but different level of specularity in these paints/bases and/or multiple coats of paints/bases.


    Specifically for the Mobile shaders. but i imagine if its just adding an extra multiplier, than the desktop vertex color shaders would benefit too.
     
    Last edited: Apr 17, 2014
  22. stevehei

    stevehei

    Joined:
    Apr 17, 2014
    Posts:
    2
    Are there any known issues with the vertex lit shaders and Windows Store Apps? I created a test app to test the relative performance of various shaders and I found several of the shaders just show up as black. Specifically these ones were not working:

    Vertex Lit/Diffuse IBL
    Vertex Lit/Specular IBL
    Beta/Spherical Harmonics/Vertex Lit Diffuse IBL
    Beta/Spherical Harmonics/Vertex Lit Specular IBL

    I didn't try any other vertex lit shaders yet. Everything works in the editor.

    GeForce GTX 580
    Unity 4.3.3
    SkyShop 106.1
    Running on latest Windows 8.1 update with 8.1 WSA (D3D11)
    No Unity lights in the scene (they appear non-black if there are Unity lights)
     
    Last edited: Apr 17, 2014
  23. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
  24. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yeah so loading a subset of the shaders used to work until I inadvertently broke it all.

    Shadows require the chain of shader fallbacks to to end up in at the basic Unity shaders (Diffuse, Specular, etc). For compilcated, render to cubemap reasons, standard Marmoset shaders fall back to Marmoset/Mobile shaders, which fall back to the built-in Unity ones.

    This means you need to have Mobile shaders in your project for any standard shaders to have shadows. You can still axe the terrain and vegetation shaders safely though.
     
  25. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Without taking a look at your source its hard to help, there's a lot that can go wrong. Here's what my layer shader section of MarmosetSurf is going to look like though. Hope it gives you some ideas.

    Code (csharp):
    1.  
    2. //DIFFUSE
    3.     #if defined(MARMO_DIFFUSE_DIRECT) || defined(MARMO_DIFFUSE_IBL)
    4.         //Layered diffuse
    5.         #if defined(MARMO_DIFFUSE_4_LAYER)
    6.             half4 diff;
    7.             diff  = layerWeight.r * tex2D( _MainTex,  uv_diff ) * baseColor;
    8.             diff += layerWeight.g * tex2D( _MainTex1, uv_diff1 ) * _Color1;
    9.             diff += layerWeight.b * tex2D( _MainTex2, uv_diff2 ) * _Color2;
    10.             diff += layerWeight.a * tex2D( _MainTex3, uv_diff3 ) * _Color3;
    11.         #elif defined(MARMO_DIFFUSE_2_LAYER)
    12.             half4 diff;
    13.             diff  = layerWeight.r * tex2D( _MainTex,  uv_diff ) * baseColor;
    14.             diff += layerWeight.g * tex2D( _MainTex1, uv_diff1 ) * _Color1;
    15.         #else
    16.             half4 diff = tex2D( _MainTex, uv_diff ) * baseColor;
    17.         #endif
    18.        
    19.         #ifdef MARMO_DIFFUSE_SPECULAR_COMBINED
    20.             diffspec = diff.aaaa;
    21.         #endif
    22.        
    23.         //NOTE: this was the old way of doing it to separate vertex and base color from combined diff-spec alpha
    24.         //diff *= baseColor;
    25.        
    26.         //camera exposure is built into OUT.Albedo
    27.         diff.rgb *= exposureIBL.w;
    28.         #ifdef MARMO_ALPHA
    29.             diff.rgb *= diff.a;
    30.         #endif
    31.         OUT.Albedo = diff.rgb;     
    32.         OUT.Alpha =  diff.a;
    33.     #else
    34.         #ifdef MARMO_DIFFUSE_DIRECT
    35.             OUT.Albedo = baseColor.rgb;
    36.         #else
    37.             // we don't want any lights if direct diffuse is turned off
    38.             OUT.Albedo = half3(0.0,0.0,0.0);
    39.         #endif
    40.         OUT.Alpha =  baseColor.a;
    41.         #ifdef MARMO_ALPHA
    42.             OUT.Albedo.rgb *= baseColor.a;
    43.         #endif
    44.     #endif
    45.  
     
  26. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    What shader profile is the app running? d3d11 should work but d3d11_9x is not supported. 9x is the windows mobile shader profile and as I recall does not support some needed extensions. If you wanted to try it anyway, comment it out of this line in all the shaders you're using:
    Code (csharp):
    1.  
    2. #pragma exclude_renderers opengl gles d3d11_9x flash
    3.  
     
  27. Instability

    Instability

    Joined:
    Apr 16, 2012
    Posts:
    288
    Hi,

    according to the Skyshop Changelog it looks like cubemaps can be generated ("Box Projected Cubemaps (beta)" since version 105).

    I was wondering what your experiences are with this feature. How exactly does it work? I imagine you would define a region, and the baked environment is made into an HDR file by skyshop automatically? Does it work smoothly, easily?

    Could you post some of your results or WIPs using skyshop's cubemapping? Are the stunning and clear results of this skyshop demo easily doable (given the detailed scene)?
     
  28. reset

    reset

    Joined:
    May 22, 2009
    Posts:
    393
    Forgive my ignorance, but does SkyShop use physically based shaders? Or just image shader?

    thanks
     
  29. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    From my testing, box projection did not appear to work correctly on opengl es2, but it may be that i didnt understand how it works.
     
  30. stevehei

    stevehei

    Joined:
    Apr 17, 2014
    Posts:
    2
    What is the best way to tell? I assume it is using feature level 11 (SM 5.0) since it is a GTX 580.
     
  31. andrewc

    andrewc

    Joined:
    Aug 20, 2008
    Posts:
    180
    The dimensional cubemaps/skys are really incredible. I was wondering if there is a way to have multiple dimensional skies per scene. I understand you are working on blending but in the meantime is there a hack to point objects at specific dimensional skies, maybe based on layers or something.

    If not is there anytime frame on when that sort of feature would be release, I'm trying to decide if I should count on this feature for an upcoming project so any help would be appreciated.

    Thanks
     
  32. Batigol

    Batigol

    Joined:
    Oct 17, 2012
    Posts:
    234
    We got big problem with marmoset simple glass shader.
    When we have another alpha texture behind an glass, we cannot see the alpha texture in some camera angle
    How could we fix it?
     

    Attached Files:

  33. wsz

    wsz

    Joined:
    Oct 20, 2012
    Posts:
    19
    Skyshop 1.06.2 Hot-Fix

    Thanks
     
  34. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yes, that video demonstrates everything Skyshop 107 is going to be capable of. You can capture cubemaps from within your scene (even in Unity Free), process them into skies, and set up local trigger volumes to bind them to nearby objects. Additionally, box projection is a shader feature that can be enabled to distort cubemap reflections based on where objects are in these trigger volumes.

    The process for setting up a level with local skies is very smooth. 107 is going to come with a big feature and UI update that will include tools to mark up your level with skies and box volumes. It will also come with tools to select, capture, and reprocess multiple skies at once, using a new GPU-based convolver so reprocessing is lightning fast.
     
  35. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Skyshop 1.06 and prior requires the use of beta/Box Projection shaders to see this effect. I also don't have a mobile equivalent of those beta shaders out, but the regular ones might still run on some GLES devices, most likely just iOS.
     
  36. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Honestly, I don't know. I'm guessing if it's on a PC it's not running _9x though.

    Another idea just occurred to me: it seems you are having problems with shaders that use spherical harmonics diffuse. Try Edit->Skyshop->Refresh Skies (or CTRL+SHIFT+R), this should force-recompute the spherical harmonics terms from the cubemaps.
     
  37. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Much of the shader math is physically accurate but you will not find metalness maps and fresnel works differently than what some would call PBR these days.
     
  38. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yep! Next version of Skyshop will have all of that stuff. It is due out probably within a week, I'm doing internal testing at the moment.
     
  39. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    This is kind of a fundamental problem of graphics: alpha blending sucks.

    You should try splitting your mesh up and make each window or wall a separate object. This will help Unity sort the geometry before rendering. Ideally you want the triangles furthest from the camera to render first so Unity sorts objects back to front.
     
  40. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    In next release 107 you will add roughness PBR shaders or continue to use your custom physical algorithm?
     
  41. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    That sounds like it makes Skyshop a lot simpler for doing indoor environments. Can you load these from prefabs? Like capture a cubemap in a room and then save the whole room w/ cubemap as a prefab that can be loaded at runtime?
     
  42. Batigol

    Batigol

    Joined:
    Oct 17, 2012
    Posts:
    234
    I found the built-in transparent shader doesn't got this bug
    Do you think you could fix it in marmoset shader?
     
  43. Noors

    Noors

    Joined:
    Jan 7, 2013
    Posts:
    1
    This has probably been already asked, so apologies in advance.
    On the Specular mip chain, the gloss drop between the mirror mip and the next mip is quiet huge.
    Still i need the mirror so i can't uncheck "Highest Mip is Reflection"
    Is there a way to control the glossiness over the chain ?
    Also, is it possible to start the chain with a 512 or more cubemap ?
    Thanks !
     
  44. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    This is exactly what I wanted to read, cheers!
     
  45. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Skyshop looks pretty awesome and thinking of getting it.
     
    Last edited: Apr 26, 2014
  46. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Oh! Another question, may be annoying, but while I can't reasonably expect tessellation versions of these shaders any time soon, they would be unbelievably useful for what i'm planning to do with my current lil competition entry game thing. I'll ask in the shaderforge thread too as I've read that integration is forthcoming, but would tessellation play nice with these shaders and with shaderforge supplying this feature by nature, would it be relatively easy to recreate the core shaders of this package - the box corrected diffuse and specular IBL shaders particularly - in shaderforge after the coming release with tessellation - my reason being, i'm going to be decimating the buggery out of a lot of very high detail meshes into very low detail meshes (very very low, they'll so they will fit into a webplayer that will download in less than a day (aha i joke, but yes, within reasonable time) but those who have directx11 and wish to use the dx11 version can enjoy slightly improved geometry as i'll be able to somewhat bevel the corners of geometry procedurally or even recreate some information using a very simple bump/displacement map or even gpu generated noise function

    Thanks for your time! And as I say, this might not be up to skyshop so i'll ask in the shaderforge thread too
     
  47. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Is it possible that, on the Mobile/Bump Specular IBL shader (or other mobile shaders) that the highlight and diffuse lighting is attenuated by the realtime shadow? Or that the attenuation be adjustable? I feel like it should be darker in the shadows on some scenes.

    Although I guess actually, the more appropriate way to do this is have more darkness in the areas of the HDR that the direct light source isn't casting from. It'd be cool if this was done automatically. Like a 'Make HDR brighter near Directional Light angle" checkbox.
     
  48. ryno_coder

    ryno_coder

    Joined:
    Nov 5, 2012
    Posts:
    21
    Hi LarryGary,

    I'm in the process of trying to get a terrain created in World Machine to use with SkyShop in Unity. I was wondering if you could help me troubleshoot what's going on. I followed your instuctions but am having trouble with the BCore macro - it doesn't build. Did you run into this problem? To be honest, all I'm trying to do is create a terrain that's compatible with SkyShop. Whatever I need to do, if there's any assistance you can provide to get me going in the right direction would be much appreciated. I know it's an old post but great job on the terrain!

    Thanks,

    RynoCoder
     
  49. LarryGary

    LarryGary

    Joined:
    May 25, 2013
    Posts:
    20
    Thanks!

    First things first, did you follow the instructions in the polycount thread linked? You need to find a bunch of image inputs manually before it will work. I remember it being tricky to get working but its been a while since I set it up so I don't remember exactly what I needed to do.

    If that doesn't help could you be more specific about what you mean when you say it doesn't build?

     
  50. ryno_coder

    ryno_coder

    Joined:
    Nov 5, 2012
    Posts:
    21
    I followed the instructions in the polycount thread. I noticed that other devices in the macro weren't building, I'm assuming that's the cause of the bottleneck. I guess I need to configure these devices as well? See below for screen shot. Maybe this macro is outdated and doesn't work with the current version of WM. If so, really the end goal is to get a terrain to work well with Skyshop. I wasn't able to find "the one" tutorial that would tell me what I need to do to my terrain in WM. I watched this tutorial - http://vimeo.com/75666307 - this was great but i was unsure of how to create a quality diffuse base texture until I watched this tutorial - https://www.youtube.com/watch?v=N6QZfJDqaig. I think I'm on my way... if I run into a dead end again, I might just contact Marmoset directly and handover my credit card to get one on one help :).

    $macro.jpg



     
Thread Status:
Not open for further replies.