Search Unity

Strumpy Shader Editor [Now Open Source]

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

  1. Etana

    Etana

    Joined:
    Nov 26, 2010
    Posts:
    3
    I am trying to make a simple snow shader based on world normal direction, I got the easy part (worldnormal -> Split node's Y to arg3 of lerp node) but I have no idea how to make the snow falloff more random, it is only straight line which does not look very good to me.

    If some one could give me some hints I would appreciate that a lot.
     
  2. dangermouse

    dangermouse

    Joined:
    Nov 28, 2009
    Posts:
    73
    Thanks for reading my post. I'll explain in more detail, but please be aware the bulk of my shader knowledge come from Mental Ray, so I apologise if I've misunderstood something.

    I'm trying to make a very simple shader, I only want surface shading, not diffuse shading. Partly because of the look, largely for performance.

    So I plug a Zero constant into diffuse. Would be nice if diffuse could just be turned off.

    Now as soon as I plug my maintex into emission, my lightmaps fail to render. I understand that maintex is supposed to be in diffuse, and then the lightmaps work automatically as you've said. I just don't want any diffuse shading.

    So I take my maintex, add it to my rim shading, and plug it into emissive. Except for not being able to multiply it with my lightmaps, it looks perfect.

    So guess it comes down down to being able to disable channels (for performance), and have access to the lightmap textures in the event that your overriding what Unity attempts to do automatically. Incidentally, trying to access them from an input seems impossible at the moment because they're labelled unity_Lightmap, thus don't start with the underscore that SSE forces.

    At the moment, the only workaround I've got working is using the diffuse channel for my textures, and putting all of my geometry in a layer and masking it from all of my lights. This works, but is a bit of a pain, makes baking lighting annoying, and still seems to take about 10% longer to render, than my custom shading graph that seems to ignore the lightmaps.

    I know I've rambled a lot, but I feel these additions would be great for a variety of mobile based shaders.
     
  3. Cameron_SM

    Cameron_SM

    Joined:
    Jun 1, 2009
    Posts:
    915
    Dangermouse, doesn't unity come with a mobile-optimized Unlit light-mapped shader?

    Pretty sure I've seen one in one of the example packages before, it was just a simple fixed-function shader with all lighting disabled. Pretty sure one of the demos unity has on the apppstore even uses it.

    Trying to roll your own using the emission channel in SSE seems like a strange path to take on a quest for performance.
     
  4. dangermouse

    dangermouse

    Joined:
    Nov 28, 2009
    Posts:
    73
    You misunderstand. I'm not trying to just make a lightmapped shader. I have one already that I made myself, and still use a lot of the time. It has lighting turned off, and just returns unity_Lightmap*_Maintex and nothing else

    What I'm working on though is a rimshader that also takes vertex colour into account, and a few other shennanigans, for special objects in my gameworld. For that I've used SSE because I have NO idea how I'd do it myself. But currently SSE is forcing diffuse shading, and if I plug a constant into the diffuse channel, it breaks my lightmaps. I have to unlink all my lights to get it to even look right.

    Is there someething I'm misunderstanding? I apologise if there is.
     
  5. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    Hello ,

    I would like to add a new node to SSE to minimise my shader network. I saw an old post by Stramit saying that this is possible by implementing the 'Node" interface etc :

    Anyone know where the API docs are? I could not find any them anywhere in the package, strumpy.net or in this thread . Right now all the code for the nodes seems compiled into the "StrumpyShaderEditor.dll". I had a look at this assembly in the Monodevelop, however before stepping in to develop my own nodes, I would like to know if anyone knows if there are API somewhere docs or atleast one node implementation so i get the field markup right.

    cheers!
     
  6. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    I think that's for the next version if i'm not mistaken
     
  7. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    Wow, that's surprising. I found the first comment on the API on the first page of this thread. I read somewhere on this thread of a possible 'major rewrite' of the SSE, perhaps the API is changing as well.

    The docs would be welcome whenever they arrive. I must say though SSE is proving to be a lot of fun to play around with! Thanks for the good work Stramit Texel! :)
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yeah last time i heard it's being rewritten from scratch, So I guess we just wait for the next version since it could be different from the current version. I think...
     
  9. Svyatoslav

    Svyatoslav

    Joined:
    Sep 28, 2010
    Posts:
    8
    Truing to make fake SSS shader or something.

    Attempt with sss mask and ramp (in lighting graph), so it works in penumbra but not working in shadow.


    Is there any chance to get lighting ramp for full model, not only lighted part?


    Is it possible to see or get camera lighting (or shadow) pass?
     
  10. low_seb

    low_seb

    Joined:
    Jun 13, 2011
    Posts:
    76
    hello everywhere

    I tried to archieve a correct hair shader (not satisfied with the transparent or cutout built in shader)
    I have got for now a correct transparency but no normal or specular effect

    my shader

    transparent bumped specular

    and my graph


    thanks for viewing
     
  11. DaneC020

    DaneC020

    Joined:
    Mar 19, 2010
    Posts:
    191
    I am seeing the world position data coming in as several colors, so I tried adjusting the data and applying it as a mask. Then lerp the two textures together using that mask but the results are not what I expected.

    Is there any way I can debug the output of some of these nodes? And is there a way to break a node's connection without having to delete it?



    Another attempt. I inverted the position coming back from world data to make it a negative value. Then added the base height amount before the blending should begin and then took the absolute value of that.

    Example: If I wanted to blend at y = 100 or higher and Vertex y position is at 128.
    Abs(-128 + 100) = 28

    Then I passed this information to a Mask node and tell the Lerp function to blend based off that mask?



    Any help is appreciated.
    -Dane
     
    Last edited: Dec 24, 2011
  12. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    4.0b - Unity 3.5 Preview patch

    Just so you all know I am actively working on SSE 2.0 currently... It's going well but due to actually coding unity 3.5 being the most important thing on my schedule it's taking it's time... that being said it you want to use directional light maps with unity 3.5 and SSE shaders a minor patch is required. It just updates the shader template file but I'm shipping it as a full package. The rest of this post is a cut / paste of the 3.5a release. Feel free to skip to just the download if that's all you want.

    Contributers
    Stramit
    Texel

    Special Thanks
    Alex Chouls
    Sophie
    And the people that tested this (bugs and all) pre release.

    Documentation
    Remember to check out Texel's documentation here.
    Planet tutorial by Clamps here
    Also check out this new video on SSE Beta 4


    A scene made by warby, where the shaders were made in SSE

    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 this this post to download.

    Upgrading Notes
    Before upgrading please remove Strumpy Shader Editor 3.3x from your project. Back up / move any graphs you would like to keep before deleting SSE 3.3x.

    Please back up all of your graph files before upgrading. Graphs from Strumpy Shader Editor 3.3 should be compatible with 4.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.

    After you have upgraded to 4.0 it will be necessary to update the shader settings as they have changed between 3.3 and 4.0. These have changes so much that it was impossible to ensure complete backwards compatibility. Of note is that you should really check the depth write states, and the blending states of the loaded shader. These can be found in the 'setting' tab on the right pane.

    Features
    New Preview Window
    The preview window is now it's own entity. This allows for resizing and moving it onto a separate monitor.


    New Input / Property Configuration
    All inputs are now configured via the Input tab on the settings pane. This maps more closely with how unity handles properties. In this block define all the inputs you with to use (Use the ones under the unity tab if you want fallback shaders to work nicely). When you add a property node to a graph you now link it to one of these inputs rather then defining it in the node itself.


    New Settings Configuration
    Selecting settings from the master node of the pixel graph was getting a bit frustrating... especially if you normally work in the vertex or lighting graph... so we moved it to it's own location. It can be found as the third tab on the configuration toolbar.

    Node Menu
    We have also added a new menu which lists all nodes in SSE. If you can't find the node you are looking for this menu can be filtered. It also features handy tooltips explaining what each node does.


    Graph Map
    Sick of getting lost on very big graphs? We have added a map that shows where you are on a given graph! This map automatically pops up when you are panning around. We have found it very helpful!


    New Context Menu
    The old context menu was a bit frustrating to use, so we rewrote it. This menu is much easier to use and matches whichever OS you are on.


    Fallback Support
    If you specify a shader fallback it will be used (default is simple diffuse shader). In unity fallbacks work by the fallback shader having the same property names as those specified in the shader you are falling back from. To make this a bit easier in the Inputs tab we have predefined all the 'default' unity input names. We really recommend using these names if you want fallback to work properly!


    LOD Support
    This is a slider and is supported if you wish to have a LOD for your shader. Make sure you have a valid fallback specified!

    Massive Performance Enhancements:
    Fixes here and there have really added up. This should be the most performant version of the editor thus far. Especially with big graphs!

    Bug fixes
    *XBox 360 shaders should now be working properly
    *Numerous small fixes

    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
    It is inevitable that some bugs have slipped though the cracks for this release. 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!


    Procedural Lightening Created using Vertex Shaders in SSE
     

    Attached Files:

  13. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    Did you forget the download link or am I just missing it?
     
  14. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Fixed
     
  15. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Hey, it's possible to write nodes but i have not documented the API... mostly because during beta's 1/2/3/4 it was changing a lot between each release. I have attached some nodes from sse to this post so you can see how it is done if you want to reverse engineer and make some of your own. I'm not to happy with how nodes add code to the shaders in these, it's a bit clunky and ugly. It's the first thing I rewrote for the new version. That being said enjoy. As always the API may change ect, and you won't be able to share graphs with people that don't have your nodes.
     

    Attached Files:

  16. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    I'll respond to some of the shader specific questions tomorrow ;)
     
  17. DaneC020

    DaneC020

    Joined:
    Mar 19, 2010
    Posts:
    191
    Still working on it and I added the sgraph to the post for anyone interested in taking a look at it. Basically I am trying to make a terrain shader that will take several maps and blend them together based off of the Y value of the vertex. Right now just trying to get familiar with the shader editor and just get two of these textures blending.

    If you are curious why I am trying to do this, it is because I am working on a game that is using imported Mesh's for the terrain rather than Unity's terrain system.



    Thanks for all the help stramit!
    Dane
     

    Attached Files:

  18. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Thanks for the update Stramit. It would be great to see more graph setups (examples) included in future releases. Or perhaps, maybe user contributed ones (if people are interested in sharing).
     
  19. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    That's awesome Stramit , thanks. Looking at the nodes at first glance I think that's all that I need. To share my shader graphs, I think I can always attach an additional archive/unitypackage containing my node classes along with the sgraph. That 'should' work out, Even if it doesn't it beats hand-editing shaders to call my code after an SSE session.
     
  20. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Oh, this is nice. Thanks stramit.

    Well i guess now you can create a custom node then :D. Good Luck.
     
  21. low_seb

    low_seb

    Joined:
    Jun 13, 2011
    Posts:
    76
    thanks for the update ,great work
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    Damn... this won't work in 3.4 :(... and I really don't want to use a beta 3.5 of Unity
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    Damn... this won't work in 3.4 :(... and I really don't want to use a beta 3.5 of Unity... I am getting an error that says failed to import package...
     
  24. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    This may have been asked or answered already, but is it possible to edit already created shaders?

    I found a shader with some really cool effects, but I'd like to do a smooth transition between it and a normal defuse shader.

    Is this possible?

    Thanks.
     
  25. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    @Dreamcube017 : What SSE produces is just regular CG code , so yes u can edit them by manually editing the resultant ".shader" file. However blending between 2 shaders is difficult to do without involving some ugly state management in script . You haven't mentioned what this "shader with some really cool effects" does or if you have the .sgraph of this shader. So the question is a bit vague.

    In general the effect you're looking for maybe possible using the following approach:
    Assuming you have the shader network (sgraph) for your "really cool effects shader", you may very easily add a few nodes and create "normal diffuse" behavior in the same shader. All you need to do then is to Linear Interpolate ( lerp )/ smooth step between the two. Expose the Lerp amount as a shader parameter ( a float between 0.0 -1.0 ) .

    Have a look at the lerpcube.sgraph in strumpy shader examples . Instead of two cube maps you need to lerp between your exotic shader and diffuse.

    You can also make the transition effect time based. have a look at the time node in SSE or have a Unityscript/c# script set the lerp value of the shader from an update function.


    Hope this helps.
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    Has anyone had any luck getting the new version of SSE working in 3.4.2? I am trying to check this out and I can't even install it :(
     
  27. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    @Neptune_Imaging: If you want to use SSE with Unity 3.4.2 please use the previous version of SSE version. It's version 4.0a i think . The link should be posted in the forum somewhere.

    This last released version of SSE is a Unity 3.5 Preview patch. The only thing that it adds (according to the release notes) is support for directional light maps. If you're on 3.4.2 you wouldn't be able to use directional lightmaps anyways . So why upgrade? :)
    Stramit's being thorough in releasing the entire package instead of an small patch.

    As far as I see, that is all. Good luck sir!

    FYI: SSE Beta-4.0b seems to work correctly with Unity 3.5 beta.
     
  28. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    The only things in this update are for 3.5... so use the older one :)
     
  29. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Hi, you need to add some gloss in as well. You need both gloss (specular color) and specular (spec power) for a specular highlight.
     
  30. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Hi, you need to add some gloss in as well. You need both gloss (specular color) and specular (spec power) for a specular highlight.

    That zombie looks really cool also. Awesome work.
     
  31. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    If you are in deferred you get a 'light color' at that texel. This is what you normally use (the luminance of) for ramp lighting. What do you mean by 'full model' instead of 'lighted' part. For ramp lighting you need some illumination to do the texture look up..
     
  32. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    You have the right idea :) But some tips.

    You can break nodes using the right mouse button on the connection.

    You seem to only be interested in the y height, use a splat not to splat the y channel to to all components of the output vector.

    So you want to:

    -Take the world position
    -Splat Y
    -Figure out your max / min hight range
    -Minus the min height from the max height and divide the y value by this (this will give you a value from 0-1 with 0 being the 'lowest' and '1' being the highest.
    -Plug this into a lerp.

    Use some sliders to configure the max / min for the height so you can modify it in the material.
     
  33. e-freak

    e-freak

    Joined:
    Dec 30, 2011
    Posts:
    3
    Hey. I'm currently trying to build a lava shader for a small indie game/uni project and got all the other shaders we needed working with this amazing toolkit so far - thanks a lot.

    For the lava shader I wanted to get Flowmaps working, a technique that Alex Vlachos of Valve Software showed in his Siggraph paper (here: http://www.valvesoftware.com/publications/2010/siggraph2010_vlachos_waterflow.pdf).

    Now I'm running into a bit of trouble: My current setup looks like this:

    (Attached is my sgraph).

    Now, there's one thing I was wondering about logically and one issue I have technically:
    Logically:
    On the Assemble Node for the final UV field I'm trying to put in the input on the Y-Axis. But in the Assemble Node I had to set the Y Component to be X as well to work properly?

    But that's not an issue that stops me working right now.
    More of a problem is the Technical issue: Whenever I have a change of gradient in my flow texture I get a solid color outline that almost looks like a bad jpg compression around the area.

    Notice the border around the bars.
    I can't seem to get rid of them and since it happens with any kind of texture I think I can assume it's not any compression ugliness.
    Am I missing some shader logic here or is that just an issue I'll have to live with? I know this is not so much about the Shader Editor it self than more about general Shader logic but I hope some one knows a good answer to this or maybe even tried to do the same thing before.

    Thanks in advance!
     

    Attached Files:

  34. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    Thanks I'll give that a shot. Is there a way to cross between three or more textures? (With one of the textures being an animated png or gif)

    Also a request.

    Would it be possible to have the node description appear in a small window or make it so that it doesn't go away when the mouse is moved?
    I know that most people may not have a problem with this, but I use Windows Magnifire and the mouse has to be near the text in order to see it and if I move the mouse near the description, it goes away. It'd be cool to be able to at least hold a certain key down to make the description hang there and on releasing the key, it'd vanish.

    I tried just using the PDF, but the editor has a lot more nodes than are listed in the documentation.
    Again I know that most people probably don't need that, but I don't think it would be something hard to do.

    Thanks again.
     
    Last edited: Dec 31, 2011
  35. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    Alright, I've successfully created my multitexture shader. That lerp example really helped me out.

    Now the question is this. Is it possible to have a slider that changes multiple material channels at once? For example the deffuse and normal and specular? or do I have to make a slider for each channel?

    Here's my setup?


    Now see how just for the deffuse UI have two sliders. one slider from deffuse to deffuse2, and another for Deffuse2 to Deffuse3. Is it possible to create one slider that goes from 0 to 2 where 0 is 1, 1 is texture 2, and 2 is texture 3?

    Thanks.

    EDIT:
    Is it possible to do something like this with a shader?

    http://screencast.com/t/sEbyJGaSv1v

    Maybe not as detailed, but at least something where it sort of looks like the buildings are rising up?

    Is there some kind of clip object I can use to totally hid the buildings from view? Thanks.

    ONE LAST EDIT I PROMISE!

    Earlier I was asking not if I could use the nodes and make them normal ShaderLab code, but if I could take normal code and turn them into nodes.

    I found a particle shader that had a really nice glowing effect on some objects I had, and I'd like to transition from that glowing effect to a solid object.

    It was of some buildings with lights on them. With the particle shader, the lights were seen, but the rest was transparent. I think it had to do with how bright the image was. brighter parts were more visible. This made for a really cool effect, but I'd like to transition from that to the normal deffuse texture. If this shader could be turned into nodes, I could probably edit it.
     
    Last edited: Jan 1, 2012
  36. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99

    et viola :
    $crazylerp.png

    Not sure how to affect this in SSE. There is a clip example in SSE examples, might be a good starting point. I remember that I saw someone post a rather nifty cutaway shader in the Unity Forum that uses a clipping plane and fills in interior edges. He had not done it in SSE however. For the life of me I can't seem to find out the said post :(

    Sorry I don't think I get you there. In such cases please post the relevant shader so that people have a clear idea of what you wish to achieve using SSE.

    There is no 'magic button' that translates shader code --> SSE nodes. Have a look at the logic and do the math using SSE. That's all there is to it. For now I'd suggest more experiments at your end with SSE. Good luck.

    ps : It's Diffuse, not Deffuse :)
     
  37. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    Cool grills! I've got the nodes working so that one slider controls everything including normal Diffuse, and specular maps. Another one for Gloss. Thanks a lot!

    Wow that clip shader is pretty cool. Trying to figure out how to get some different effects in it. I'll keep messing around with it a bit more before I ask about it. I'll see if I can figure it out. These examples are really helpful.

    Also just thought of where Node Descriptiosn could go. Instead of just having a comment and settings options in the Node tab, why not have the description there too. As I satated, it is a bit hard to read with the Magnifire on and even though it's a request not everyone really cares about, I think it would be kind of useful and not TOO hard to manage.

    Thanks Stramit again for the great Editor. This really opens up some doors for me.
     
  38. Dreamcube017

    Dreamcube017

    Joined:
    Dec 20, 2009
    Posts:
    253
    Hey guys. I've gotten a nice clip shader that will work. The particle shader I'm wanting to use for effects is this one.

    Code (csharp):
    1.  
    2. Shader "Mobile/Particles/Additive Culled" {
    3. Properties {
    4.     _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
    5.     _MainTex ("Particle Texture", 2D) = "white" {}
    6. }
    7.  
    8. Category {
    9.     Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
    10.     Blend SrcAlpha One
    11.     AlphaTest Greater .01
    12.     ColorMask RGB
    13.     Cull Back Lighting Off ZWrite Off Fog { Mode Off }
    14.     BindChannels {
    15.         Bind "Color", color
    16.         Bind "Vertex", vertex
    17.         Bind "TexCoord", texcoord
    18.     }
    19.    
    20.     // ---- Dual texture cards
    21.     SubShader {
    22.         Pass {
    23.             SetTexture [_MainTex] {
    24.                 constantColor [_TintColor]
    25.                 combine constant * primary
    26.             }
    27.             SetTexture [_MainTex] {
    28.                 combine texture * previous DOUBLE
    29.             }
    30.         }
    31.     }
    32.    
    33.     // ---- Single texture cards (does not do color tint)
    34.     SubShader {
    35.         Pass {
    36.             SetTexture [_MainTex] {
    37.                 combine texture * primary
    38.             }
    39.         }
    40.     }
    41. }
    42. }
    43.  
    When placed on objects, it gives a transparent (or semitransprent) effect on objects. I'd like to lerp between that and a solid material. I'm looking on the shader about how to do this, but I'm still figuring things out.

    Also, I have a shader that can hold a maximum of nine textures,has some clipping effects (from the clip example) and I want to add the effect this particle shader gives. Would this on a multiple of objects be heavy for the game engine to handle? I mean it might work on my computer, but would others have problems with this? Thanks.

    Also how would you create a contrast slider?

    I'm guessing it has something to do with subtracting the dark colors while adding the lighter colors or something?

    I'm sorry for asking all th questions. Thanks again.
     
    Last edited: Jan 2, 2012
  39. AbyssStudios

    AbyssStudios

    Joined:
    Nov 24, 2011
    Posts:
    4
    So Im trying to create a shader that has wind effects that I can use on my trees and bushes

    I have created a float 4 for wind vector and speed and a float for wind strength

    is there a way to get world vertex postion and add to that and is there a way to use vertex color to control the wind effect

    and I guess a advance question would be is there a way to use the unity wind node to effect the shader

    btw the way as an artist awesome thanx so much for this tool
     
  40. ChaosWWW

    ChaosWWW

    Joined:
    Nov 25, 2009
    Posts:
    470
    Hey, this might be a stupid question that has been covered to death already in this thread, but I couldn't find it so here we go:

    I'm trying to make a shader with a custom lighting graph, and honestly the results were a lot simpler then I expected. I was able to implement everything I wanted with the diffuse pass, and the results were great. However, as soon as I added specular information, things got hairy.To do my custom lighting stuff, I multiplied the lighting stuff with the albedo, which worked.


    (For this example, I just plugged in the lightcolornode for simplicity. In actuality, that is more complicated).

    However, when I try to add specular information to my shader (typical layout of shininess = range and specular = main texture alpha * color) this happens:



    I don't want to do anything fancy with the specular, I just want it to act like it would on a default unity shader. How would I go about doing this?
     
  41. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    Did you solve your lighting issue? I just started diving into this too just to learn... thought about doing a shader similar to MvC3
     
  42. ChaosWWW

    ChaosWWW

    Joined:
    Nov 25, 2009
    Posts:
    470
    I've figured it out partially. Seems like the preview is wrong somehow because when I export it doesn't look weird like it does in my second image. The only problem is that specularity doesn't appear at all (like the bumped diffuse shader). The specular stuff in the pixel graph is still being calculated because I am multiplying it by my reflection and that aspect works, but the actual specularity itself doesn't. I'm assuming I have to calculate the specularity myself in the lighting graph.
     
  43. bb0x

    bb0x

    Joined:
    May 16, 2011
    Posts:
    70
    Strumpy, if you are reading this, or anybody else that knows the answer to the following questions... please help me =]

    Basically I have a cubemap. It works fine for hard/smooth, highly reflective materials like metals, plastics and what not. Now I want to use the exact same cubemap/textures but a lower mipmap level for a more blurry look for the "reflection" so it can be like fake GI on softer/rougher surfaces like skin or cloth. Is there anyway to do this with the current SSE or planned for SSE 2.0?

    I did search a bit but I think there is no way to force a certain mipmap level with Unity right now. Is this the case?

    If it is not possible, it isnt a huge problem as I can make an extra "blurred" cubemap for the softer materials. But it would have been nice to simply control it with the shader.

    Fatih
     
  44. Lord_Pall

    Lord_Pall

    Joined:
    Sep 25, 2009
    Posts:
    52
    So this might be user error, but I can't get this to work in the trial pro version of 3.5b6. When I import it and open the window I get:


    ReflectionTypeLoadException: The classes in the module cannot be loaded.
    System.Reflection.Assembly.GetTypes ()
    StrumpyShaderEditor.NodeEditor.<NodeEditor>m__3B (System.Reflection.Assembly s)
    System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[System.Reflection.Assembly,System.Type].MoveNext ()
    StrumpyShaderEditor.NodeEditor..ctor ()
    NodeEditorWindow..ctor ()
    UnityEditor.EditorWindow:GetWindow(Type)
    NodeEditorWindow:Init() (at Assets/StrumpyShaderEditor/Editor/Scripts/NodeEditorWindow.cs:9)


    Am I missing something? It's pro, under windows, but it's also a trial. I didn't think the trial disabled any aspects of the tool though.
     
  45. ChaosWWW

    ChaosWWW

    Joined:
    Nov 25, 2009
    Posts:
    470
    I figured out the solution to my problem (this is mostly directed at Neptune_Imaging who asked me about this).

    There is a preset shader graph called "default lighting" that displays how the typical lighting setup works. I'm thinking that if you want to do custom lighting stuff you should use that as a base and add stuff onto it. Also I would check out the RampLighting preset shader graph and merge it with the default lighting graph if you want a stylized approach like MvC3.

    For reference I took a screenshot of the default lighting graph, perhaps someone else will find it useful too.
     

    Attached Files:

    Last edited: Jan 9, 2012
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    This is good...I've been needing to play around in the lighting graph... and I will definitely play around and see what kind of effect I can get with this...

    EDIT: S***...now I have to play around with the default lighting stuff just to get this to work
     
    Last edited: Jan 10, 2012
  47. Gigablargh

    Gigablargh

    Joined:
    May 27, 2011
    Posts:
    28
    4.5b pinked all of the shaders in my game, most of which I made in Strumpy Shader editor. Is there a compatibility update?

    Update- Sorry, incompatible shaders was my first impression but turns out not to be the case. Unity 4.5b's project import is the problem. It nuked every single reference on every script on every object in my project- materials, prefabs, everything.
     
    Last edited: Jan 13, 2012
  48. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    What version of Unity3d are you running?
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    Hey stramit, I have a question for you... I was playing around with the Unity Pro demo and I was wondering if there is a way to get my models to reflect the environment in real time, such as in a render to texture... I just realized that I may end up having to code my models to load up cube maps for the level they are going to fight in, and I have masks in my Gloss textures that tell Unity where to allow the reflections to be... Isn't there a render texture node in SSE? Thanks a bunch :thumbs up:
     
  50. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    You can just use a regular texture node, and put the render texture into the input just like you would a regular texture.