Search Unity

Shader Forge - A visual, node-based shader editor

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

  1. Almighty_gir

    Almighty_gir

    Joined:
    Oct 22, 2012
    Posts:
    24
    that would tint the ambiant light. if you had a red diffuse and then multiplied it with ambient light, the ambient would take a red tint, which it shouldn't do unless it's metallic.

    it should be (for non metallics):
    diffuseInput + diffAmbLight + specularInput + specAmbLight
     
  2. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    I have to disagree, I'm pretty sure I got it right.

    In your case, ambient light would just add color to it, instead of acting as a light source.
    So if your diffuse it pitch black, it basically should mean that it absorbs all diffuse light 100%. Adding ambient light should then be absorbed as well, which it won't be if everything is additive.

    To elaborate:

    diffColor * (diffAmbLight + realTimeDiffLight) + specColor * (specAmbLight + realTimeSpecLight)

    I think what you're talking about, is the fact that the specColor, should be grayscale for non-metallics, and colored for metal (At least the ones that do have a colored spec).
     
  3. Almighty_gir

    Almighty_gir

    Joined:
    Oct 22, 2012
    Posts:
    24
    ahhh okay, my mistake.

    i should definitely wait until my brain is fresh before doing this stuff :D
     
  4. -JohnMore-

    -JohnMore-

    Joined:
    Jun 16, 2013
    Posts:
    64
    Hi,

    I am staring to learn how to use this plugin, looks really great but I am having a little problem.

    I am using MatCap shaders and wanted to test a simple unlit shader. So I created a new shader, changed the light mode to "Unlit/Custom", added a Texture2D and linked it to the "Custom Lighting" input. In ShaderForge everything shows alright but in unity my model is black.

    I have asigned the texture in Unity, added a light to see if that was the problem (but no, it was not), the render mode is set to forward, emulation is set to OpenGLES 2.0 but I tested it with no emulation and did not work, platform is android and really don't know where to look anymore. There is not error message anywhere but I have found something strange: in the simple shader tutorial on the web, when creating a new empty shader, just above the "Shader Settings" there are a few icons with numbers. In my case, it's just zero on both of them.

    Maybe the capture can give you more info:
    $ShaderProblem.png

    Am I doing something wrong?

    Thank you in advance
     
  5. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Custom Lighting is run per-light source. If you don't have lights in your scene, it goes black.
    Plug it into Emission instead :)

    Edit: Also, you'll need to enable Direct3D 9 and/or OpenGL in order to render on the PC as well, not only GLES
     
    Last edited: Jan 13, 2014
  6. -JohnMore-

    -JohnMore-

    Joined:
    Jun 16, 2013
    Posts:
    64
    I am definitely doing something very wrong :)

    I changed the texture to the Emission input and nothing, then deleted the texture, added a color, plugged it into the emision input and still nothing. The thing is, in another project it is working really great so I did something to this project and broke it but I cannot think of anything more that can make the Shader not work :/

    But, this is not a problem of your plugin so I will look in another place. Thanks for your help!
     
  7. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Did you try this as well?

     
  8. -JohnMore-

    -JohnMore-

    Joined:
    Jun 16, 2013
    Posts:
    64
    Yes, DirectX9, 11, OpenGL and OpenGL ES 2.0 are selected in Shader Settings :(
     
  9. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Are you sure the ships are using that shader? Did you assign a texture in their material?
     
  10. -JohnMore-

    -JohnMore-

    Joined:
    Jun 16, 2013
    Posts:
    64
    Yes, these are some captures, I think I am doing everything allright. $ShaderProblem1.jpg $ShaderProblem2.jpg $ShaderProblem3.jpg $ShaderProblem4.jpg
     
  11. gsokol

    gsokol

    Joined:
    Oct 5, 2010
    Posts:
    76
    Will there ever be any plans to support deferred rendering?
     
  12. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    It is planned, yes, but it will have some limitations due to how deferred works! But I will try to make it as intuitive as possible
     
  13. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376
    Super Extension... I used UDK briefly before and this is awesome to have in Unity.

    Ex:


    Download Shader: https://www.dropbox.com/s/zfkf62itsdhm7gn/HSL_Stripes_001.shader

    Small issue on my end.
    If you look at the transition between Green and Blue... its Blending them allot more than i like. I would rather see a clean line to distinguish the different colors. Anyone can help? :)



    I'm using:
    Blue Offset = 0.5
    Green Offset = -0.5

    Thanks for any help up front. (Hmmm.. that doesnt sound right) :/
     
    Last edited: Jan 14, 2014
  14. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Definitely a step in the right direction... especially with the PBR and energy conservation features... has this been tested with Light Probes, SH, and Global Illumination?
     
  15. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    SF supports Light Probes/SH as well as lightmapped GI!
    I'm not sure if deferred will be able to handle PBL though, as PBL requires quite a lot of lighting data which might not be able to fit with the small data set deferred is working with. I'll see what I can do though :)
     
  16. ohmyhead

    ohmyhead

    Joined:
    Jan 14, 2014
    Posts:
    4
    hello,how to cancel the connection line?
     
  17. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    If you want to delete a connection line hold Alt and drag RMB to start cutting lines. You can also hold alt and click RMB on connectors to disconnect them :)
     
  18. ohmyhead

    ohmyhead

    Joined:
    Jan 14, 2014
    Posts:
    4
    nice! thank you very much.:D
     
  19. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    That could be simplified a *lot*. You've got separate RGB chains of nodes; you could have them in the same place :)

    Here's something for you:

     
  20. AllonVR

    AllonVR

    Joined:
    Jul 16, 2012
    Posts:
    28
    This looks really awesome!

    Any plans for for making a mobile targeted version? Or for adding features that would be targeted specifically for mobile output?
     
  21. -JohnMore-

    -JohnMore-

    Joined:
    Jun 16, 2013
    Posts:
    64

    Well, in the end I had to create a new project and move everything to it. It works now. It was a 3.5 project updated to 4.3. I can only guess something went wrong in the upgrade, because the other project was 4.3 and worked great.

    Thank you and sorry for wasting your time

    PS: by the way, I am having a great time with your plugin, it is awesome :D
     
  22. joelfivat

    joelfivat

    Joined:
    Aug 14, 2013
    Posts:
    45
    It took me a while to figure that one out ^^. You might want to find a more intuitive way to do it, I guess a lot of people are stuck wondering how to disconnect lines. For example dragging the line to an empty space could disconnect the link.
     
  23. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376
    To delete connections i was Left Clicking and Holding on the box.. and then hitting Backspace to drop the connection :)
     
  24. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You don't need to hold LMB to do that, but yes, that works too :)
    Also, IzzySoft, there is a screenshot for you at the bottom of the previous page, in case you missed it
     
  25. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376

    Super.. Thank you.
    I'll look this over and see how it works. :D
     
  26. Jack2g

    Jack2g

    Joined:
    Aug 6, 2012
    Posts:
    19
    Hi, "Not Important" lights are not working on my current model, and it is a very simple shader.

    $Screen Shot 2014-01-14 at 1.03.36 PM.png
     
  27. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    This is very interesting, I just have a few questions.

    Does Shader Forge support Unity 3.5.x?
    And do you have any estimates on a time for the Deferred pipeline?
    Finally, what are the limitations of this tool when building to WebPlayer?

    Hopefully this is an asset I can get on board with, it looks great!
     
  28. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    http://acegikmo.com/shaderforge/faq/?Q=mobileopt

    Ah, I suppose it's missing somewhere! Could you report the issue here? -> http://shaderforge.userecho.com/

    1. http://acegikmo.com/shaderforge/faq/?Q=unityversions
    2. Hard to say, but at least a month, shouldn't be more than three months. (Rough estimate, depends on a lot of things)
    3. None that I'm aware of!
     
  29. RogDolos

    RogDolos

    Joined:
    Oct 16, 2012
    Posts:
    42
    EditorLabel.cs is blocking builds right now because it's using UnityEditor (which doesn't exist in a build). On my system I moved that Scripts directory to inside the Editor directory so Unity will properly ignore it during builds.
     
  30. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    This has been fixed for the coming version :)

    http://acegikmo.com/shaderforge/changelog/
     
  31. mandydark2

    mandydark2

    Joined:
    Aug 13, 2012
    Posts:
    17
    I have tried to create a simple shader and I have not obtained the expected result.
    It is very basic, just a shader with two colors where always one of the colors is pointing up in the direction of the vector Y, regardless of whether the object is rotated where applied.

    $mat.jpg

    I implemented exactly the same nodes in Unreal, and there I get the correct result, the top of the object is always white and the bottom is always black. Then it's just a matter of using a Lerp to mix colors.
    What can be causing the problem here, using Shader Forge?
     
    URocks likes this.
  32. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    UDK interprets vectors in Tangent space, SF does it in World space, which is most likely the issue!

    Here's a setup that should work as you want it to:

     
    URocks likes this.
  33. mandydark2

    mandydark2

    Joined:
    Aug 13, 2012
    Posts:
    17
    man you're awesome!!!
    thanks a lot!!!
     
  34. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Really super awesome tool.

    I am working mainly with Mobile. I noticed that there are other questions regarding mobile support and I did find your forum link for mobile support.

    It would be much better to have a mobile optimize version instead of publishing a desktop version and then having to mess with the code for mobile. Altering the code requires much more knowledge of mobile and defeats the purpose of providing a simple shader construction solution for non shader experts.

    Reequest for future update: Please offer support for mobile. This will definitely make ShaderForge the absolute best shader package.

    Cheers.
     
  35. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    That's probably a very silly question but I don't know the answer so I'll ask: how do you "unplug" a connection once it's made? I've tried the delete key, backspace key, and all the mouse button + CTRL + SHIFT + ALT I could think of, but without success.

    So how is such a simple thing done?
     
  36. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    There are three ways:

    1. Hold alt and drag RMB in empty space to start drawing a cutting line, and cross the connections you want to delete, and then release!
    2. Hover your mouse over a connector (Not the line, the connector), and hold alt and click RMB
    3. Hover your mouse over a connector (Not the line, the connector), and press backspace

    Here's how #1 looks:

     
  37. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank you! I certainly would have never thought of something like that! :)
     
  38. joelfivat

    joelfivat

    Joined:
    Aug 14, 2013
    Posts:
    45
    Shader Forge is not able to reopen my shader https://dl.dropboxusercontent.com/u/4422249/Anything/VoxelEdit.shader

    I created it with beta 0.18 and did not edit the file. The only thing I did was adding some "add" / "multiply" nodes to compute brightness from rgb values. Can you fix it ?

    Also, I have a problem with the CPU, when I open Shader Forge Unity jumps to 20% of my CPU time, then it drops back to 0 when I close Shader Forge.

    Thanks a lot ! I love your extension.
     
  39. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Complex custom editor windows with lots of redrawing or per-frame updates or lots of graphical elements/handles etc do tend to hog a fair bit of CPU, not just in shaderforge.
     
  40. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Ooh, that's a really nasty bug I thought I got rid of before 0.17 :(
    Could you open a topic in the feedback forums? http://shaderforge.userecho.com/

    Yeah GUI is quite expensive at this scale. However, I've planned to add a FPS cap that you can set yourself, in you want to limit CPU usage :)
    And thanks! Glad you like it :)
     
  41. joelfivat

    joelfivat

    Joined:
    Aug 14, 2013
    Posts:
    45
    Done, thanks a lot for your support :). Don't worry, it was a pretty simple shader, so I will just recreate it. Do you know how I can avoid that error until you fix it ?
     
  42. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    The best way to avoid the issue is to let me know as soon as it happens again - because I have no idea what's causing it at the moment
     
  43. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I just wanted to say to anyone reading this: if you still have a doubt about springing for this asset, then don't even hesitate. Shader Forge is artist-friendly, intuitive to use and elegant to boot.

    Joachim, you're doing a terrific job, both at programming and supporting.
     
  44. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Thanks Seith! Glad you like it :)

    A little update on the development - deferred might be a bit more straightforward than I initially thought, but due to how deferred lighting works, lighting options will be *very* limited.

    For instance, you won't be able to use these inputs when using deferred:
    Diffuse Power
    Custom Lighting
    Transmission
    Light Wrapping
    Alpha (Maybe)
    Outline (Maybe)
    Outline Color (Maybe)

    And pretty much all light nodes will be unavailable when using deferred:
    Half Direction
    Light Attenuation
    Light Color
    Light Direction
    Light Position
     
  45. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I was wondering: is there a way to access a transform's position in SF? I would like to try and do a simple tessellated ripple effect that would follow the player around when walking in knee-high water (a tessellated plane).
     
  46. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Make a Vector4 property called PlayerPos, and send data to it with a C# script using SetVector:

    Code (csharp):
    1. renderer.material.SetVector("_PlayerPos", transform.position);
     
  47. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thanks, I'm going to try that!
     
  48. mandydark2

    mandydark2

    Joined:
    Aug 13, 2012
    Posts:
    17
    This my ice snow shader I've created last night. Based on UDK tutorial.

    $mat.jpg

    Thanks to Shader Forge it was super easy to do it! :D
     
    Last edited: Jan 15, 2014
    URocks and JohnyK like this.
  49. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Very nice! Would love to see it in a scene :)
     
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Given the glowing feedback this is getting and the fact it really is something Unity needed a great deal (and is being updated so rapidly and so promisingly) it's almost certain to be part of my big splurge coming along in the next month or so

    I was wondering, as I hadn't seen it mentioned anywhere, if there was, or were plans for a library of shaders created by shaderforge, that could be used as is or as reference by folk, probably presented as a wiki would seem the fastest and most straightforward way. Not everyone's willing to share their hard work and that's fine but this could be an amazing resource for education and inspiration for shader writing itself, not just shader forge use.