Search Unity

Strumpy Shader Editor [Now Open Source]

Discussion in 'Works In Progress - Archive' started by Tim-C, Aug 2, 2010.

  1. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    Bleh, now you're just teasing us cause we have to wait a few days until you release the next version :)
     
  2. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Nice, I've been wanting to move multiple nodes together.
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    $tooltips.png

    Texel just implemented tooltips for every node that exists... super effort! This should help out ;)
     
  4. Westmark

    Westmark

    Joined:
    Nov 1, 2009
    Posts:
    187
    Super sweet :D
     
  5. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Click for bigger.


    Here is a custom lighting graph I just put together... it's not very custom because it's just the default lighting calculation :p
     
  6. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Amazing! That sounds incredibley useful. Could you use that part for doing fake SSS for a skin shader ?
     
  7. seon

    seon

    Joined:
    Jan 10, 2007
    Posts:
    1,441
    I am a shader newbie, though seem to be able to understand written shaders better than understanding them in node space... must be the coder in me!!!

    Though I am only just starting to use this shader editor to make shaders... New shaders seem to be easier to make (I am finding) than re-making old broken shaders.

    Take the old "Alpha/vertexLit Colored"

    Code (csharp):
    1. Shader "Alpha/VertexLit Colored" {
    2. Properties {
    3.     _Color ("Main Color", Color) = (1,1,1,1)
    4.     _SpecColor ("Spec Color", Color) = (1,1,1,0)
    5.     _Emission ("Emmisive Color", Color) = (0,0,0,0)
    6.     _Shininess ("Shininess", Range (0.01, 1)) = 0.7
    7.     _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    8. }
    9.  
    10. SubShader {
    11.     ZWrite Off
    12.     Alphatest Greater 0
    13.     Tags {Queue=Transparent}
    14.     Blend SrcAlpha OneMinusSrcAlpha
    15.     ColorMask RGB
    16.     Pass {
    17.         Material {
    18.             Shininess [_Shininess]
    19.             Specular [_SpecColor]
    20.             Emission [_Emission]    
    21.         }
    22.         ColorMaterial AmbientAndDiffuse
    23.         Lighting On
    24.         SeparateSpecular On
    25.         SetTexture [_MainTex] {
    26.             Combine texture * primary, texture * primary
    27.         }
    28.         SetTexture [_MainTex] {
    29.             constantColor [_Color]
    30.             Combine previous * constant DOUBLE, previous * constant
    31.         }
    32.     }
    33. }
    I have my basic channels in place, but cant seem to figure out how to do teh:-

    Code (csharp):
    1. Blend SrcAlpha OneMinusSrcAlpha
    and
    Code (csharp):
    1. ColorMask RGB
    Nor can I work out exactly how the Combines take place.

    I have scanned through the nodes but cant seem to find out about the Blend other than the standard Splat and W channel...

    Can anyone offer any help?
     
  8. Chacek

    Chacek

    Joined:
    Nov 10, 2010
    Posts:
    5
    Hello. I have a question. Is any possible to set specular not in position where the sun's rays are falling, but in negative position (where sun's rays is come from). It could help me very much.
     
  9. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    any update on Beta 3?
     
  10. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    It's done! I'll be putting together a release this afternoon, after just doing some extra bug checking / checking that it works properly on windows.

    ;)
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    Awesome! Btw, what are your plans for when the shader editor gets out of beta?
     
  12. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Looking forward to the B3 / Next release :)
     
  13. maxfax2009

    maxfax2009

    Joined:
    Feb 4, 2009
    Posts:
    410
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    Small bug to report (in beta 2.2, maybe it's already fixed for 3)

    When you change a range Min and Max value, the values don't change for the menu you get when clicking on the preview (even with clicking update shader) and for them to get updated there you have to click "reset inputs to Defaults", which is kind of... unintuitive
     
  15. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    @Seon - I'm busy packaging / getting 3.0 together. I'll respond to this in a few days. Too busy atm.
     
  16. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Keep maintaining the shader editor as unity move forward and change their engine. Might write a package of shaders graphs that can be purchased from the new unitystore. Might write some new middleware (I have some great ideas) ;)

    All I know is that I intend to keep the shader editor free for users. I may ask for some paypal donations to help cover my costs (Unity pro / iphone / visual studio / resharper really add up in cost!), and if you are a big company making lots of money by leveraging this software that is not an unreasonable request I don't think.

    Other then that I really want to get back to a game project I have had on the back-burner whilst writing this editor (my avatar is a concept image from that game).
     
  17. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Fully agree, work of others that saves time is always worth donations ... no idea how much I donated over the past years actually, sometimes cause something helped me, sometimes cause I thought that outstanding work of community members just deserved some push :)
     
  18. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    This won't be fixed for beta 3. We had to make a decision when doing a node update / changing a default value. If we reset this to the default, then textures ect would also reset to the default. We choose to have the preview be the preview for the current configured preview settings.

    We may rework this in the future, but it won't be for beta 3.0
     
  19. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    I would love to donate, I just saw Shader Fusion and thought "wow this looks awesome, but I don't think it's 100 bones awesome"

    I would gladly donate to this, fits my budget and I know I'm helping the community and one of its contributors!
     
  20. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The funny thing is I was preparing to offer the devs of both shader graphing tools a larger donation if they consider working together to push it forward as they both have benefits that would fit the "other side" making it a stronger combined effort ... unhappily with the move to commercial, Shaderfusion killed that out.
    Good for the team here as it means that they will get more "for themself", as this editor here is more solid technically.

    All it needs is some productivity enhancement like preview of the state on the node directly instead of only at the end, visual representation of the data provided by a node and alike and the possibility to work with Shader LODs and Fallbacks. And then naturally the big wish that likely everyone has at some point: hierarchical shader nodes (ie reduce a group of nodes to a single super node with input and output) and store these as node templates that can be used in other graphs ;)

    But beyond that there is only "more and more nodes" left and precreated graphs
     
  21. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I have donated over £1,000 in the last couple of years just on projects I found use from, so do add a donate button :]
     
  22. maxfax2009

    maxfax2009

    Joined:
    Feb 4, 2009
    Posts:
    410
    This is a GREAT tool - donations - let me know when you are taking donations :)

    GREAT job stramit :)
     
  23. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Thanks ;) But don't forget Texel, he's a totally awesome dude to work with and has done a serious amount of work!
     
  24. QuantumCalzone

    QuantumCalzone

    Joined:
    Jan 9, 2010
    Posts:
    262
    Wow, this is really cool and extremely useful. Great job!
     
  25. Clamps

    Clamps

    Joined:
    Nov 7, 2009
    Posts:
    220
    Yeah... Half of the projects I've seen around here wouldn't happen without Texel's help.
     
  26. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    It's true, he's like Chief O'Brian.
     
  27. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Beta 3.0
    You were patient, and now it's here... the most powerful node based shader editor available for Unity 3! This is a mega release and we are really proud of all the new features we have managed to add.



    Contributers
    Stramit
    Texel

    Documentation
    Remember to check out Texel's documentation here.

    Donation
    This project is free for all members of the community. If you are a big studio, or really enjoy using the Shader Editor and would like to donate towards the project we would really appreciate that, the cost of software purchases needed to make this has added up. You can donate via paypal by clicking here.

    Download
    Click the link at the bottom of the post to download.

    Upgrading Notes
    Please back up all of your graph files before upgrading. Graphs from Strumpy Shader Editor 2.2 should be compatible with 3.0 with no modification. If this is not the case contact us immediately either via this thread or PM. Please include a copy of the graph. We do not foresee any issues though.

    Features
    Rework of windowing system / node selection:
    We were not happy with how unity was handling our windows. There was some performance issues, and they did not support multi-select. So we rewrote the windowing system from scratch, and it's easier and more intuitive to use. We also kept the layout the same when we did this, so it will still feel just like using 2.2!
    • Shift + Left Click now allows for multiple nodes to be selected
    • Alt + Left click or Middle mouse button is now used to pan the graph (Scrollbars have been removed)
    • Clicking a group of selected nodes allows dragging

    Vertex Shader Modification:
    So you want to modify the vertex information before it gets passed into the pixel shader? Sure! By switching the graph into vertex editing mode you can now modify the vertex shader. There are a host of new nodes associated with this, check out the vertex menu in the right click context menu for a rundown.


    Simple Custom Lighting:
    Unity 3 has two possible ways to render a scene either by deferred rendering or forward rendering. Unity supports custom lighting for both these models, and for Beta 3.0 of the shader editor we have rolled support for custom lighting. The custom lighting that we support delegates all lighting calls to the light prepass function, and this function is scriptable. Using the light prepass has it's limitations, you can not use the light direction and it is relatively simplistic. If you wish to see how the default Strumpy Shader Editor lighting is calculated load the "DefaultLighting.sgraph" from the resources in that ship with the editor.


    Tooltips / In Editor Help
    Tooltips? A big feature? Wait till you see how much information we have crammed into each tooltip! Descriptions, suggestions for use! It really is a great addition and we hope that it helps you make the best shaders possible.


    Instruction Count / Shader complexity
    Every time you update a shader, the top left of the screen is now updated with an instruction count cost and the number of texture lookups. This will help you optimize your shaders for the best possible performance.

    New Nodes
    A host of new nodes have been added to the editor!
    • Parallax Node (Depth sampled offset)
    • Split Node
    • One Minus (Invert) Node
    • Merge Node
    • Luminosity Node
    • More

    Workflow Improvements
    Now supports 'Save' / 'Save As' / 'Export' / 'Export As'. After loading or saving or exporting a graph you can now use these buttons to quick save or quick export. You can now also drag and drop shader graph files onto the editor to quick load them. These improvements save time and effort and make shader iteration much quicker.

    Roadmap
    Beta 3.1 - 3.x
    • Bug Fixes
    • Advanced Lighting Sub Graph
    • Fallback Support
    • LOD Support
    • Node Usability Improvements

    Changelog:
    -Reworking node editor to not use unity windows
    -Support for sub-graphs added
    -New shader system / template to support multiple sub graphs
    -Vertex modification graph
    -Custom lighting graph
    -Rewrite popup menu from scratch to be it's own class (works via delegates)
    -Update new popup menu to look the same as the old menu
    -Ability to drag / drop graphs onto the editor
    -Add multi node select
    -Misc bug fixes
    -Input node names not allowed to collide between subgraphs
    -Fix sintime / costime for vertex / lighting graphs

    Asking for help with shaders
    If you need any help with the shader editor or shaders in general ask away here. We will help where we can!

    Bugs
    This is a very big release for us. So much code was refactored and tightened up, unfortunately it is still inevitable that some bugs have slipped though. If you run into any issues at all post in this thread. The more issues you report the more we can fix. We want this tool to be as usable as possible so any / all feedback is welcome!
     

    Attached Files:

    Last edited: Nov 27, 2010
  28. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    Awesome trying the new features now!

    My old graphs are all working properly so far.
     
  29. Westmark

    Westmark

    Joined:
    Nov 1, 2009
    Posts:
    187
    Super awesome :O :O :O
     
  30. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Ooooo how exciting! I look forward to downloading it when I get home.
     
  31. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    A lot of work has been put in this. Donate we must.
     
  32. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    wait is over today for me.

    thanks stramit.
     
  33. shinobu_siv

    shinobu_siv

    Joined:
    Oct 18, 2010
    Posts:
    11
    It looks tremendous!!!
     
  34. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    Wow, just opened it up and checked out a few things. Stramit and Texel, great job and thank you both so much for your hard work on this! :)
     
  35. loken

    loken

    Joined:
    Mar 25, 2009
    Posts:
    109
    Freakin awesome update guys! The tooltips really help.

    Still a bit of an idiot though with this stuff. I'm trying to write a skybox shader that can blend between 2 cubemaps. While the shader works just fine on any object, it does not work as a skybox material.

    Any hints? Is it even possible? I have no idea how skybox rendering is actually done in Unity. Was just hoping it'd sort of just work.

     
  36. Westmark

    Westmark

    Joined:
    Nov 1, 2009
    Posts:
    187
    I'm not sure, but i would suggest looking at the built in skybox shader to see if you can get some hints there :)
     
  37. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    just donated 10 dollars ! keep up the great work !
     
  38. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hows the iOS openGL 1.1 stuff work, is there fallback for this kind of thing?
     
  39. Clamps

    Clamps

    Joined:
    Nov 7, 2009
    Posts:
    220
    Freaking brilliant. And it's donationware too!
     
  40. floZone

    floZone

    Joined:
    Jan 25, 2009
    Posts:
    19
    This is really cool, thanks so much for all you efforts ! Amazing work !

    Quick question, is the shader output iPhone compatible ? I run a shaderModel2.0 compile, works great in the viewport emulation but on device it doesn`t seem to work. I`m not on pro licenses in case that`s an issue ....
     
  41. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    You sir, are Win. Donations will be made in the very soon future (after payday :D)
     
  42. IncomeCountry

    IncomeCountry

    Joined:
    Aug 4, 2010
    Posts:
    5
    donated 20 dollars! please keep up your great works for everyone :D
     
  43. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    Getting this:
    "Shader error in 'ShaderEditor/EditorShaderCache': Program 'vert_surf', output semantic attribute "TEXCOORD" has too big of a numeric index (8) at line 161"

    In 3.0, not 3.1.

    edit: Told the shader to be transparent - problem fixed.
     

    Attached Files:

    Last edited: Nov 12, 2010
  44. Deleted User

    Deleted User

    Guest

    After creating a new graph, I get this:
    MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    StrumpyShaderEditor.PreviewNode.RenderPreview ()
    StrumpyShaderEditor.NodeEditor.Update (UnityEditor.EditorWindow parent)
    NodeEditorWindow.Update () (at Assets/Editor/ShaderEditorScripts/NodeEditorWindow.cs:27)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.


    and it no longer responds to commands.
     
  45. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    surface shaders are not supported at all there so you would write the fallback manually post export in shaderlab declarations (at least at the time, the plans for the future mention fallback support, potentially also to this leve, who knows)
     
    Last edited: Nov 12, 2010
  46. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    696
    Do you plan to upload (or at least submit) this into the Unity Assets Store?
     
  47. TheCheese

    TheCheese

    Joined:
    Nov 25, 2009
    Posts:
    82
    This is really, really awesome work. I just wish I knew how to use it...

    It's so great that so much work has been put into creating this tool to lower the barrier to entry for those of us who'd like to create unique effects in our projects.
    As a complete shader noob, though, I'm still lost as to what nodes / combinations of nodes produce what effects? Texel's documentation is a good start, but it would be a HUGE help if, as suggested earlier, there were a central repository of shader graphs (on the wiki, for example) or video tuts or something illustrating the basic concepts...

    This isn't a request to Stramit, but to anyone willing to lend a helping hand...

    Thanks!
     
  48. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    That is not good :[ I have never seen this issue before with the shader editor. I have attached a script to this post. Could you place it in the Assets/Editor directory. It will add an option to the Shader Editor menu with the name 'Graphis Info'. If you could take a screenshot of what appears in that window and post it here I might be able to help.

    Are you running unity pro or free? Are you in iPhone / Android or a console mode? Were you running your game application and then stopping it? Or were you just clicking 'new graph'?
     

    Attached Files:

  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    This shader editor is even better now... :) and i love how everything can moved with ease... quick question... is there a way to make a shader that simulates wet objects, or sweat?
     
  50. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Stramit, you're a lifesaver. With the shader editor, in four hours I was able to work through a complex shader that I've unsuccessfully been pounding on for months. A donation is on the way!

    I did find one bug with beta 3: I have a Sampler2D node with its default texture set to "normal," however, after exporting the shader its default switches back to "white". Its not a showstopper, I just have to make sure to always reset this parameter before exporting.