Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Shader Forge - A visual, node-based shader editor

Discussion in 'Works In Progress' started by Acegikmo, Jul 20, 2013.

Thread Status:
Not open for further replies.
  1. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    I was over in the polycount thread and saw somebody post this image:



    Would it be possible to use something like the trick used to get the moss to gradually apply to the rock texture in your demonstration video to get a crosshatching effect that affected the shadows? It's pretty much pixel perfect for the aesthetic I'm trying for.
     

    Attached Files:

  2. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Yes, but if you want to make the crosshatching affect the shadows, you'll need to affect the light attenuation node with a screen-space mapped texture in that way :)
     
  3. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    Ah, glad to know that before I start messing around with it. Thanks!
     
  4. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    I have found a program bug, I can't create a refraction shader as it appears grayed out when I try to connect it. I tried to re-create the example refraction shader EXACTLY, and I could not complete it due to the same problem.

     
  5. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Scary - I'm unable to reproduce this bug. Could you make a step by step repro case when making a shader from scratch?
     
  6. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    Closing Shader Forge and re-opening it seems to have fixed the issue. But it was caused by disconnecting, compiling and reconnecting a different node.
     
  7. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    I seem to have got another wierd encounter. refraction seems to work pretty well except when I go up close and turn, it gets all distorted

     
  8. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    That's due to screen coordinates currently being processed per-vertex rather than per-pixel!
    It's a planned fix, but in the meantime, use a more highpoly plane
     
  9. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Beta 0.16 will have a new set of lighting features!
    A separate custom lighting input and two new inputs for ambient diffuse and specular light, which can be used for IBL setups :)

    I had a Skype meeting with the creator of Marmoset Skyshop, and we're going to make a super tight integration as a post-release update!

     
  10. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,199
    This is all awesome, hopefully UnityTechnologies will make you a good offer....
     
  11. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    984
    Is 0.16 the public beta? ;)
     
  12. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Probably yes!
    I might need to have one more private one, as these added inputs are new, and might have some easy-to-fix but fatal bugs, which shouldn't be there in the first public release.

    We'll see :)
     
  13. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    I only wanted a custom lighting node but you went all out :D. Awesome work dude and this is what completes Shader Forge right there. I can see UnityTechnologies making you an offer on this due to the awesomeness and the tight integration
     
  14. Deleted User

    Deleted User

    Guest

    This is amazing, so when's the planned release date?
     
  15. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    You just made Unity become 100% better than Unreal..

    GG
     
  16. Ravart

    Ravart

    Joined:
    Mar 9, 2011
    Posts:
    42
    Hi, I tried your Shader Forge 1.5

    - I get a lot of errors, like "sf_meshes.fbx missing sub assets". The seem not to affect Shader Forge functionality, still the errors pop up like crazy.

    - Shortcuts like STR+D, STR+C, etc. doesn't work, only deleting nodes work.

    - Your Normal Map Output seems weird, since the lighting of the faces ist sometimes upsidedown. Do I miss a component? The model works fine with the Unity standard parallax shader, checked this possibility.

    - Unlike Strumpy Shader, it's not possible to slide your Slider Component, since changing the value results in lags. I tried to turn off the auto compile function, but the result is the same. More or less I'm forced to test the shader inside the scene view :(, otherwise I have to endure the lags.
    In one of my projects I encountered the same problem and solved it with "multi threading". If you allow, I look inside your wonderfull creation to reduce the lagging.

    - Miss a function to remove the connections. Guess its still in development :)

    - I get "Cleaning up leaked objects....." everytime I save. I tested it with a clean scene, guess Shader Forge miss a few "Hideflag.DontSave" somewhere :p

    "Don't share the code it creates to anyone apart from the alpha/beta testers ". Mhh would have loved to add some free shaders for the unity community :( .

    Cool thing, that you and creator of Marmoset Skyshop "might" work together!! *Thumbs UP*
     
  17. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    Yes, it is pretty easy with Shader Forge :)

    I made a web player as a test, see if I did it right!

    https://dl.dropboxusercontent.com/u/10361080/DrawShader/DrawShader.html

    $pic.jpg

    It is not with the best set of textures, but the shader works heheheh...

    I have only one question.. Is it possible to create a shader that reacts on Unity shadow? For example, if I want that the shadow that this model creates to be the same way as the surface, can I do that?


    .
     

    Attached Files:

    Last edited: Dec 20, 2013
  18. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    The Shortcuts arent ctrl+D.. they are Ctrl+Shift+D.. for example.. at least here it works!

    About the lag, I am having the same problem here, also when I change the properties name it also take a while.
     
    Last edited: Dec 20, 2013
  19. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    0.15, I presume, 1.5 isn't out yet ;)
    Haven't seen that error before, I'll have to look into that.

    It works on OSX, but it's broken in Windows. I haven't tried what RenOli suggested though, try it and see if it works!

    Did you mark the Texture2D node as a normal map, and did you mark the texture asset as a normal map?

    This is due to updating all the nodes. I'll make them only update on release later

    Hold your cursor over a connector and press delete

    Possibly yes!

    This is because Shader Forge isn't out yet, you're using a test version for testing only. It's still in beta and will soon hit the asset store :)
     
  20. Ravart

    Ravart

    Joined:
    Mar 9, 2011
    Posts:
    42
    Similar to "sf_meshes.fbx missing sub assets", pops up like crazy (+999 Errors), seems not to affect Shader Forge (After some time unity is crashing due to this error :( ).
    Error: typeTree.m_Children.front ().m_Type != SerializeTraits<SInt32>::GetTypeString (NULL)
    I tried Shader Forge 1.4, no sign of error messages. Guess its not a bug, but a new feature I'm not aware of^^


    The example scene in 1.5 miss all spheres, which exist in 1.4. Not sure if thats an error or purpose.

    Models that exist out of manyy Submeshes aren't shown properly in you preview(only the first submesh group is shown). Since its difficult to model something without submeshes, I request support and equally for all submeshes!
    Since many submeshes comes often with many materials, it would be a cool feature in the future to controll and pick shaders similar to layers, say you can swap between the shaders(materials) of your model to adjust the skin after you created a metal look for the armor.

    Yes, and it works, just not always as expected(You could say one half works, the other side is mirrored).
    If you wish to try it yourself, download one of the DOTA2 Hero models (like Queen of Pain) from Valve's workshop


    Cheers and good hunting!

    @RenOli: Do you have a network screenshot to share? I'm interested how you blend the texture with the ramp :)
     
    Last edited: Dec 20, 2013
  21. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    Sure, I dont know if it is the best way, but it worked hehee

    here it is.

    $ShaderNodes.jpg
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,999
    SCHWEEET!!! I am definitely getting my hands on this when it becomes official... I hope to be able to create a True SSS shader with this... :)
     
  23. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    hi Acegikmo,

    just curious - how would I go about turning off the shadow casting from a material? I have a situation where I'm adding a rim material to a model that I'm bumping out the normals a bit, but I noticed that my second layer of material is casting a shadow (even though it's additive). In the past I was told that by leaving the fallback blank would do just that and it worked. That doesn't appear to be the case in SF. Is there some other way?

    thanks!
     
  24. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    btw, I also get this error three times now -

    NullReferenceException: Object reference not set to an instance of an object
    ShaderForge.SF_Node.RefreshValue (Int32 ia, Int32 ib)
    ShaderForge.SF_Node_Arithmetic.RefreshValue ()
    ShaderForge.SF_NodePreview.OnEnable ()

    they're all pointing to the SF_NodePreview script.
     
  25. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    You'll have to disable the shadows per-object in that case! I should probably add a checkbox to skip those passes altogether, so you don't need to disable it per-object.

    I think that error you showed should have been fixed for 0.16, which is releasing soon!
     
  26. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    awesome! yeah. the per-object method is not ideal and would not work in my case. I would have to have two objects at once which is much less convenient.

    Good to hear about the fix. btw - do you know if one of the upcoming releases will include depth bias?
     
  27. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    It will most likely be after the public beta pre-purchase release, or possibly during. It's one of the more prioritized nodes left to implement :)
     
  28. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    AceGikmo: Is there a way to have a slider affect only the local object rather than every object with the material?
     
  29. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    You'll need to use per-mesh data for that, materials are always, well, per-material :)
    You could paint meshes with vertex colors if you want to have per-mesh data, and read the red channel as your "slider"
     
  30. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    pretty sure that's the case for any material within unity. I believe you an instance them dynamically though. If that's true, then you should be able to modify the values locally.
     
  31. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    Yeh Unity seems to make it per object in-game, I was quite surprised when this happened but I'm really happy that it does :)
     
  32. sandboxgod

    sandboxgod

    Joined:
    Sep 27, 2013
    Posts:
    366
    Wow this tool looks pretty amazing! You got enough testers? Still on track to hit the store in a few weeks?
     
  33. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    It makes an instance of the material if you modify renderer.material with a script. Altering the material in the project browser or through renderer.sharedMaterial will not instance it, and will alter all of them

    There are plenty of testers, and the signups have sadly closed! It should be releasing very soon though :)
     
  34. sandboxgod

    sandboxgod

    Joined:
    Sep 27, 2013
    Posts:
    366
    Bummer! Well get this thing uploaded to the store so everyone can start using it :)
     
  35. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    I've been a really crap tester due to my jobs current heavy milestones, but I'll buy it anyway :p

    Regarding marmoset - very good. Awesome! Thumbs up! BUT...

    Performance is always a worry, and a deep-rooted concern. Yes I develop on consoles, and the occasional handheld, but I need speed. I can't get enough speed. Mobile tricks are still relevant if your shader covers a lot of the screen (marmoset shaders tend to cover a lot of the screen) so any performance you and the marmoset guys can wring out is only incredibly beneficial :)

    My main anxiety is that you'll make something really great but most people doing real work, won't use it due to speed (strumpy springs to mind - entirely unusable for production). I'm sure you've got plans to make sure shaders are fast or have the capability of being optimised with the right nodes post release, I'm just reminding how relevant it is for some users :)
     
  36. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Currently there are some critical bugs that need to be sorted out before releasing it, as the first release is quite important due to the importance of making a good impression from the start!
     
  37. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Another thing I remembered: Skyshop is apparently going to support crossfading between cube maps / box projection and this is going to be a bit expensive no doubt!
     
  38. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Performance is a tricky thing, because it's not straightforward to make it smart to organize that goes into frag and what goes into vert. You have some control over this, but not much.

    For a start, I'll prioritize high-end shaders for two reasons:
    1. It's easier than looking at optimization options, saving me time.
    2. It looks nice, which helps me market it, as I don't have a marketing department or anything even close to it ;) Plus, one of the goals I set out for Shader Forge was to push the visual quality to new heights in Unity, as it's one of the primary concerns, especially for artists, when it comes to Unity (As opposed to other game engines)

    I would love to make a more controlled vert/frag environment though, which I'll most likely look at as a post-release update! (Depending on how hotly requested it will be)

    As for Skyshop - I've discussed it with the guy who made it, and we've planned to first implement basic support, and then go into the more advanced ones after an initial release, including box projection :)
     
  39. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Acegikmo, is it also possible to somehow control fresnel inputs with this shader editor? For specularity...
     
  40. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Control in what way? The PBL fresnel term or the fresnel effect in general?
     
    Last edited: Dec 23, 2013
  41. sandboxgod

    sandboxgod

    Joined:
    Sep 27, 2013
    Posts:
    366
    Thanks Acegikmo! Good luck I'll be watching this thread with interest :)
     
  42. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    I'm really loving the fact that top tier assets are getting cross-integration. We're seeing a lot more playmaker integration (not needed here) with other things like 2D toolkit or Post FX studio, and now marmoset + shader forge. It's far better than open source as money behind it really pushes things forward, plus it's financially supported by one end and the other. So if someone has marmo, they'll need SF, and vice versa.

    This is a good thing and if Unity listens closely, they can think about changing the Unity engine itself to better support SF and Marmoset. They've done it before (light probes/shadowgun) and it's a very good, viable next (this!) gen path.
     
  43. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Haha, I like the fact that you label my unreleased tool as a top-tier asset, thanks :D
    And yes, it is nice with cooperation!
     
  44. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    I'm in the beta and I can back hippocoder up, this tool is top tier and one of the most polished assets that will be in the store... also you respond to questions really fast and are helpful and have a good attitude :)
     
  45. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Thanks! It means a lot to hear that :)


    Also, I just found the issue that was causing some shaders to not load at all. (I tried waiting 1 hour and 5 minutes, and a shader was still loading).

    Turns out I've got a bug in the node preview refresh system causing them to unnecessarily over-refresh nodes too many times.

    And by too many times I don't mean, simply x more time per node. Not even exponentially more time per node, but *factorially* more time per node, which is *insane*. If you don't know what a factorial rate of increase is:

    Code (csharp):
    1. n   f(n)
    2. --------
    3. 0   1
    4. 1   1
    5. 2   2
    6. 3   6
    7. 4   24
    8. 5   120
    9. 6   720
    10. 7   5,040
    11. 8   40,320
    12. 9   362,880
    13. 10  3,628,800
    14. 11  39,916,800
    15. 12  479,001,600
     
  46. MarkBenitez

    MarkBenitez

    Joined:
    Oct 5, 2013
    Posts:
    44
    How many more weeks til release on asset store?
     
  47. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Around one or two I would guess :)
     
  48. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    yup. I would also like to add to the comment about this being a top tier product. Been making AAA games for the last 12 years and this is one of the best third party tools I've had the pleasure of working with. It fills a giant gaping hole that was missing in Unity.

    I hope you make a killing with this package!
     
  49. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Thank you so much stiltskin :D

    I would also like to say that the most critical bug - the infinite shader load time / extreme load times, plus several performance issues when using lots of nodes, has now been fixed in 0.16 \ o/

    This basically means that it's now full speed ahead to the official release ;)
     
  50. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    awesome! btw, I don't know if this was asked or not already (I feel like it may have been) - I noticed that when using shaderforge with the asset server, the data for the shader preview always causes a conflict saying that the server version is newer. Is there a fix coming for that as well? I can see that causing some trouble in bigger production situation.

    thanks!
     
Thread Status:
Not open for further replies.
unityunity