Home Unity Store

[RELEASE] Shader Forge - A node-based shader editor for Unity

1131416181921

Replies

  • Acegikmo
    What errors are you getting in the console? (The topmost one)
  • MrNinjutsu
    Offline / Send Message
    MrNinjutsu greentooth
    NullReferenceException: Object reference not set to an instance of an object
    ShaderForge.SF_Evaluator.Evaluate ()
    ShaderForge.SF_Editor.OnDisable ()
    UnityEditor.EditorWindow:Close()
    ShaderForge.SF_Editor:Update()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Also for the original shader:

    Property node with ID 476 not found while deserializing
    UnityEngine.Debug:LogError(Object)
    ShaderForge.SF_NodeTreeStatus:GetNodeByID(Int32)
    ShaderForge.SF_NodeTreeStatus:DeserializeProps(String)
    ShaderForge.SF_Parser:LoadFromNodeData(String, String&)
    ShaderForge.SF_Parser:ParseNodeDataFromShader(SF_Editor, Shader)
    ShaderForge.SF_Editor:InitializeInstance(Shader)
    ShaderForge.SF_Editor:Init(Shader)
    ShaderForge.SF_Editor:OpenLoadDialog()
    ShaderForge.SF_Editor:<DrawPrimaryMainMenuGUI>b__28()
    ShaderForge.SF_Editor:FlexHorizontal(Action)
    ShaderForge.SF_Editor:DrawPrimaryMainMenuGUI()
    ShaderForge.SF_Editor:DrawMainMenu()
    ShaderForge.SF_Editor:OnGUI()
    UnityEditor.DockArea:OnGUI()
  • Acegikmo
    Is that really the first error?
    Strange though, not sure what could have gone wrong. Upload the shader to pastebin
  • MrNinjutsu
    Offline / Send Message
    MrNinjutsu greentooth
    Acegikmo wrote: »
    Is that really the first error?
    Strange though, not sure what could have gone wrong. Upload the shader to pastebin

    http://pastebin.com/5Z40SKKM
  • Acegikmo
    Near the end of the SF data in the shader, it says:

    proporder:2-1037-1306-533-447-69-9-177-571-626-145-476

    Remove -476 from that list, and it should work again.
    This is due to a bug that was in 0.29, in which you saved the shader, most likely
  • MrNinjutsu
    Offline / Send Message
    MrNinjutsu greentooth
    Brilliant Thanks Ace!
  • uk_resistant
    Offline / Send Message
    uk_resistant polycounter lvl 17
    is there any way to invert the effect of the depth node to fake fog? if not, anyway to have the node react to the far plane as well as the near one?

    Also. when i try blending this with another diffuse, it doesnt work and gives me the magenta colour?
  • Acegikmo
    is there any way to invert the effect of the depth node to fake fog? if not, anyway to have the node react to the far plane as well as the near one?

    Also. when i try blending this with another diffuse, it doesnt work and gives me the magenta colour?

    If you want to invert it, you should be able to do (farPlane-nearPlane) / depth.

    What node setup gave you a broken shader?
  • uk_resistant
    Offline / Send Message
    uk_resistant polycounter lvl 17
    error.jpg


    I get this whenever i use anything like a add, multiply etc
  • Acegikmo
    That's very strange. I can't seem to reproduce this.
    Does it happen in a new shader too?
    Do you have any strange settings for the shader?
    What error are you getting in the console?
  • Acegikmo
    Also, I promised some statistics after the sale, so here you go :)

    sf_sales_2014_04_12.jpg
  • timotronprime
    Offline / Send Message
    timotronprime polycounter lvl 11
    Is there a setting to make this go from left to right instead?
  • Acegikmo
    Not yet, but I've considered reversing it now that Unreal 4 reversed theirs. Pretty much the only reason I had it "backwards" is because UDK did it :)
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    Thanks for sharing the sales Ace! Wish you keep getting it!
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    In the latest version I'm getting an awkward tiling issue, I'm not sure if I'm missing something. But here's the graph, I can see the tiles doing something awkward. I already checked the vertex normals in maya, but all are pointing up.

    If I try with any other regular Unity shader, it doesn't happen.

    floortile.jpg
  • Acegikmo
    I would guess it's a very low glossiness causing that, but it does seem strange that it makes that specific tile brighter. Does it only happen with the PBL mode? Does it happen with a constant value in gloss? Does it happen with a constant value in spec?
  • Acegikmo
    I also have some exciting news to share now.

    Deferred lighting will be supported soon!

    BlGvk1wCEAABQdC.png:large

    (With a few limitations of course, due to how the deferred pre-pass lighting system works)
  • MrNinjutsu
    Offline / Send Message
    MrNinjutsu greentooth
    Dude you're awesome and congrats on the sales!
  • Shrike
    Offline / Send Message
    Shrike interpolator
    Acegikmo wrote: »
    I also have some exciting news to share now.

    Deferred lighting will be supported soon!


    (With a few limitations of course, due to how the deferred pre-pass lighting system works)
    Oh god no rewriting every shader per hand to deferred

    amXV65v_460sa.gif
  • MrNinjutsu
    Offline / Send Message
    MrNinjutsu greentooth
    programmer is asking whether it will be compatible with all the new stuff in unity 5.0 when it comes out. Not sure if you could even answer this right now.
  • Acegikmo
    MrNinjutsu wrote: »
    programmer is asking whether it will be compatible with all the new stuff in unity 5.0 when it comes out. Not sure if you could even answer this right now.

    "Compatible with all the new stuff" - depends on what all the new stuff is.
    I've readied SF so that it works in unity 5 already, but I haven't made it support the new fancy features of U5 yet. It is planned though :)
  • MrNinjutsu
    Offline / Send Message
    MrNinjutsu greentooth
    Yeah i think he means the PBR stuff.
  • Acegikmo
    The PBR in U5 is more or less identical to the PBL lighting mode in Shader Forge
  • Shadownami92
    Offline / Send Message
    Shadownami92 polycounter lvl 7
    Hey, most PBR shader workflows I look at use Albedo, Roughness, Metalness and Ambient Occlusion , normals and the cubemaps as their main textures. Is there any sort of plan for a possible tutorial on how to set up this type of PBR material set up? I tried looking through threads and couldn't find any node setups about it.
  • naturon
    I'd like to second that request. Can I just express again how good this tool is, the more I delve into it the more I'm impressed.
    Right now I'm learning slowly and mostly from trying to replicate UDK stuff (something that might help is a translation of which node is which compared to the UDK ones).
    One other thing that's bugging me big time is the lack of a decent vertex painter solution in Unity, although that's in no way your fault :p
  • Acegikmo
    It's mostly just different words when used in PBR shaders

    Diffuse <- Albedo
    Gloss <- OneMinus <- Roughness
    Specular <- Metalness

    AO is a bit tricker - you'll have to multiply it by your cubemaps, and possibly your ambient lighting as well, which can get tricky if you want it to be super accurate.

    I've planned to make an AO input of the main node soon :)
  • uk_resistant
    Offline / Send Message
    uk_resistant polycounter lvl 17
    error.jpg


    I get this whenever i use anything like a add, multiply etc



    Hey, sorry about the late reply - I am going to look at this shader again and see if it is just local to me.



    SO I remade the shader and it works as expected. I noticed that when I tick on light
    map support it again kills the shader but this isnt a massive issue for me.

    Thanks for the quick responses.
  • Acegikmo
    Two new nodes coming in Beta 0.33 :)
    (Note that they aren't static / multi-compile switches, they are still properties. Static switches may come later!)

    switchtoggle.png
  • BluntPencil
    Hey guys and newbie alert! I'm experimenting with triplanar shading (different textures, depending on the angle of the polys), but I need some help.

    As you can see in the preview, the triplanar-ness of it is actually working - there's snow on the top and bottom of it, and grass on the sides. The transition between the snow and grass is too wide and smooth though - I would like to basically "sharpen" the mask, so the transition could be tighter, perhaps even use an actual masking-texture for it.

    However, I am completely stumped as to how I could do it, despite faffing about for what feels like hours trying to fix it. Anyone have any snazzy insights I am missing? Comments on the rest of the shader are welcome as well, I welcome any and all optimizations.

    vp6wRKF.jpg
  • Jeza87
    Is there any major differences between the SF PBL and say Toolbag 2 or the shaders in substance designer? Because, when i display my model in Unity with SF PBL some parts look like light is wrapping around the edges of it. It looks bright and not very natural. It only seems to be happening non metal parts of the mesh where i'm trying to do "rough plastic" with little to no gloss and spec. And it still looks glossy kinda.

    I thought it might have something to do with my Cubemaps for IBL both Diffuse and Spec are generated from "Skyshop" and i'm decoding by multiplying the (RGB X A X 6)

    Another thing i noticed was i can see seams in the cubemap when it's mipped, on the surface of the model. Does it have something to do with the way i have to put a 1- node on my gloss and multiply it by 7 to get blurred reflections working?

    And i was wondering what the PBL node tree looks like when plugged in to the custom lighting part of the material, because i'm interested in learning more about shaders and don't have any programming knowledge. And i want to see if i can create the "metalness" workflow that UE4 uses.

    Sorry about the length of my post, thanks if someone replys!
  • Acegikmo
    I don't know exactly how they implement their PBL, but there is almost certainly a difference somewhere, but it shouldn't be a big one.

    If you get specular light around the edges it, it could be that you're getting normal map leaking; try it without a normal map, or that you have an old version of SF that had too strong of a fresnel.

    If you're getting seams, it probably means that the skyshop cubemap was incorrectly baked, or that you've got the multiplied value too high. Change it from 7 to 6 or 5 or so, until it goes away when fully rough.

    Also, the PBL node tree is rather huge, so it's not very fit for node-based approaches.
  • Jeza87
    Acegikmo wrote: »
    I don't know exactly how they implement their PBL, but there is almost certainly a difference somewhere, but it shouldn't be a big one.

    If you get specular light around the edges it, it could be that you're getting normal map leaking; try it without a normal map, or that you have an old version of SF that had too strong of a fresnel.

    If you're getting seams, it probably means that the skyshop cubemap was incorrectly baked, or that you've got the multiplied value too high. Change it from 7 to 6 or 5 or so, until it goes away when fully rough.

    Also, the PBL node tree is rather huge, so it's not very fit for node-based approaches.

    Thank you for the reply! I upgraded SF and the problem with the fresnel being too strong was fixed.

    As for the seams in the cubemap i changed the multiply from 7 to 4-5 and the seams went away in rough materials but appeared in smooth materials, so i put a clamp 0-1 node after it and the seams went away with the multiply at 7. Was i supposed to do this in the first place?
  • Acegikmo
    Deferred lighting is pretty much ready now!
    However, beta 0.33 will most likely be quite unstable when it's out, so be sure to have your version control ready :)
    I'll of course try and fix any issues as fast as possible when/if they were to pop up.

    This is a single quad using a Deferred Shader Forge shader, with 24 real-time point lights:
    deferred_lights.gif

    There are also two new nodes, for making boolean/toggle/switch/checkbox properties. Note that these are active, not static switches, meaning that it'll process both inputs. So don't use this for optimization, use it for things you want to enable/disable in real-time.

    Mind that deferred pre-pass lighting is not a solution to all problems. While you are able to use a ton of real-time lights, you will also be much more limited in terms of lighting your shader.

    Here's a summary of what's new and how deferred affects what's possible :)
    deferred_toggle_switch.jpg

    It should definitely be out this week!
  • Acegikmo
    Beta 0.33 is now out!

    New in Shader Forge Beta 0.33:
    • Deferred Pre-Pass lighting is now supported! However, it has the following limitations:
    - Blinn-Phong only
    - Unavailable main node inputs: Diffuse Power, Transmission, Light Wrapping, Custom Lighting, Alpha, Refraction, Outline Width/Color
    - Gloss will always be remapped from [0-1] to [0-128]
    - Specular highlight colors won't be 100% accurate
    - None of the lighting nodes will be available, except ambient light

    • Added node: Switch
    - This is a property node, exposed in the inspector as a checkbox
    - Outputs the Off input when unchecked
    - Outputs the On input when checked
    - Note that this is an active branch, not a static branch

    • Added node: Toggle
    - This is a property node, exposed in the inspector as a checkbox
    - Outputs 0 when unchecked
    - Outputs 1 when checked

    • You can now switch Channel Blend method between Summed and Layered:
    - Summed means it will multiply all channels, and then add them together
    - Layered means it will blend the channels on top of each other, commonly done in terrain shaders

    • The forward rendering lightmapping has changed a little in how it deals with real-time lights
    • Fixed a bug where energy conservation broke the shader when using a non-PBL lighting mode without specularity
    • Broken shaders saved with a property node bug from 0.29 should now load without locking up Unity
  • Polynaught
    Offline / Send Message
    Polynaught polycounter lvl 11
  • Cay
    Offline / Send Message
    Cay polycounter lvl 5
    Acegikmo wrote: »
    It's mostly just different words when used in PBR shaders

    Diffuse <- Albedo
    Gloss <- OneMinus <- Roughness
    Specular <- Metalness

    AO is a bit tricker - you'll have to multiply it by your cubemaps, and possibly your ambient lighting as well, which can get tricky if you want it to be super accurate.

    I've planned to make an AO input of the main node soon :)

    Hey, I'd be highly interested in how to achieve that, how you apply an ao/cavity map in a pbl shader.. I have read into pbr a little, certainly still lack knowledge.. I'd love to hear an answer on that, or even better.. get an AO slot as you mentioned :)
    If somebody has a solution on how to add AO or what the nodes what look like I'd appreciate it.

    So basically it would mean masking the ambient light with the ao map, because ao shouldn't affect direct lighting, only ambient? If this is physically correct I think I got the nodes correct
  • Acegikmo
    It's a bit more complex than that, if you consider what constitutes as indirect light.

    Masked by Diffuse AO:
    Diffuse IBL, Ambient lighting, Indirect lightmap light, Light probes

    Masked by Specular AO:
    Specular IBL


    Right now there are no nodes for doing lightmaps and/or light probes though
  • Cay
    Offline / Send Message
    Cay polycounter lvl 5
    thanks for the quick answer!
    Yeah I might fake it for now... I'm thinking about using pbr in our (school) project, which is basically a scifi/cyberpunk environment
  • Acegikmo
    Here's a new feature coming in 0.34:

    Quickpick.gif
  • inanimate
    Is it possible to offset the uv coordinates of a texture but disable tiling, so only a single version of the texture appears? I am trying to create an effect somewhat like decals but within a single shader, ie placing logos on different parts of a shirt.
  • Acegikmo
    You should do it by setting the texture's wrapping mode to Clamp rather than Wrap, and make sure the borders aren't bleeding unwanted pixels out into the outer areas.

    This may not always be possible (due to mipping etc), so in that case you can make a mask that replaces whatever is outside the 0 to 1 UV range
  • Acegikmo
    Shader Forge Beta 0.34 is now released!
    • All nodes can now be created with hotkeys using a new quick-select menu!
    - Holding a letter on the keyboard will display a menu of all nodes starting with that letter
    - Scrolling the mouse wheel will move you through the list
    - Clicking will create the highlighted node
    • Fixed a bug where you couldn't use some vectors in the alpha clip input
    • Fixed an issue where deferred pre-pass shaders didn't handle gloss values of zero properly
    • Fixed a bug where you couldn't use the light direction node in the outline color input
    • Fixed a bug where fog didn't work on deferred pre-pass shaders
    • Fixed a bug where shaders using UV coordinates didn't compile on the PS Vita
    • Potentially fixed a bug where your locale would make shaders write commas as decimal separators rather than periods

    Quickpick.gif
  • frmdbl
    Offline / Send Message
    frmdbl polycounter
    Just bought it, tested it before and loved it.

    BTW Am I free to redistribute the shaders made in SF (eg. sell assets that use them)?
  • Acegikmo
    Yep! Would appreciate a mention of Shader Forge in the asset description though :)
  • Artic
    Offline / Send Message
    Artic polycounter lvl 7
    Is it possible to make a wireframe material?
  • Acegikmo
    Nope. It's pretty much impossible, even when writing shaders by hand :)
  • Zugzug
    Offline / Send Message
    Zugzug polycounter lvl 5
    Artic, you could make a texture that fakes the wireframe.
  • Crylar
    Offline / Send Message
    Crylar polycounter lvl 18
    I seem to only be able to light my shader with up to 3 lights. Adding a forth and the light that was added third stops working.
    Is there a way to be able to use any number of lights? Maybe I've missed something? <.<
  • Acegikmo
    That's a limitation of forward rendering. The light count can be controlled in the quality settings of your project.

    If you enable deferred rendering in Shader Forge (and your camera/project), you'll be able to use a ton of lights, with the downside of not having as flexible/accurate shading.
  • Crylar
    Offline / Send Message
    Crylar polycounter lvl 18
    Ok perfect. Thanks! =)
1131416181921
Sign In or Register to comment.