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. cl-apps

    cl-apps

    Joined:
    Mar 16, 2013
    Posts:
    128
    To answer the above questions:

    Unity 4.2
    Single Lightmap
    Forward Rendering
    No console errors
    No other errors to speak of. The shader works fine on my MB Pro...

    I'm guessing something else is going on here. I haven't tried turning off the light mapping yet. I do remember seeing this behaviour before, which I believe was something to do with a particular loading script I was using...

    I'll report back if I figure it out! Just weird my game working perfectly on one Mac and not the other.

    Oh, and I just realised I didn't mention the shader I was using - IBL Bumped Specular. Everything else in the scene is using IBL Diffuse.
     
    Last edited: Aug 28, 2013
  2. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    So a short update for you guys, The Unite conference has distracted me from Skyshop 104 work a bit. 104 is still in feature freeze as I hammer out the last of the bugs in the terrain and vegetation shaders.

    But while in Vancouver, I've been showing off some future tech for Skyshop 105.
    I present to you:
    Box-Projected Cube Mapping

    WebPlayer Demo - http://db.tt/j5G0nd7x



    I have a rough version implemented, though lots of work remains on usability and presentation. The projection is done in sky object space instead of world space so you are no longer limited to axis-aligned boxy rooms, but boxy rooms of any orientation!

    I've also played around with the same projection in non-boxy scenes, for instance outdoors. The results are not perfect, I would need depth data in the cubemap for that, but it works quite well as long as the reflections are obscured by dirty spec maps or blurred sufficiently.

    Standard cubemap, no projection:


    Box projection:


    With a busy normalmap:
     
  3. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I have yet to try it on an Ouya but have been talking with a few devs who have kits and are interested in helping me with Ouya support and performance.
     
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is pretty :) and perfect timing too... I am experimenting with indoor levels, especially with lightmapping... and I can't wait to see you guys present. Speaking of busy normal maps... i have a water shader that I made with Strumpy with animated normals, would it be possible if one of you guys were to port to skyshop :)?
     
  5. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    How different is performance from the box projected to the regular? Hoping it all runs good on mobile.
     
  6. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Mobile performance remains to be seen. Box projection does increase shader complexity. There are some not-so-nice instructions in the math but no extra texture samples or anything too devastating. I've been looking at doing sky rotation and projection in the vertex shader which would greatly help mobile performance but anything normalmapped is still going to take a fragment shader hit, no way around it.

    Per-vertex projection does have some visual artifacts I am not a fan of, but with some blurry reflections its not so bad. The projected reflection vector doesn't interpolate very well and you'll need tessellated geometry for decent results.

    Meanwhile, here is a demo of box projection with our new vertex lit shaders using Unity's 10x10 quad ground plane: http://db.tt/wfM97j9J
     
  7. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Dead Monkeysciense,

    Maybe have you find any solution to bake cubemap HDR from unity scene and not only LDR?

    I think HDR are most detailed ... You?
     
    Last edited: Aug 31, 2013
  8. toby29

    toby29

    Joined:
    Sep 8, 2012
    Posts:
    15
    Hi Monkey Science, I bought skyshop yesterday and currently in the process of changing all our materials over in unity for our game to the marmoset ones and I was wondering after reading through this thread does skyshop support physically based texturing? I'm a little confused as quite a few other people who have posted on here seem to be making the textures without AO, should this be the case when using Skyshop? is this supplied on assets in engine?
    if anyone could give me any advice it would be greatly appreciated :)
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey there...when I do my texturing with Skyshop, i do go by the physically based rendering rules, which makes your models blend a bit more realistically. Here are some tips that I found useful (at least in my workflow)

    1. Diffuse textures DO NOT have lighting information WHATSOEVER! Keep this all flat color. And also no values of black should go below 2% (it's actually 4% but with HDR and global illumination, it brightens up my textures too much.

    2. Specular maps also are flat. No detail.

    3. Gloss maps are the maps where you put all of your nooks and crannies. Every detail you have goes into this map. Ambient Occlusion is optional. For reflective surfaces, you may have to do a bit of editing of the AO map and paint it with 96% white.

    4. In Skyshop, you can sample the sun spot in the panorama, but keep the intensity under 2. i found that higher values wash everything out, especially with, Beast. I hope this helps a little.
     
    Last edited: Aug 30, 2013
  10. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I should make a clarification here. There are two textured controls for specularity, the specular mask (RGB) which colors or masks the specular highlight, and the specular gloss (Alpha), which controls the size and shape of the specular highlight. Gloss is akin to Unity's shininess slider. Neptune is right in that the specular mask should mostly be a solid color, though it can still contain dirt and grime. Specular occlusion, if used, should also go in the specular mask channel.

    However differences in materials contained within the same texture sheet (leather parts, metal parts, plastic) should ideally go in the gloss map as most materials vary greatly in their surface "roughness" but not as much in straight-up specular intensity. One of the distinguishing features of physically based rendering is that specular reflection energy is conserved; if the specular highlight is bigger, the overall appearance of it is dimmer as the same energy of light scatters in a wider cone. On real-life materials, the apparent intensity of specular reflections are mostly controlled by this side-effect of gloss.
     
  11. LarryGary

    LarryGary

    Joined:
    May 25, 2013
    Posts:
    20
    Sorry, but I have to jump in say that this isn't entirely correct.

    1. Diffuse textures should not contain any directional lighting information. Diffuse textures should contain AO though, if we get AO in as a separate texture input at some point this will not be the case.

    2. Specular maps should not necessarily be completely flat. Its good to have a bit of AO in your spec map, otherwise you get strange reflections which would be occluded in real life (as Andres mentions, if you have a proper reflection occlusion map that would be even better than AO for spec content, but ao works in a pinch). Toolbag 2 has screen space reflections, and in that case you can drop the AO from the spec and it works a lot better.

    Specular maps are really just a base reflectivity map, any areas of your material that would be more reflective, say scratches on a painted surface that reveal the bare metal underneath would be a bright value in the spec map. Many of the values you have in your gloss map should also be represented in your spec.

    3. The gloss map is just that, a map of the roughness or glossiness of the surface. As such, it should contain content that describes the surface for each material, again if you have a painted metal surface with scratches that reveal the bare metal, the gloss content would be brighter in the scratches.

    There really aren't any rules to what content goes into the spec or gloss maps, other than basic logic of "How reflective is this surface?" which determines the specular content, and "How rough/smooth is this surface?" which determines the gloss content. Usually your spec and gloss content will both have plenty of variation, as materials to not tend to be splotless in real life. Dirt, rust, oxidization, dust, scratches, etc are examples of material variation that would give you content other than flat colors in your spec/gloss (and diffuse really).

    Now as far as PBR goes, there is a good thread over at polycount on PBR: http://www.polycount.com/forum/showthread.php?t=124683

    I wrote a few posts there about PBR in Toolbag 1 and 2 which will probably be of interest as well:
    http://www.polycount.com/forum/showthread.php?t=124683
    and
    http://www.polycount.com/forum/showpost.php?p=1904497&postcount=184
     
    Last edited: Aug 30, 2013
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Thanks for clearing that up, Larry. PBR is still a tough topic to work with., I saw a video about how PBR is usee game Remember Me. Lately, I tend to keep insane details out of my diffuse map, and put everything in,the spec map
     
    Last edited: Aug 30, 2013
  13. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yeah it is, the jury is still out on a standard pipeline for PBR art. Its an exciting time to be writing shader tools though :).
     
  14. LarryGary

    LarryGary

    Joined:
    May 25, 2013
    Posts:
    20
    No problem, and yeah especially with reflective materials, most of the work should be done in the specular and gloss maps, with very little detail in the diffuse.
     
  15. LarryGary

    LarryGary

    Joined:
    May 25, 2013
    Posts:
    20


    I've been working on some terrain content to show off the upcoming terrain shader that will be included in the next update of Skyshop. I figured I would give a sneak peak here of what it looks like, plus a rundown of how I created the content.

    First off I used World Machine to build the terrain base (heightmap) and this sweet macro to generate your color overlay: http://www.polycount.com/forum/showthread.php?t=111551. World Machine is awesome and I think you can generate lower res (limited to 1024?) textures even with the free version. You can alternatively sculpt your terrain in unity, or sculpt in a 3d sculpting app as well but I find WM to give the fastest and best results, though the learning curve can be a little steep.

    Here is my terrain in WM with the base color generated:


    Initially I had trouble getting the bcore color script to work when I tried hooking up my nodes in world machine, so instead I used the sample file included with bcore and simply plugged my already generated height map into it. This generates a lot faster too, esp at 4K .

    I managed to get the Bcore color macro to export a nice base for a splat map, but it wasn't perfect so I ended up doing a lot of extra work on the splat map in photoshop as well. Painting splat maps in unity is kind of painful to do by hand.

    Here is what my WM file to generate the splat map looks like:


    And here are the bcore macros set up to spit out a splat map of sorts (I was just sort of winging it at this point, but it works well for a base). Its important to make a copy of the bcore macro and plug it into the splat alpha (as the macro is only meant to write into RGB), and then enter the appropriate colors to pull the final layer into the alpha



    You could also use the "select color range" function in photoshop to make a base splat out of your color overlay map as well. I did this a bit in combination with the map I exported from the bcore script, while updating the splat in Unity as I made changes.

    Final Splat map:


    Now the textures, in addition to the standard splat map for layer blending and height/displacement map for terrain topology, the Skyshop terrain shader supports:
    • Global color variation map
    • Global normal map
    • Global ambient occlusion map
    • Per-layer diffuse, normal and specular maps for 4 layers
    • 4 additional layers (but without normal and specular maps)

    Plus a bunch of extra fancy shader parameters (like diffuse and specular fresnel), both global and per layer that I'm sure you guys will find handy.





    For the individual tiling textures I tried to make them desaturated and bright, so I can add a lot of the color with the color variation overlay map. I think this worked really well, and its a lot easier to hide tiling artifacts this way.
     
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is pretty awesome... kinda sucks that I am using Vue for my mapping :(. This would have been awesome...
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    And then I get something like this after a few hours of work. Gotta admit... this was fun for me :). And don't mind the arms on the models. Neither of them are using a skin shader. $FullbodyHDRtest.png $Skyshop Lighting.png
     
    Last edited: Aug 30, 2013
  18. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Loving all the terrain shaders and techniques you guys are working on. Great job so far... I use world machine as well never did see that macro thanks for that. One thing though when you upload the latest skyshop to the asset store for us to try out PLZ PLZ put a world machine source file for us to look at. To many times developers leave those out thinking people don't want to see or use them but we do. I'm sure plenty of people using skyshop will definitely agree. Thanks again for SkyShop getting better and better!!
     
  19. SorryFromWhatIAm

    SorryFromWhatIAm

    Joined:
    May 16, 2013
    Posts:
    11
    Hi Monkeyscience
    I'm Using MaramosetToolbag And MaramosetSkyshop ! Both are Amazing !!!

    I'm Character Artist and Game Render Artist ... :)
    I Rendered This image Fully with Skyshop And Output was perfect but I've a request from you ...
    can you wirte A SubSurface Skin like MaramosetToolbag or better for skyshop ?


    Character Vertex : 7642 Vertex
    Textures Size : 2K

    $Unity.jpg

    Thank U for this Amazing Tool !
    Keep it up ! \m/
     
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    THIS IS BEAUTIFUL!!!! Looks like skin too, even without the shader... eyes are too white though.
     
  21. inafield

    inafield

    Joined:
    Feb 26, 2013
    Posts:
    281
    Substance Designer... and Bitmap2Material... I think I saw it mentioned in here somewhere... works with marmoset shaders? Btw, thanks for putting up that demo with a moving object!!!
     
  22. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Try to bump my question ...
     
  23. SorryFromWhatIAm

    SorryFromWhatIAm

    Joined:
    May 16, 2013
    Posts:
    11
    Thank u Neptune Imaging

    Yeah , this is so Pretty but MaramosetToolbag has a Better skin shader , this image rendered with maramosettoolbag :

    $screenshot1.jpg

    and After Composite :

    $AAAqdwq.jpg


    If this shader was in unity3D ... !!!
     
  24. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Your eyes are still too white... lower the white in the eyes a bit. Also the skin pores are too pronounced... with a skin shader, those bumps should be very subtle. The skin is too hard.
     
    Last edited: Aug 31, 2013
  25. RideTheT

    RideTheT

    Joined:
    Jun 11, 2012
    Posts:
    23
    Hi Monkeyscience and Larry, just wondering if you guys were involved with this? (NSFW) http://vimeo.com/73422331
    Looks incredible!
     
  26. SorryFromWhatIAm

    SorryFromWhatIAm

    Joined:
    May 16, 2013
    Posts:
    11
    Wow ! Amazing !!!
     
    Last edited: Aug 31, 2013
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Wow...that is really pushing the boundaries of realism...

    EDIT: Actually, Lee Perry Smith made these models... he is well known for his realistic modelling and scans.
     
    Last edited: Aug 31, 2013
  28. LarryGary

    LarryGary

    Joined:
    May 25, 2013
    Posts:
    20
    Releasing world machine source files shouldn't be an issue, I'm not sure we would package it with the official Skyshop content (unless there is a big demand for that), but it would be simple enough to upload a zip and share the link here. Are you interested in how I created the terrain content itself (ie: the WM file used to generate the heightmap and normal map) or are you more interested in the color overlay and splat map generation stuff, or both?

    I can share the terrain content source files no problem.

    The splat map stuff is sort of hacked together and required a lot of extra tweaking in photoshop to get it to work, also it uses the Bcore macro, so I'm not sure about the legal/ethical issues of redistributing it, though it is freely available here: http://www.polycount.com/forum/showthread.php?t=111551 and I will be happy to answer any questions you have about it. You will also likely need to tweak it based on your terrain content.
     
  29. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Dear MonkeyScience,

    I see that Mobile Shaders are #PRAGMA 3.0.

    Mobile shader are not supported by #PRAGMA 2.0?
     
  30. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yeah, Lee Perry Smith is an avid Toolbag user and we've been working with him on Toolbag 2 skin shader tech. He is doing some awesome work :).
     
  31. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yeah, the base requirements are shader-model 3 right now. If you can change something and get SM2 compiling please let me know! I'd like to have as much low-end support as possible.
     
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is seriously awesome... and I hope the skin shader will be just as simple to use as it is in Marmoset Toolbag... I recently saw an image of PBR for Toolbag 2, and it really blew me away. I have gotten some pretty close results in Skyshop (took a little finessing). Is there a way to bake out a cubemap in Linear mode? When I create a cubemap for processing, I check the Linear box, but when it is done, that check box is empty. Here is a recent capture of my model with the cubemap set to linear. It jacked up my spec maps a bit, but it looked better and worked better with HDR and GI

     
    Last edited: Sep 4, 2013
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey guys, I don't know if anyone here is using cubemaps in linear mode, but if you set the cubemap to linear with the checkbox selected, the mipmapping that allows blurry reflections is nullified completely. It forces the cubemap to render like a mirror reflection. Just a heads up if anyone decides to use Linear cubemaps.
     
  34. digitaltoon

    digitaltoon

    Joined:
    Mar 22, 2011
    Posts:
    12
    Very Impressive work. Is it possible to see a breakdown of the shaders that were used on the car? I am trying to do something similiar and it would be a great help.
     
  35. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I just want some clarification. Do your shaders support opengl es2? Kinda confused cause id like to try it on tegra 2 and 3 phones and tablets.
     
  36. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Yes, GLES 2.0 is supported. iOS runs on OpenGL ES 2.0 which is a different "2.0" from "Shader Model 2.0". Shader Models are a Direct3D term and don't really coincide with a specific GLES or OpenGL versions. Confusing, I know >_<.

    Check this thread out for more info: http://forum.unity3d.com/threads/86949-Which-IOS-s-can-run-pragma-shader-3-0
     
  37. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    What you are seeing is Unity auto-generating mipmaps when a property of the cubemap asset is changed through the inspector, over-writing Skyshop's custom gloss mips and ruining everything. To fix this, right-click on the cubemap asset and "reimport" it. The custom mips are saved to disk as sub-assets and this will reload them.

    But also, you shouldn't mess with the Linear checkbox in the cubemap asset. If they are HDR cubemaps (RGBM encoded) they should remain not-linear textures, as the sRGB sampling of them is part of the encoding.

    Similarly you shouldn't change the cubemap resolution through the inspector as it will a) overwrite your mipmaps and b) not down-sample the texture properly; you'll get banding in the RGBM data.
     
  38. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Late reply, sorry. Yep! Substance and B2M both generate texture content that works great with Marmoset shaders. Hook their outputs up to the appropriate Marmoset texture slots as you would with any other shader.
     
  39. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I started work on this the other day with replacement shaders. It is going fairly well but probably won't make it into Skyshop 1.04. It will also have trouble with transparency and custom, non-Marmoset shaders :(.
     
  40. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    I'm gonna defer to Horp1 for this one, but I think he is using bumped specular IBL with a slightly modified shader to add an AO texture channel.
     
  41. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Hi MonkeyScience,

    I hope in your support :)

    I need to create a hyper realistic parquet for my mobile application.

    What I need is to have a lightmapped plane with fresnel and sharpen specular on the surface.
    Obvously when I bake lightmap, all the lightdir information are losted so specular is not realistic like real time light information.
    How can I fix this?
    I want just to bake lightmap and preserve light information (lightDir) just for specular (not for color). I try DirectionLightmap but specular result is very poor because specular cover all the surface without any kind of fresnel effect. It seems that RNM is not read by shader because the result is the same that single lightmap bake.
    (I try to use Specular Unity Basic Shader and works better).

    Thanks
     
  42. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Then I see that you control Specular together SkyReflection. Is not possible have separated specular and reflective controls?
     
  43. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Ok, I see that specular may be controlled by light intensity :)
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Good to know...
     
  45. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Directional lightmaps are getting fixed in 1.04, there is a direct lighting callback specifically for dealing with RNM data that I omitted. Someone asked about it a couple of weeks ago and I pasted some code that would fix the shaders, for 1.03:

    http://forum.unity3d.com/threads/18...ols-RELEASED?p=1330650&viewfull=1#post1330650
     
  46. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    The reflection and specular values and textures are consciously tied together because, physically speaking, specularity is reflection :).
     
  47. monkeyscience

    monkeyscience

    Joined:
    Dec 13, 2011
    Posts:
    705
    Behold! I have added ambient occlusion with a secondary UV channel and it will ship with the up-coming Skyshop 1.04 update.



    Could not resist illustrating it with our shiny, brushed-metal Unity trophy, just begging to be rendered with IBL. Ask me about my technical achievements bro!

    >>Live Demo
     
    Last edited: Sep 13, 2013
  48. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Awesome stuff! Looking great!
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is a beauty! And right on time too... I just finished baking out an AO map this afternoon for a character model... I am looking forward to playing with it. Is AO going to be an input texture? So I don't have to add AO to my textures any more... and have you been able to solve capturing with an HDR?
     
    Last edited: Sep 7, 2013
  50. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Dear monkeySciense,

    Thanks for the fix :)

    Now RNM info is read. But I have a little problem. As you can see in the attached screenshot, with DirLM I have inversed specular direction.
    In RealTime I have Specular from North (linked to sun rotation), instead with Directional Lightmap my Specular comes from South ...

    It seems that Specular is influnced from ViewDir differently on DirLM ...

    Any solution?
    Thanks

    $skyshop_rtSpec.jpg

    $skyshop_dirLmSpec.jpg
     
    Last edited: Sep 7, 2013
Thread Status:
Not open for further replies.