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

Shader Forge - A visual, node-based shader editor

Discussion in 'Assets and Asset Store' started by Acegikmo, Jan 11, 2014.

  1. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    The second tutorial is now live!
    This time it's on vertex color blending and UV tiling:

     
  2. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Ace,

    Thanks for the new tutorial!

    Gary
     
  3. beelzeboss

    beelzeboss

    Joined:
    Feb 28, 2013
    Posts:
    22
    In one of the videos you did during the beta you had a shader where your object behaved like a point light. How did you approach this?
     
  4. richardvertigo

    richardvertigo

    Joined:
    Dec 19, 2012
    Posts:
    12
    Hi, The Depth blend node is really nice for my water shader!! As far is I understand is that the Depth blend node can be used for blending near edge/intersecting geometry. The Depth Scene is not really clear to me? Can you show how to set it up?
    The Depth Blend I did with a Lerp and 2 Value's connected in the Alpha Input. Thx
     
  5. MarkBenitez

    MarkBenitez

    Joined:
    Oct 5, 2013
    Posts:
    44
    Please add the feature to zoom in and out in the node view in the next update
     
  6. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    No probs! There are more to come :)

    That wasn't on a shader level, it was just a point light inside a sphere mesh :)

    It really depends on where/how you want to use it. It gives you the distance from the camera to the objects behind the object you're rendering
     
  7. gametr4x

    gametr4x

    Joined:
    Apr 22, 2009
    Posts:
    86
    I was wondering if there are any plans for educational licenses. I'm currently looking into Shader Forge to replace other visual shader tools currently being used for artist shader classes. It would be fantastic if this is possible.
     
  8. richardvertigo

    richardvertigo

    Joined:
    Dec 19, 2012
    Posts:
    12
    Well I want to use it for making the water less transparent as the ocean gets deeper. And maybe also change the color the deeper it gets.
     
  9. Deleted User

    Deleted User

    Guest

    Well I gather it should be possible :) Really appreciate it, this will save soooo much time.
     
  10. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Possibly!
    I'm not entirely sure how it would be set up, but we'll see! Feel free to mail me suggestions if you have any :)

    You'd use the Depth Blend node for that, not the Scene Depth node. Plug it into alpha, make sure your camera is rendering a depth texture, and you should be ready to go!
     
  11. JoeW97

    JoeW97

    Joined:
    Nov 3, 2013
    Posts:
    56
    Would it be possible to take one section of a texture and tile just that?
    For example, take the UV section U=0.75 to 1.0, V = 0.75 to 1.0.

    I can isolate that section OK using Remap, but of course if I try to multiply it, to tile it, then the other parts of the texture become visible again.

    Thanks
     
    Last edited: Jan 23, 2014
  12. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You should be able to use the Frac node for that
     
  13. richardvertigo

    richardvertigo

    Joined:
    Dec 19, 2012
    Posts:
    12
    You'd use the Depth Blend node for that, not the Scene Depth node. Plug it into alpha, make sure your camera is rendering a depth texture, and you should be ready to go![/QUOTE]

    Hmm That was easy.. Thx
     
  14. MarkBenitez

    MarkBenitez

    Joined:
    Oct 5, 2013
    Posts:
    44
    How can I create a mirror shader the acts exactly like a real mirror and does not require a camera to function? I have no idea on where to start for this but im hoping someone can guide me a little bit and tell me what i need

    ray tracing i think its called? how can i do that?
     
    Last edited: Jan 23, 2014
  15. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I don't think it's possible, every single game I know of either employs duplicated geometry or a second camera to do mirror reflections (the latter being problematic on a deferred renderer). A bit of raytracing is only viable in screenspace for a very limited approximation of reflections.
     
  16. Deleted User

    Deleted User

    Guest

    Sorry one last thing, are we sorted with deferred rendering yet?
     
  17. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Not yet, but I'll start implementing it pretty soon
     
  18. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Third tutorial is now up! This time it's how to do a Blinn-Phong custom lighting :)

     
  19. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    It's a real delight to follow this thread!! Unity should pick this one up ASAP.. this one is a true boost for unity regarding the game engine market competition.

    Either way, Awesome work so far!!

    Btw, is it possible to do something similar to what "bitmap2material" douse?
     
    Last edited: Jan 23, 2014
  20. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    It's possible, but it's not really what SF is about :)
    SF is for creating shaders, not really to generate 2D content. You should be able to use the stuff that "bitmap2material" outputs in Shader Forge!

    Also, quoting this in case people missed it from the previous page:

     
  21. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,084
    So I'm making a toon shader that doesn't suck and I've run into a bit of a problem. I'm using normal maps to help determine the transition between a "lit" texture and a "shadow" texture and everything works great. To an extent.



    Here's my node structure. It's a slightly modified version of the one presented in this thread.



    And the transition works pretty great. I'm just using a model I grabbed off the asset store for the time being, but it came with normal maps so it's a good example. As you can see, the transition calculates all fine, UNTIL:



    Until the light passes behind the model. At that point, a weird black mass crests over the model. It seems to be related to the view direction or something because it moves if I change the view position of the camera in the editor. What's going on here?

    EDIT: HA! I'm stupid! I didn't realise that the model was out of the range of the light around it. I'll have to figure out how to adjust the whole thing to compensate for that later.
     
    Last edited: Jan 24, 2014
  22. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    I am really happy with SF so far. This and VPaint were the products that are helping the most to boost the visual quality in our project.
    Ever since Unreal 3 went indie with UDK in 2009 artists all over the world possibly dreamt about equal material editor tools inside Unity. Strumpy and surface shaders just don't cut it when it comes to a combination of sophisticated looking visuals on a mesh. There's way too much magic code generated in the background to dig through to work efficiently as an artist. Just look at the fact that you cannot use worldPos, vertex color and fog in the same surface shader - a shader coder would be able to find the culprit. An artist usually gives up after a certain amount of time because he has to deliver assets.
    With SF these limitations are gone. Great job, Ace!
    Unity should really get in contact with you. Half a decade after UDK it's about time. ;)
     
    Last edited: Jan 24, 2014
  23. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You're missing a light attenuation node, so you're only getting the light color, not the falloff!
    Check out the custom lighting tutorial video above for some more in-depth info :)

    Thanks a lot Marco, I'm really glad you like it! :)
     
  24. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,084
    I actually don't want the falloff, is the crazy part. It'll make more sense in motion and when the shader is more than 20% complete, I imagine.
     
  25. hobstob

    hobstob

    Joined:
    Dec 18, 2013
    Posts:
    20
    Definitely buying this asset soon.
     
  26. beelzeboss

    beelzeboss

    Joined:
    Feb 28, 2013
    Posts:
    22
    Damn is using geometry for lights even possible I know I can effectively make it emissive but ideally I want it to be able to emit light into the scene. Right now I am using a point light inside the mesh but want to lose the round falloff and have it closer to the gameobjects shape as it animates.
     
  27. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Oh, I wasn't using the mesh as an emitter, it was a spherical area light custom lighting setup, so, no, it wouldn't work with any mesh.

    I will make a tutorial on the spherical area lights later on :)
     
  28. ZraXesZ

    ZraXesZ

    Joined:
    Jan 25, 2014
    Posts:
    1
    this tool is freaking Amazing
    thank you Acegikmo very much for bringing some of udk material powers into unity

    I will totally buy it when I can :)

    and I really want to know if this tool can make something like water shader
    or animated shaders

    i hope u will continue making tutorials for this asset and making it better and better :D
    great job!
     
  29. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Thanks a bunch ZraXesZ!

    I've been experimenting with a screenshot feature today‬ - working out the optimal auto-placement of the 3D preview in the node tree :)



    Looks like manhattan distance might the the best norm to go for :)
    (It doesn't avoid connection lines yet though, just the nodes)

    Also, do you all think I should put up a blog?
     
    Last edited: Jan 25, 2014
  30. Ashtear

    Ashtear

    Joined:
    Sep 2, 2013
    Posts:
    1
    I'd say yes. This would help a lot to keep track of official communications through an RSS feed so I don't have to keep this tab open and refresh it every day. ^_^
     
  31. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    Great tutorial! It was very "enlightening". Keep them coming ^_^
     
  32. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Blog would be welcome, also would help you with organic traffic. Also the screenshot feature is interesting... also turn it into an `organize this for me` button to automatically make my shaders tidy?
     
  33. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Hi,

    May I suggest you to add a button to 'save shader graph to online library'?
    You then chose a category and fill in some descriptions about the shader and finally commit it right from within shaderlab.
    Other people can then list published shaders in different categories and open them directly in the editor :)

    If you don't have time to do it, just ask here, many people could take care of that feature in 1 day of work for you. Besides the unity editor ui, it would only require some basic PHP knowledge, and a web server.

    I'm pretty sure you'll sell more lisences with it ;)

    Regards,
    David
     
  34. JoeW97

    JoeW97

    Joined:
    Nov 3, 2013
    Posts:
    56
    Totally agree with this, I think a library is the most important next step, and would be sure to increase sales. There was a guy showed initiative and tried to start one in another thread, but it got taken down - understandable if it was competing with an official one, but there doesn't seem to be any other one.
    As everyone has said ShaderForge is brilliant and is the first asset I've bought that is truly professional in terms of interface design, support etc., but there's a lot of re-inventing the wheel going on due to there being no library.
     
  35. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    The automatic screenshot feature is now working! It's not completely done, I have yet to add buttons in the interface to take the screenshot, but here's how an auto-screenshot looks now:




    Possibly! They are quite different though, but it is something I've considered :)

    I do still want to make a library / shader sharing center! It will most likely take a while, as SF isn't 1.0 yet, but soon :)
    The time consuming part will be to implement OpenID, so it can use the same login as a potential forum (if people want a forum), secure uploads, and so forth, plus the fact that I hate releasing things that aren't polished.

    Ideally you should be able to view the shaders in real-time in a Unity webplayer, as well as view the entire node graph, browse all shaders of a user, and more! So it can get complex quite fast
     
    URocks likes this.
  36. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,084
    Okay, I think I've nearly solved my problem. At least, I think I know what I want to do. I always want the model to be at least a little lit, so this will be calculate from the ambient light. Okay, cool! Even I can figure that out.

    So what I've been thinking is that I need to light the model based on the distance from the object position to the light position so that the model is lit the exact same all over. I guess this is simple enough. I just need to plug the light position and the object position into a distance node and... that's where I'm stuck. I have no idea where I need to plug the distance node into to get the desired effect. I think this will eliminate the weird blackness while keeping the lighting uniform, but I could be totally off-base here.

    Short version: WHAT DO I DO, HELP
     
  37. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    To be honest, I think this feature should be your priority even in a simplistic form, much more than a screenshot feature or even a forum.

    Doing the library outside of Unity on a website is imho a huge mistake and will result in a lot of additional work but also make the user's workflow less convenient. You should do it right in unity where it belongs and where previews are easy to do and where you actually need the stuff.
    We do a lot of unity editor interface for our game and I can assure you you could do something awesome.
    Besides doing it outside of Unity will also result in fewer submissions/participation, thats a proven fact.

    Here's how a basic embedded version could work and make your users happy fast before you add the full experience in Shader Forge 1.0 ;

    Shader would have the following info;
    1. Cathegory; toon, vegetation, animated, special effect, etc.
    2. Title
    3. Description
    4. Shader editor name with optional email
    5. Vote 5 stars. To let the community curate low quality submissions

    That's all you need to start with. There are tons of features you could implement around it, but starting with something simple could already populate your db with relevant content and allow people to learn your tool right now, not in 6 months.

    Sorry if I sound like an ass, I actually don't have time to use shader forge but I know by experience that you will benefit in many ways doing it right in Unity as opposed to an external website.

    Take care
    David
     
  38. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think OP is probably best off taking advice after he's launched, on his own terms, from customers rather than people who have no time to actually use the product.
     
  39. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Really nice package,

    Very interested in supporting this project. Although I am a bit concerned regarding the recent review on the asset store by Voxi 3d.

    -----------------------------------
    "From the readme.txt file" Selling shaders created in Shader Forge:This is currently not permitted".

    So basically everything you make still somewhat belongs to the author of the Editor? Who the hell would want that?

    Again from the readme "If you are selling 3D models / assets, they are allowed to have SF shaders on them,
    as long as you mention Shader Forge in the asset store description"

    So you are basically a big billboard for this guy's sales page. No word on if the models can be used in a commercial game or not. I have a feeling it will be some sort of hidden license fee or fine for your consumer. The odd license has me scared to death to even admit I own it. I am afraid this guy is going to be able to sue me for using it on my store assets. It seems to me this might be a legal trap for my clients as well.

    Also, it puts everything under the "Shader forge" folder in the shader selection, so you might as well tell your client, “I am a big fat Noobie who cant even write my own shaders.”. Buying this for a time-saver will get you demoted to the “Dunce level” in your clients eyes in no time.

    You cant make shader packs for resale, Putting them on your models entitles you to advertise for this guy.
    Well, this is not for small art studios. I had the dream of making some really nice looking models for the Unity store. I also had the odd dream that I might get good enough that my shaders alone would be sellable.

    I was hoping to use this to help fund my game. Now I can only use it for my own little project.

    Was going to give this the best rating possible last night. I am glad I waited to read the readme.txt file."
    ----------------------------------

    Can you clarify the licensing situation for us new potential customers?

    Cheers.
     
  40. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Well... it took me a time, but i finally bought it!
    Acegikmo,
    After import it, i'm receiving this erro message:
    Can you help me, please?
    -Edit-
    Unity has full permition on my computer and the folder has nothing stoping accessing it.
     
  41. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think it's fair. Basically, whats to stop someone making 1,000 shader combinations and selling them and making shader forge have absolutely no future? That's the author's choice. You use shader forge for your games and it's fine - the intended purpose is for your games and not to create competition for shader forge itself.

    I think it's perfectly reasonable to use shader forge for shaders in your game as opposed to driving him out of business. I don't know about you but I hope those terms stay. Because shader forge's success is vital to it's continued development.

    You don't need to mention Shader Forge if it's just used in your game AFAIK (the intended purpose) - but if you're hell bent on competing in the same marketplace the terms do change.
     
  42. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    And what is wrong with that? You are advertising a product you are using and in return he will hopefully get more sales to ensure future updates and new features. Common sense should tell you that selling SF created shaders would only hurt the author of SF. Personally I am fine with all of that. I create art and plan on using SF for games and art packages on the asset store which I am allowed to do as the readme.txt states. I don't understand the problem here.
     
  43. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Never mind. It work after restart Unity.
    Great Tool!
     
  44. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    But you're NOT writing the shaders, so why should you be allowed to pretend that you are? The only people who would care that you aren't writing them are those who would be willing to take the time to learn shader forge and create those shaders on their own. Seems to me that you're trying to swindle those people out of that choice.

    I love that you can't do that.
     
    Last edited: Jan 25, 2014
  45. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I'm sure the author will clarify his own position.

    For me, as someone who has hand-written shader packs that I sell on the asset store, I bought Shader Forge with definite interest in using it to create and sell shader packs. I could make most shaders myself by hand but SF saves time and effort. To make an interesting shader beyond standard functionality/lighting etc you still have to have some creative/programming ability and an understanding of how to build a given effect. For me that creativity is my own 'intellectual property' and that's a large part of what I sell and I do want to be able to share that through the asset store and be valued for it.

    Traditionally I've used Shader Lab as my 'development environment' and worked with its 'toolset' (albeit a text syntax). It is a tool. Without my creativity, my shaders would not exist. What I provide is 'added value' above and beyond just implementing basic shading/lighting/normal mapping stuff. As long as you aren't just 'wrapping' SF's easier functionality and outputting umpteen fairly standard shaders which don't add anything original, then I don't see it as a problem. Unity's editor does the hard work of turning my Shader Lab code into compiled shaders, similar to how SF turns shader diagrams into Shader Lab code. If Unity were much more closed to creativity and sharing, it wouldn't be possible to sell any shaders whatsoever. I don't think the SF author is closed-minded at all and wouldn't be aiming to cut off people's creative contributions. But as usual, when you give someone certain freedom it needs to come with a certain level of respect and responsibility.

    I'd like to be able to make shader packs with SF and sell them on the store, and if that entails having to put a link to SF on my asset page I think that's a totally fair exchange. It encourages more people to buy SF and to, in turn, be interested in a shader pack which includes SF shader graphs/metadata. Its a self-reinforcing win-win in my opinion because then not only is the shader pack useful but also can be customized for those who own SF. Considering there is some degree of competition when a pack provides functionality that isn't standard to SF, I think its' fair for the author to ask for a simple link, and to serve as a bit of an 'ad' for SF. To me it makes good business sense to support a product in a mutual arrangement which supports you back by allowing certain freedoms.

    I think if you directly ask the author you'll find he's a very reasonable and pleasant fellow and more than willing to listen to your feedback. AFAIK he's still refining his exact stance on what license will apply when SF goes to version 1.0. I can understand how if you were selling other assets like 3d models using custom shaders you might not be interested in supporting SF or caring about what was used to make the shaders, but I don't think that's a very supportive attitude. Why not be proud that your pack uses SF shaders and be willing to add that little link on your page.

    BTW you don't have to have all shaders in the Shader Forge folder. That's just a default that you can change in the settings panel on the left of the editor. You can use whatever hierarchical folder structure and naming you like.
    '
     
    Last edited: Jan 25, 2014
  46. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well there should be a separate "professional" license for people wishing to sell shaders - something like 2-3k should cover it, given the potential revenue you'd get back for very little work. I mean, it is directly siphoning revenue away from the author so due compensation is a must.
     
  47. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,084
    This seems like the best option, yeah. I'd rather ShaderForge not create its own obsolescence.
     
  48. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I think instead of a 2-3k license, which btw is more than I and most people make from asset store shaders in a year, a simple requirement that the shader pack include added value should suffice. It takes time and effort to make good shaders even with this tool, building documentation, creating demo scenes, creating textures and other assets etc.. if it were something like 'you can sell shaders but it must be accompanied by other assets' would help deter people from just throwing shaders up. It takes a lot to make a decent product that isn't just shaders by themselves. I would be able to pay perhaps a few hundred for a pro/re-seller license, but I think you'd get very few people capable of investing 2-3k and still not be likely to make that back any time soon.
     
  49. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I don't agree - you're the absolute tiniest possible minority user for SF, and also it's competition. The vast majority will be people making games, possibly 10,000:1 ratio - so your wishes in this case ought to be ignored.

    I don't want to upset you, it's just unrealistic to ask for a clause that only benefits you. If you look at Unreal nodes, these are almost directly translatable to SF, and there's thousands of these freely available online. I would rather people buy SF and not buy your shader pack.

    I don't say this because I hate you - far from it, I think you're great. But I think that having a proper node editor is integral to unity's future. Look at Unreal Engine, and know that the community is very much a thriving and growing thing thanks to UE's shader node graphs being shared as opposed to the shader code.

    That's the future - not shader packs based off it.

    Shaders for sale should be designed and hand-coded and optimised by those who know exactly what they're doing otherwise you're just a middleman doing damage to the community (without realising it).

    SF basically just needs to be bought and integrated into Unity. It's actually stupid (and backward) that Unity doesn't have an integrated shader editor.
     
    Last edited: Jan 25, 2014
  50. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    What is currently stopping you from writing all these nifty shaders and make your shader pack NOT using SF? I fail to see why you need SF for that. Most of your points make little sense and to me personally, feels like you are trying to "leech" of somebody else's work which in this case is the author of Shader Forge. There is nothing wrong with using SF for games or art assets but to use it to create a shader pack and make money of the "unaware" is what I consider shady business. One can easily re-create many of the freely available UDK shader examples using SF. So should we all just do that and re-sell them? Surely not.