Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Strumpy Shader Editor [Now Open Source]

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

  1. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    The thing is, the unity lighting is correct, apart from the naming of the two variables being confusing. This is the standard Blinn-Phong rendering model with additive specular on top standard light incident dot normal, and Lambertian limited specular taken into account via the multiplication of the the specular by the light color from the buffer which has already had lambertian scaling applied

    You listed this:
    Code (csharp):
    1.  
    2. ((Spec value ^(pow) Gloss value) * (Light vector ·(dot) Surface Normal)) + albedo
    3.  
    When this is not how specularity is performed in a photo realistic way, at least according to every paper I have seen on the topic (unless you intend 'spec value' to be dot( n, half).

    Standard blinn-phong shading is of the form (taken from real time rendering 3'rd edition):
    Code (csharp):
    1.  
    2. Output = (SurfaceDiffuseColor * dot( lightDir, normal) * LightColor) + SurfaceSpecColor * pow( dot( halfVector, normal ) ) * dot( lightDir, normal )
    3.  
    But it is very common to omit the scaling of the specular by the Lambertian term, unity does not do this though, it is passed via the dot( n, l) the light color.

    The problem is that when using deferred rendering individual shaders are 'locked out' of modifying HOW the lighting buffer is written. This means that for consistency between forward / deferred would be broken if I renamed these variables to 'roughness' and 'specular / power' as the prepass renderer expects there to be a specular value output from the shader.

    The best way to think of it is that 'gloss' is the multiplication of the specular highlight brightness with the specular highlight color, and that 'specular' is the specular power that is used for the raising of dot(n,h), i.e the sharpness of the specular falloff (this is a single float).

    Alternatively I could just in the graph display rename 'specular' to 'roughness' and 'gloss' to 'specular color'. That might clear some things up.

    Warby / Neptune_Imaging:
    Are you currently using forward rendering? If so there was a bug that I fixed after looking into this on specular in forward rendering. If your issues were with deferred then it's a bit more odd. Can you hook me up with some sample scenes and some descriptions on what you expect to see?
     
    Last edited: Feb 3, 2011
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    To break it down the specular term is:
    Code (csharp):
    1.  
    2. //Standard Blinn-Phong lighting
    3. viewDir = normalize(viewDir);
    4. half3 h = normalize (lightDir + viewDir);          
    5. float nh = max (0, dot (s.Normal, h));
    6.  
    7. //Raise the dotted half vector to the power of s.Specular
    8. //Use the master node 'specular' input to control the size of the
    9. //highlight. This is the same as a roughness paramater!
    10. float spec = pow (nh, s.Specular*128.0);
    11.  
    12. //Multiple spec by the light brightness
    13. //This is done because in deferred we only have
    14. //One channel for specular so we can't save color
    15. spec *= Luminance (_LightColor0.rgb);
    16.  
    17. //Now we create the colored spec
    18. //It is a combination of the specular intensity
    19. //The surface specular color
    20. //And then scaled by the light color (this will be precalculated (n dot l)
    21. //So to change the brightness / color of the specular highlight (not the size)
    22. //Modify the gloss paramater
    23. half3 spec = light.a * s.Gloss * light.rgb;
    24.  
     
  3. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    I don;t know what mode i am using... i haven't really put any scenes together for a game... my shader does exactly what it is being described...i just used a multiply node to control the shininess and i've gotten some good quality.... but i've had to overdrive the values to make it work... i am using i default white texture for these tests... on the first screenshot is my shader graph, and yes, when the values are 1 to 1, it looks very blown out with a flat white texture.

    I made my shader so that i could directly control my shading...and i do paint my spec and gloss maps meticulously so it forces me to overdrive my values...

    $Shader Graph.png $NI-Shader-1-1.jpg $NI-Shader-1-2.jpg $NI-Shader-1-3.jpg


     
    Last edited: Feb 3, 2011
  4. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    Unity free? then you are using forward! I'll PM you an updated shader template tonight to see if it helps with the specular.
     
    Last edited: Feb 3, 2011
  5. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    You are the man... :) and yes, I will happily donate... question though...is my shader graph expandable enough to add the ability for reflection and reflection masking? (using an alpha to render only reflective parts...)

    And is having an ALU of 54 good or bad?
     
  6. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    i was using forward because in deferred there seamed to be no specular at all but now that i think about it the values were probably just way too low i assumed that the same values would produce equally strong highlights ( or at least roughly the same ! )
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    Hey warby, I just sent you a PM, could you check it out and get back to me.
     
  8. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    i have ! :)
     
  9. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    thee is another thing i am wondering with all the custom shaders i build i always get this error message (see below) when baking beast lightmaps and i also was always a bit disjointed with beasts render results:

    so i did a little experiment and build a cornel box:



    http://warby.bitproll.de/projects/9999_wip/no_radiance.jpg BIG

    it seams beast needs to be able to read out a value called _Color in order to be bale to perform radiosity at all ! from the error message i would have figured that the bounces wont pickup the reflected color but apparently not even white light gets bounced off of custom shaders !
     
  10. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    this is a general question to everybody there is no way how i can use more than 2 uv sets in unity right ? the importer/lightmap uv generation thing always over writes the second one ( which i use for something else than lightmaps already) and the shader editor uv node also only as meshuv1 and meshuv2 out no way to get a third one ?!
     
  11. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    The way unity works with beast is that the beast bindings expect there to be shader paramaters with certain names, one of those paramaters is _color. When I'm designing shaders in SSE I normally name the paramaters the same as in the default unity shaders (i.e. MainTex, Color ect). This is so fallback is supported and beast binds nicely. Maybe in a future version of unity you will be able to manually specify beast bindings, I also have some ideas on how this could be better addressed. There is also some interesting handling of custom shaders with emissive but I can't remember the ruls off the top of my head.
     
  12. chaos1986

    chaos1986

    Joined:
    Mar 29, 2009
    Posts:
    230
    This is great, are you going to fix it so we can have working cubemaps? the current cubemap functionality doesn't seem to work at all
     
  13. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    645
    Hi Chaos,

    Cubemaps do work, they just take some different inputs and functions. I'm not sure if this one works exactly how I wanted it to, but you can at least use it as a starting point.

    Nathan
     

    Attached Files:

  14. chaos1986

    chaos1986

    Joined:
    Mar 29, 2009
    Posts:
    230
    thanks, actually I don't think what I want is actually possible in Unity, Ive seen it done somewhere before but can't quite put my finger on where.

    What i've been trying to do for the last week and a half (after the lightmapping conundrum which turned out to be a bad renderer) is have these windows reflect (a cubemap!) and be transparent at the same time, while being affected to a directional light and have real time shadows cast upon them, Basically for these windows (I want to be able to see into the bar)



    Ontop of that I want a transparent texture to define how transparent the window is, while AT THE SAME TIME displaying the same transparent texture on the window, I would also like to be able to add in an opacity map to control how shiny the window is (a black and white image), putting a none transparent texture for the window will make the window not transparent

    We will eventually hire someone to code some special shaders for the game, but for right now I need THIS shader, and using none-transparent windows is not going to cut it
     
  15. Steel Arm

    Steel Arm

    Joined:
    Dec 7, 2010
    Posts:
    50
    I am in need of some help with a shader... I want to write a shader that adjusts alpha per surface normal based on the angle between the normal and the camera position. In other words, when the camera is near the surface normal, the surface will be visible, but if the camera is near the poly's edge, it will not be visible. This is so faces that are edge-facing don't show up to the camera. The problem I'm having is, I haven't found anything in the editor indicating the camera's position in worldspace. Can someone give me any tips on how to do this?
     
  16. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    That's currently very possible to do in the shader editor, but it's quite an elaborate shader and I don't currently have the time to dedicate to making shaders of this size on request. What you want to do (to start with) is sample the cube from the reflection vector of the surface using the 'Vertex Reflection' node. In this example I have also made the alpha be based on an alpha from a texture and set the blend mode to be srcalpha / oneminussourcealpha (so you can configure the alpha from the texture), and also given the windows a 'blue' hint in the albedo. It's nothing amazing, but it's a decent start for some glass. You will need to set the queue to transparent if you want to use this shader also.
     

    Attached Files:

  17. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    There is a better way to do this using the view direction and the Fresnel node. If you load up the 'rimlighting' shader you will notice that the edge is 'brighter' then the rest (and plugged into emission). If you plug this into alpha you will have a shader that tapers at the edges. Play with the rimlighting shader to see what I mean.
     
  18. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    750
    Hi stramit, congratulations on your tool, it's amazing that it already has advantages on "that-other-node-based-shader-editor-that-charges-an-arm-and-a-leg-and-offers-no-support". Now a couple questions, sorry for not being able to skim over the *glup* 50 pages of this thread to find out if this has been discussed yet:

    1 - How do you set a parameter to scale up/down the normal map effect? Is it as simple as adding a multiply node before plugging to the normal result?

    2 - Can SSE help with setting specific surfaces to receive glow and making that take the surface base color as the glow color? I know that's mostly related to a screen pixel filter, I'm just asking it 'coz I've seen some screenshots from "that-other-node-yada-yada" showcasing that specific effect, so it got me curious.

    Thanks in advance, cheers!
     
  19. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    485
    Hi, first of all, this editor is awesome!! I never got into shader programming, and this is incredibly useful!!

    I got a question/problem though... I'm trying to make a transparent/specular/rim lighted/textured shader... Most of it is well documented and explained in the example shaders, and I've got almost everything working, but one thing is bugging me...

    I am taking the alpha channel from the texture's own alpha, and multiplying it by an opacity value (1.0 to 0.0), so I can have arbitrary control over the opacity as well as transparency from the texture... The texture transparency is thresholded by another constant value.

    The problem is that if I mark the shader as transparent, front-facing parts of the mesh that should be covered by parts in front become visible... If I unmark it as transparent, I get grey where it should be see-through...

    I saw in one of the examples (DepthBiasedAlpha), that it is possible to have a transparent shader without flagging it as transparent... but for me that just isn't working... it can't be video card related, since one shader works and the other one doesn't... Am I missing something?

    All of the shader parameters are pretty much default... Write Depth is on, all others are off... except for this transparency flag which I don't know whether to turn on or off...


    Any thoughts on this?

    Thanks in advance! this is a great addon! (really, it should be made part of unity)

    Cheers
     
    Last edited: Feb 10, 2011
  20. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    A normal map defines the surface normal at a point. What you are describing doesn't really make much sense. What do you mean by 'normal map effect'? One thing you could try is doing:

    Unpack the normal map
    Add that to a float4( 0.0, 0.0,1.0,0.0) that is multiplied by some scaling factor
    Renormalize (make sure you are only doing 3 component!)

    That will bias the normal towards the default vertex normal, reducing the normal effect. I'm still not 100% sure exactly what you mean though.

    It should work. I'm not totally familiar with the standard glow-effects in unity, but I believe they are based on the surface alpha output value. I'll do some more research tonight for you but it should 'just work' I believe.
     
    Last edited: Feb 10, 2011
  21. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    In the unity pipeline there is not much that you can do about this. This is due to the fact that when you render with transparent objects you are not writing to the z-buffer. Because of this ALL the triangles of the mesh will pass the z-buffer test and be rendered, even those that are behind other triangles.

    In games I have worked on we solved this by allowing for 'depth written transparency'. We would render the whole scene normally, then any object that required this 'special' processing would be rendered into the depth buffer and then blended with the back buffer. This would cull the behind triangles. It's nor easily possible in unity currently but I have not really looked into it. Many games actually have the issue you are describing.

    What kind of blending are you using? If you use additive (one,one) it should look 'okay' but you will be able to tell where elements are overlapping.
     
  22. pinkhair

    pinkhair

    Joined:
    Dec 17, 2010
    Posts:
    119
    Can you plug a three element vector directly into the normal or color input?
     
  23. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    You sure can. It will actually just take the .rgb/.xyz of the vector. The normals are expressed in tangent space so a normal of (0,0,1) is 'standard'.
     
  24. pinkhair

    pinkhair

    Joined:
    Dec 17, 2010
    Posts:
    119
    Ah, okay, the tangent space was what was confusing me- I guess I should have thought of that given that it works with tangent normal maps.


    Another question- is there a way to tell whether a point is being shaded by any lights currently, so I can have lightmapped areas use a texture with baked shading but use correct shading when a light hits them? Surfaces are looking pretty crap using just the lightmap shading and unlit textures so I was thinking I could create some occluded versions for those areas.
     
  25. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    No, not really. The surface shader model is used to describe surfaces, you can't really get any information at shading time as to whether a texel has light hitting it or not. If you were guaranteed to be only using deferred you could do something sneaky and apply a texture if the accumulated light value is below a certain threshold. But this would require a custom lighting shader of the likes that is not supported in SSE (i.e. you would need to write a totally custom lighting shader).
     
  26. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    Did some experimenting to validate this and it indeed does work (with one or two caveats). The in editor preview looks darker / fades to grey for opaque shaders if you specify alpha. This is a bug in the preview mechanism and will not be reflected in the actual scene. It is a 'non-trivial' fix and may not even be actually possible to fix with the limited access we get to the rendering pipeline.

    Another point of note is that all the transparent shaders from unity don't actually seem to write to alpha, they use colormask RGB. This means they won't contribute to glow. It's recommended that you follow this model as well. In my example I simple hooked a slider up to alpha (you could use a texture or anything) and then used that on an opaque material with colormask set to RGBA to make a configurable glow. Was pretty easy and looked great!
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    That sounds so cool Stramit... I am still trying to expand my shader and glow effects are pretty cool :)
     
  28. pinkhair

    pinkhair

    Joined:
    Dec 17, 2010
    Posts:
    119
    Ah well. Guess I'll try fading out the baked shading at the same distance realtime lights start effecting things.
     
  29. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    485
    I'm using normal (one,zero) blending... I tried blending to my own inverted alpha (one, oneMinusSrcAlpha), and it almost worked, except that there were visible holes in the model where the invisible parts 'upstaged' other parts... I don't think any special blending should be necessary though...

    The weird part is that I can't get any transparency to work well, not even in the preview window... If I understand correctly, one doesn't need to flag a shader as transparent in order to have it drawn transparent, right? since it's basically just a queue offset so you can see the stuff behind it...

    What I wanted to know was how is it possible that there are example shaders that don't have this problem, while mine does? both tested using the same mesh.

    Also, I haven't been able to use the clip channel... I'm probably missing something, but for me it's not having any effect... be the transparent flag on or off, it's the same (lack of) result...

    Cheers
     
  30. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    Could you post some screenshots / a picture of your graph / how it is setup (master node)? I can't really tell what would be up otherwise. If you want me to have a more indepth look export that part of your scene including the sgraph file and I'll have an in depth look.

    WRT clip: Things only get clipped when their value is below 0 (Have a look at the clip example graph). We minus by 0.5 to make the desired texels get clipped.
     
  31. Westmark

    Westmark

    Joined:
    Nov 1, 2009
    Posts:
    187
    Hey Stramit
    It seems all my shaders broker when I upgraded to unity 3.2 :( any news on a fix ? :)
     
  32. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    Oh no that's horrible... I have no idea what to do :(
     
  33. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    3.3a - Full Unity 3.2 support, bug fixes

    Unity 3.2 is now out. They have added to and also modified many aspects of shaderlab for this release and it has sadly made SSE 3.2 incompatible.... But never fear, the new version is here. It features full unity 3.2 support, fixes interface issues, and also has some bug fixes of it's own. If you are using unity 3.2 you NEED this upgrade for the shaders generated by SSE to work properly.

    Contributers
    Stramit
    Texel

    Documentation
    Remember to check out Texel's documentation here.
    Planet tutorial by Clamps here

    From Clamps' Planet Tutorial


    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.2x from your project. All of the shader editor files have been moved around and tidied up and it is important to have a clean work area. Back up / move any graphs you would like to keep before deleting SSE 3.2.

    Please back up all of your graph files before upgrading. Graphs from Strumpy Shader Editor 3.2 should be compatible with 3.2 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 3.3 it will be necessary to update the shader master node settings. 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. You should also assign a rendertype, in SSE 3.2 this is much more important.

    After updating / fixing the graph please reexport your shader. Shaderlab changed how the UnpackNormal function works and it takes different arguments now. This is handled behind the scenes in SSE but you still need to regenerate the .shader file. Any materials with this issue with show up as being pink.

    Features / Fixes
    Supports new unity 3.2 shaderlab subset
    This is a direct mapping to shaderlab.
    $Screen shot 2011-02-11 at 7.26.44 AM.png

    Support for:
    Render Type
    Improved Blending
    Exclude pass

    Bug fixes
    *Unpack normal / sample normal fixed for 3.2
    *Fix infinite loop regression
    *Update lighting template so that forward / deferred look closer in terms of illumination

    Roadmap
    Beta 3.x - 3.x
    • Advanced Lighting Sub Graph
    • Fallback Support
    • LOD Support

    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!

    Get 3.3b HERE instead... it's better!
     
    Last edited: Feb 11, 2011
  34. Westmark

    Westmark

    Joined:
    Nov 1, 2009
    Posts:
    187
    Seriously? or being sarcastic? :p

    Edit: HAHA :p

    Edit Edit: You are awesome as always :D
     
  35. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    485
    Oh wow, that was fast!!

    Gotta upgrade here... I saw the update popup this morning but was too lazy to download a new version...

    Hopefully these new features can solve my problem!

    Cheers
     
  36. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    small bug report:

    1) wrong tool tip is being displayed
    - click on the master node
    - go to the ztest buttons
    - hover your mouse cursor over one until its tool tip appears
    - move the mouse to the left or right to the next button to read its tool-tip
    - notice it shows you the same tool tip as the last button instead of the current one


    2)some of the sample graphs wont work (when i hit update it turns the preview sphere pink)
    -lerpcube
    -triplanar

    3) when loading an older graph write depth is not ticked by default (on purpose ?)
     
  37. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    This is out of our hands it's all handled by unity itself. We might be doing something wrong though. This issue has existed since we put tooltips in. Might have to try for a 'real' fix soon.

    I tested all the graphs on osx but not windows. This might be a windows only issue. I'll ahve a look tonight and fix it if needed.

    It's because of the way we upgraded the master node. We removed some (bad) inverse logic and it switched the depth write. In the upgrade notes I made mention of this. It needs to be checked per old graph.
     
    Last edited: Feb 10, 2011
  38. ZachGriffin

    ZachGriffin

    Joined:
    Apr 1, 2010
    Posts:
    49
    Hi Stramit,

    I've been looking for a guide as to what has changed in the SL pipeline and the internal directives with 3.2. I have quite a few handwritten shaders (Love your tool btw, but these are massively long) that won't compile. The errors are mainly about the tangent to world struct not actually being a struct (TtoW0). Any ideas on what this is caused by?
     
  39. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    485
    W00t! got it to work!!

    had to take a roundabout way to do it... but it works now!!

    instead of using the alpha channel, I'm using the grabSampler to get the "screen texture"... then I multiply the main texture color by the opacity value, and the screen background by 1-opacity... then I add them together, and lo! perfect transparency! and with the added bonus that lighting is preserved, so the object seems to be ghosted.

    Thanks for the new version!! (I know grabsampler isn't a new feature, but the new shader tags menu is so much more comprehensive I finally understood what was going on)

    Just for a sanity check, is 42 ALU instructions and 5 texture reads too much? only a few objects in the game will be using this shader.

    Cheers
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    This is a nice update... now i have a problem now where my clip shader is not working... it is a shader made to cut out parts of the texture...and with the new options, I have no idea what to set...
     
  41. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    clip should always work so long as the value is below 0 no matter what kind of shader it is.Could you test the example clip shader and tell me if that works and then try and emulate what it does for the clip paramater?
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    sure...hang on... i may have to modify it
     
  43. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    It worked on my end, but the masking on my shader is texture based...so i would have to set up my shader so it does it... i did see a subtract shader but it is not working on my end :(
     
    Last edited: Feb 11, 2011
  44. MarkPixel

    MarkPixel

    Joined:
    Apr 15, 2010
    Posts:
    39
  45. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    Is this in SSE or not? i just tracked down an issue in 3.3 of SSE that is cuased by me using a name in my Input sturucture called worldNormal. Unity have added this to their list now. I have renamed it sWorldNormal and will be releasing a patch in the next hour or so that fixes it. It only showed up on windows which is super odd to me. Are you doing something similar in your shader? If you pm it to me I could take a look and tell you whats up.
     
  46. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    I just tested a clip using a texture.... it looks like it works for me.
    $workingclip.png
     
  47. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,023
    3.3b - Bug fix

    Thank for reporting a few bugs people. I have fixed them. The main issue was to do with the new 'World Normal' support added by unity. It conflicted with one of the generated variable names. Oh and I also fixed up the line ending warnings (finally!)

    Contributers
    Stramit
    Texel

    Documentation
    Remember to check out Texel's documentation here.
    Planet tutorial by Clamps 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 this this post to download.

    Upgrading Notes
    Before upgrading please remove Strumpy Shader Editor 3.2x from your project. All of the shader editor files have been moved around and tidied up and it is important to have a clean work area. Back up / move any graphs you would like to keep before deleting SSE 3.2.

    Please back up all of your graph files before upgrading. Graphs from Strumpy Shader Editor 3.2 should be compatible with 3.2 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 3.3 it will be necessary to update the shader master node settings. 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. You should also assign a rendertype, in SSE 3.2 this is much more important.

    After updating / fixing the graph please reexport your shader. Shaderlab changed how the UnpackNormal function works and it takes different arguments now. This is handled behind the scenes in SSE but you still need to regenerate the .shader file. Any materials with this issue with show up as being pink.

    Bug fixes
    *World normal node does not cause shader compile issue (windows only)
    *No more line ending warnings! (wooo).

    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!
     

    Attached Files:

  48. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    i didnt mention it but the line ending warming annoyed the hell out of me ... so ... WIN !!! :D
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,851
    Oh, sweet! I think I have it set up in my shader wrong... but i did send you my sgraph so you could look at it...
     
  50. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,082
    Hey stramit, i always wondering....what is the "Advanced Shadow Pass" used for?