Home Unity Store

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

13468921

Replies

  • Acegikmo
    Thansks for the feedback! Pretty much all of the issues mentioned are planned! They are a bit low-priority, as interface intricacies and convenience functions are usually things that pop up after every new feature, so I kinda want to implement as many features as possible before polishing stuff. The primary goal of the alpha is to reach feature complete, and then after focus on making sure everything is super slick :)

    That said, I can prioritize them for the next version!

    Also, I would prefer to have these in the UserEcho forum, so there's a centralized place to keep track of all these suggestions!
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    9f6BTfD.jpg

    In CG, it looks like your shader is doing this:
    float CSLM(float3 N, float3 L, float S)
    {
    //S = simplicity
    //NoL because it looks like your 3vector (0,0,1) is just a normal vector.
    float NoL = dot(N,L);
    //don't know what ceiling value you've chosen.
    float CSLM_A = S / ceil( min, S * NoL);
    //i'm guessing you're clamping at 0 - 1, but that's your call. also don't know what's being multiplied in.
    return clamp(CSLM_A, min,max) * something;
    }
    
    

    so, from what i can see, the only node you can't do is the ceiling node? other than that, they should all be possible.
  • Acegikmo
    Quick Question: I'm trying to re-create a simple custom lighting model as I have done previously in UDK:

    http://i.imgur.com/9f6BTfD.jpg

    However I'm unable to reproduce it properly in shaderforge. I don't really know what to do with the 'Half Dir' part of the shader. Can you explain how I would reproduce this in SF?

    I suppose UDK interprets the 0,0,1 as the surface normal, so replace that with a Normal Dir node. The Half Dir is just a vector used when doing Blinn-Phong specularity, so if you don't want that you can just remove it!
    There's no constant clamp node yet though, but you can use a min and a max node after eachother to simulate it for now :)
    so, from what i can see, the only node you can't do is the ceiling node? other than that, they should all be possible.

    There is a ceiling node in SF as well :) It just rounds up to the nearest integer
  • Zugzug
    Offline / Send Message
    Zugzug polycounter lvl 5
    Hey Ace, this is turning out really cool and can't wait to add new items to the shader I'm working on. I just opened the shader in mono dev to see how you were handling the multiple lights and wanted to see if you were using a lerp to blend the lights on each other. I was wondering if there's a really big difference in performance and if you used a lerp instead of an if else?


    Here is part of the shader for the lerp to work:

    half3 fragmentToLightSource = _WorldSpaceLightPos0.xyz - posWorld.xyz;

    o.lightDirection = fixed4(
    normalize( lerp(_WorldSpaceLightPos0.xyz , fragmentToLightSource, _WorldSpaceLightPos0.w) ),
    lerp(1.0 , 1.0/length(fragmentToLightSource), _WorldSpaceLightPos0.w)
    );
  • Zugzug
    Offline / Send Message
    Zugzug polycounter lvl 5
    Sorry this is a little messy, but here is a planet shader i wiped up today.
    Earth-shader-01.JPG
    Earth-shader-02.JPG
    Earth.JPG
  • Acegikmo
    0.08 is now out! Here's a changelog:

    progress_a008_parallax.jpg

    @ZugZug: That may be faster yeah! I should try that out, thanks :) Also, great work on the shader :D
  • Ehsan Gamer
    Offline / Send Message
    Ehsan Gamer polycounter lvl 6
    Nice release.
    I have parameters save problem even after I compile the shader. they get reset when I close and reopen the editor one by one.

    Also I still have tex2D move problem
  • Zugzug
    Offline / Send Message
    Zugzug polycounter lvl 5
    np Ace, glad that could help with performance, and here is a vid of the planet shader.

    https://vimeo.com/74787460
  • Acegikmo
    Nice release.
    I have parameters save problem even after I compile the shader. they get reset when I close and reopen the editor one by one.

    Also I still have tex2D move problem

    Are you able to test it on Unity 4.2? I think the dragging is related to a missing method that was new there, and null references have a tendency to cascade into other issues/bugs. Would be great if you could check if it still breaks on 4.2 :)
    Zugzug wrote: »
    np Ace, glad that could help with performance, and here is a vid of the planet shader.

    https://vimeo.com/74787460

    Looks nice :)
  • McWild
    This is utterly fantastic, thanks for letting us in on the development of this. Has anyone had any luck with creating an outline shader?

    edit: How do I ensure that my shader is being saved? Does it save on compile? Because it seems to be forgetting to save quite a bit and I wind up re-doing a lot of my work.
  • Urre
    I threw together a PBR shader in Shader Forge, thanks to the custom lighting functionality. Based on this here code. Here are some example results:

    PBRtest.jpg

    The node graph is a bit too big to show in screenshots :P
  • Paniku
    Hey, loving this tool so far. Created quite a few little shaders, can't wait until you finally polish and release it!

    Question though. I'm trying to replicate the effect you show in the first screenshot of your post with the alpha clipping. How exactly did you do that? I can put a clouds texture in and hook up R to the alpha clipping, but the clipping stays static ofcourse. What nodes were used to modify it over time?
  • Acegikmo
    McWild wrote: »
    This is utterly fantastic, thanks for letting us in on the development of this. Has anyone had any luck with creating an outline shader?

    edit: How do I ensure that my shader is being saved? Does it save on compile? Because it seems to be forgetting to save quite a bit and I wind up re-doing a lot of my work.

    Currently it isn't possible to make an outline shader, because it requires an additional custom pass, which SF currently doesn't support. I might add a special output to control outline width and color though :)

    And yes, it saves when it compiles!
  • rahuxx
    where can we find tutorials for this tool?
  • Acegikmo
    There are no tutorials at the moment, but you can take a look at the screenshots in the first post, or the included example shaders!
    There will be tutorials on release, but right now it's only an alpha :)
  • parallel
    Offline / Send Message
    parallel polycounter lvl 3
    Acegikmo wrote: »
    I might add a special output to control outline width and color though :)
    Yes!
  • Acegikmo
    Alpha 0.09 is now out!

    progress_a009_refraction.jpg
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    dude, ur amazing! And fast! I'm impressed!
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    Awesome work getting refraction in there. it always surprised me that they left that out of Unity Free when you can just write the shader for it yourself haha.
  • Anadin
    Offline / Send Message
    Anadin polycounter lvl 3
    That looks awesome - great new set of nodes!
  • Acegikmo
    Thanks :)
    Awesome work getting refraction in there. it always surprised me that they left that out of Unity Free when you can just write the shader for it yourself haha.

    Refraction still won't work in Unity free. It may work in the editor, but when you make a build, or perhaps even press play, it will most likely stop working again. This is all because Unity free doesn't support Render Textures, but I'm forcing RTs to be enabled in SF in order to make the node previews and the 3D preview work, which in turn makes shaders using RTs work as well. (But only in the editor, as far as I know!)
  • Paniku
    I imagine you haven't thought about it yet, but how much do you expect to put this up for on the Asset Store? Nice shader editors are pretty much an untapped goldmine for Unity (and, even in alpha, this editor shaping up to be AMAZING).

    Also, I hate to feel like I'm nagging but I'm really curious as to how you achieved this withering effect: shaderforge_dissolve.gif

    I can get a static result from simply hooking a clouds texture to the alpha clipping, but I'm very curious as to how you adjust the effect with a slider.
  • 2cat
    Offline / Send Message
    2cat polycounter lvl 5
    Paniku, I'm not sure about how it's done in shaderforge, but the clipping can be done pretty simply.

    This is used in a surface shader btw. Dragging the slider creates a cutoff effect.
    half a = tex.a;
    if ( a > _Cutoff ) 
    { 
    	o.Alpha = 1.0; 
    } 
    else 
    { 
    	o.Alpha = 0.0; 
    }
    

    I'm just an amateur but it looks exactly the same minus the glowing around the edges.
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    looks like you're just multiplying the alphas cutoff value and the glow mask by the slider?
  • Zoid
    Offline / Send Message
    Zoid polycounter lvl 14
  • SOULSSHINE
    HI THERE ! IM VERY INTERESTED IN SIGN IN FOR THE ALPHA !

    COntact-me at SoulsShineOnline@gmail.com

    Thanks.

    SOULSSTUDIO ADMIN
    http://soulsshine.deviantart.com
    http://soulsshine-unity.deviantart.com
  • Acegikmo
    Paniku wrote: »
    I imagine you haven't thought about it yet, but how much do you expect to put this up for on the Asset Store? Nice shader editors are pretty much an untapped goldmine for Unity (and, even in alpha, this editor shaping up to be AMAZING).

    Also, I hate to feel like I'm nagging but I'm really curious as to how you achieved this withering effect: https://dl.dropboxusercontent.com/u/99714/Unity%20Projects/Shader%20Forge/Screenshots/Misc/Animated/shaderforge_dissolve.gif

    I can get a static result from simply hooking a clouds texture to the alpha clipping, but I'm very curious as to how you adjust the effect with a slider.

    I have thought about it, and I suspect somewhere in the $60-$100 range, depending on the quality of the product on release :)

    Also, I used the cloud texture and just had the slider add a value to it, just like others have mentioned already!
  • glynnsmith
    Offline / Send Message
    glynnsmith polycounter lvl 17
    Aw yeah :D

    Excellent stuff Acegikmo.
  • Bug
    It would be possible to get out of the box shadows as an option with a light specification for unlit sufrfaces.

    This would work well with in many circumstances where you have a Complete map as a texture, an unlit shader, but you still want to multiply that complete pass with a shadow pass. Without having to calculate light information such as diffuse, specular and all.
  • Acegikmo
    Bug wrote: »
    It would be possible to get out of the box shadows as an option with a light specification for unlit sufrfaces.

    This would work well with in many circumstances where you have a Complete map as a texture, an unlit shader, but you still want to multiply that complete pass with a shadow pass. Without having to calculate light information such as diffuse, specular and all.

    Yes, multiply your Emissive with the "Light Attenuation" node, and you'll get shadows :)
  • Bug
    Acegikmo wrote: »
    Yes, multiply your Emissive with the "Light Attenuation" node, and you'll get shadows :)

    Excellent.
  • McWild
    Acegikmo wrote: »
    Currently it isn't possible to make an outline shader, because it requires an additional custom pass, which SF currently doesn't support. I might add a special output to control outline width and color though :)

    Oh my god that would be tremendous!

    edit: Wondering if there's a way to create a toon ramp shading effect with what's there currently.
  • Acegikmo
    McWild wrote: »
    edit: Wondering if there's a way to create a toon ramp shading effect with what's there currently.

    ToonRamp.jpg
  • McWild
    You, sir, are the wind beneath my wings :D
  • Acegikmo
    Alpha 0.10 is now out :)

    progress_a010_multiselect.jpg
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    NVM... 0.10b fixed it. FANTASTIC work, keep it up!
  • Chaoss
    I've tried the alpha and this has to be one of the best shader node editors I've ever used, and I've used many.

    Please keep up the good work :)
  • Acegikmo
    Thanks for the nice comments!
    Also, Alpha 0.11 is now out! Just one feature this time, but it's quite a big one

    progress_a011_lightmaps.jpg
  • DInusty
    Offline / Send Message
    DInusty polycounter lvl 17
    whoa very nice! thanks!
  • Ged
    Offline / Send Message
    Ged interpolator
  • solarnoise
    Offline / Send Message
    solarnoise polycounter lvl 3
    Has anyone tried making a wind animation shader?
  • Acegikmo
    solarnoise wrote: »
    Has anyone tried making a wind animation shader?

    It's not possible yet, as there's no vertex offset output.
    There will be one later though :)

    Edit:
    Alpha 0.11b is now out. Alpha 0.11 had a major issue where the shader didn't compile if you were using textures and didn't have a UV Coordinate node in your shader, this has now been fixed :)
  • solarnoise
    Offline / Send Message
    solarnoise polycounter lvl 3
    Acegikmo wrote: »
    It's not possible yet, as there's no vertex offset output.
    There will be one later though :)

    Edit:
    Alpha 0.11b is now out. Alpha 0.11 had a major issue where the shader didn't compile if you were using textures and didn't have a UV Coordinate node in your shader, this has now been fixed :)

    Ohh okay, I assumed you could use WorldPositionOffset for that, which is how it works in UDK. What's the difference?
  • Guedin
    Offline / Send Message
    Guedin polycounter lvl 11
    Acegikmo : You're a beast ! Thanks for your hard work, It's truly appreciated ;)
  • Acegikmo
    solarnoise wrote: »
    Ohh okay, I assumed you could use WorldPositionOffset for that, which is how it works in UDK. What's the difference?

    It's there, but it's not working yet!
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 11
    Damn man I didn't checked for a while but time I would need to create shaders for my current project is behind doors and I REALLY like what I see here! If beta-test still apply for me, I'm on it! :)
  • solarnoise
    Offline / Send Message
    solarnoise polycounter lvl 3
    Acegikmo wrote: »
    It's there, but it's not working yet!

    Ohh okay! Well, can't wait, the tool is looking fantastic.
  • Jeka
    Hi ! Stuff is awesome so far. Can you add some user input other than sliders ? like text box ...just to put actual volumes in. also it would be cool to enable support for lightprobes :) just asking :)
  • Shrike
    Offline / Send Message
    Shrike interpolator
    Love playing around with shaderforge so far

    Theres one thing causing me issues, Im not sure if im just being stupid, but
    glossyness seems out of relation

    When I use a Value for glossyness, 1 is really matte, 10 is like I have none, and 1000 really glossy, that is working out fine and looks good

    But when I use a map for glossyness, It clearly dosnt use 1000 for black and 1 for white. Even when I make my glossyness map extremely white, there are still razor sharp reflections

    I just found a way, I need to mutiply my glossmap X 100 to get a metal value, on the preview it is pure white, but somehow it works more or less as expected, but If I wanted a glossy definition, I had to mutiply X 1000 and that destroys the bitmap so hard obviously that you see pixels and broken color values

    Well maybe have a look at it, just wanted to say that , also If you try to open a shader not over shaderforge but through unity , SF crashes and I have to restart unity

    Love it however, really nice!

    Just cant get around what most things do, but im really new to this.

    Can someone enlighten me how I can mask my cubemap with one of my greyscale maps, so its not everywhere reflective, because apparently Im not really smart today >.>
  • Acegikmo
    Jeka wrote: »
    Hi ! Stuff is awesome so far. Can you add some user input other than sliders ? like text box ...just to put actual volumes in. also it would be cool to enable support for lightprobes :) just asking :)

    Thanks!
    Box commenting is a planned feature! We'll see about lightprobes, but I don't think it should be much of an issue, but it is a low priority at the moment.
    Shrike wrote: »
    Love playing around with shaderforge so far

    Theres one thing causing me issues, Im not sure if im just being stupid, but
    glossyness seems out of relation



    When you control the gloss slider in Unity's builtin shaders, you're sliding between 0.01 and 1. In the shader code, for all Unity's built-in shaders, it then multiplies that value with 128, which means the glossiness in Unity is between 1.28 and 128, which is probably why you got similar results with multiplying by 100 :)

    So, your textures always contain values between 0 and 1, and glossiness is essentially an exponent applied to your specular reflection.
    When you put the texture directly into the gloss, your gloss is between 0 and 1, which is to be avoided, since it is an exponent. So, what you can do is to multiply your gloss map by some value, and then add 1.

    You usually want to have the gloss at 1 minimum, to some upper limit, depending on the material you're creating.
    Shrike wrote: »
    Can someone enlighten me how I can mask my cubemap with one of my greyscale maps, so its not everywhere reflective, because apparently Im not really smart today >.>

    Multiply the cubemap with your grayscale, and it should be masked :)
13468921
Sign In or Register to comment.