Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Strumpy Shader Editor [Now Open Source]

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

  1. Stolenbows

    Stolenbows

    Joined:
    Nov 30, 2010
    Posts:
    82
    ive been using this for a couple of weeks and its really easy!
    and free also!
     
  2. GisleAune

    GisleAune

    Joined:
    May 16, 2011
    Posts:
    88
    Is it possible that a gray-scale map determined how bright a pixel is. White = fullbright, unaffected by lighting, black = normally affected by lighting. No illumination of sorroundings. Will something like that work in free? (My trail won't last forever)
     
    Last edited: May 24, 2011
  3. solid

    solid

    Joined:
    Jan 15, 2010
    Posts:
    132
    How do i get a per-pixel worldnormal node?
    I can't find it in the shader editor, but it said in the struct that it exists as WorldNormalVector (IN, o.Normal). if i didn't misinterpret.
     
  4. 3DMagicVR

    3DMagicVR

    Joined:
    May 25, 2011
    Posts:
    2
    Hi, I'm start to use this very awesome tool and notice something very important, when you try to make a shader with alpha the object don't looks good, you can see the object´s back over the front side and if have to many polygons, the effect it's more weird, this is because the "AlphaTest" it's not included in the settings within the editor's shader, when I include this, in the game window show a well and perfect alpha integration, so if you could add this option in the editor this will be a great help to making shaders with "RGBA" images, thanks for your attention, keep the good work.
     
  5. Mumasboy

    Mumasboy

    Joined:
    Feb 24, 2011
    Posts:
    15
    I'm using the most up to date version of the editor but are having problems with alphas. Even when I set the render type and queue to Transparent, it always seems to stay opaque. Am I being thick? The only thing I can think is that either there's a known problem, or since the editor's interface has changed (I was using it a few months ago and seems to have changed quite a lot) there is some switch somewhere that I'm missing.

    Thanks for any help.
     
  6. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Coming in the next release ;)
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Can you post a screenshot of your settings screen?
     
  8. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Instead of alpha test you use clip. It will clip if the value you input is less then 0. It's a bit more flexible then hardware alpha test as it allows you to do crazy things with it and it's not hard coded. See the clip example in the included shader graphs.
     
  9. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Yep. Have a look at the video I made (posted earlier in the thread) for ramp lighting. Should give you some ideas!
     
  10. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    New version isn't going to be too big. I've actually been working on a game with some friends (using SSE for the materials!) which has been sucking up most of my time. I've been using this time to figure out and see where SSE can really use improvements. Overall I'm still very happy with beta 4 and really only want to tighten up a few bugs / make some things easier to use for 4.1.
     
  11. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    You need to set up the blend type. See the alpa example. But the gist of it is:

    Blend mode: custom
    src: srcalpha
    dst: oneminussrcalpha
     
  12. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Nope. It's not supported in unity like that. You need to do 4 passes if you want 4 output textures. This will need to be done on the scripting side not the SSE side.
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Well, that is cool dude... i've been meaning to ask you... I started a Front-Back shader (thanks to texel's example) and it looks GROOVY...everything pretty much works as it should except for the normal map which, when applied to both Frnt-Bck Channels, doesn't appear whatsoever... it appears the assembly node texel uses for the normals gets in the way of it... is there a way around this? Using a Lerp doesn't seem to help me at all...
     
  14. melonman

    melonman

    Joined:
    Oct 25, 2009
    Posts:
    19
    Just really want to thank you Stramit and Texel this is just what unity needs Big Time so big thanks to you guys.

    Did find a lil something up with the transparency when trying to create a transparency shader based of an alpha with rim light.
    I have read your posts and changed up the shader to

    custom
    src color
    oneminussrcalpha

    and worked a treat with the normal transparency shaders but as soon as I add rim light seems to mess with it.

    Did try a few combo's but still haven't hit home.
     
  15. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183

    Can you post a picture of the graph and settings?
     
  16. HeadClot

    HeadClot

    Joined:
    Jan 23, 2010
    Posts:
    212
    Does this work with particle FX in unity or just shaders?

    and

    Can I buy now Plz?
     
  17. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    SSE is free.
     
  18. HeadClot

    HeadClot

    Joined:
    Jan 23, 2010
    Posts:
    212
    Even better!!!!!
     
  19. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    A donate menu item is added when you install it, I'm sure a donation would be very much appreciated.
     
  20. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Just found the wonderful MatCap shader:
    HERE
    And was wondering if it could be replicated in Strumpy?
     
  21. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,797
    Looks great, time to start downloading!
     
  22. melonman

    melonman

    Joined:
    Oct 25, 2009
    Posts:
    19
    Hey stramit will post up the graph as soon as im back at work. Thanks man.
     
  23. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    Can you help of guide me for this, stramit?
    Any help we be great help for me.
     
  24. ehsangamer

    ehsangamer

    Joined:
    Apr 15, 2011
    Posts:
    34
    How can I select for example the red channel of my vertex color or texture ?
     
  25. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Use a splat node to splat the r channel to all 4 channels.
     
  26. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Well it's not simple and you will need to use the camera api to set a render texture on the camera. Call render and then change the render texture and call render again.

    If you want different shaders per pass you will need to use shader replacement. If it's a post process though you won't need too (as you'll just need to use the same source texture).
     
  27. okimoki

    okimoki

    Joined:
    May 13, 2010
    Posts:
    116
    Don't know if this is the right place to ask this (is there a Strumpy forum??) but.. here goes:
    I want to make a shader thar i would use to display text in my storybook app.. so i need a color (main text color, just basic color) and an alpha.. but in addition i would like to have another image that would be a gradient (linear gradient that goes from start of the text to the end) and would use clipping on itself to fade text in and out, typewriter style.. preferably i would like to take R for main color, G for alfa of the text, and B for gradient for fading.. so i would only have MainTex and a clipping value that i would be able to access trough script..

    Ive been trying this for a while now, but i guess that is more advanced than i can handle (math and logic aren't my strong sides hehe)..
    Any help would be appreciated!
     
  28. okimoki

    okimoki

    Joined:
    May 13, 2010
    Posts:
    116
    Aa always, few minutes later i answer my own question..



    but how do i access the _Clip property trough script now??
     
  29. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
  30. okimoki

    okimoki

    Joined:
    May 13, 2010
    Posts:
    116
    I usually don't sound like an overexcited little girl, but.. OMG, THANK YOU, THANK YOU, THANK YOU!!!! YOU ARE AWESOME!!!!!! OMG!!!!! :)
    Really, thanks for this awesome tool.. i was able to create something i taught i will never be able to do.. a custom shader to do something I WANT it to do! And i did it in 2 hours from installing of your editor to now!
    Just awesome!
     
  31. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    Though it is hard to get what you said, thank you very much.
     
  32. ehsangamer

    ehsangamer

    Joined:
    Apr 15, 2011
    Posts:
    34
    Thanks.

    In UDK there is Bump Offset property that take the heightmap and the UV coordinate and then we can attach it to the UV slot of a tex 2d . But I can't Find it In Strumpy . Is there some thing similar to it ?
     
  33. ehsangamer

    ehsangamer

    Joined:
    Apr 15, 2011
    Posts:
    34
    Hi.
    How can I Add parallax map to my shader ?
     
  34. bugo

    bugo

    Joined:
    Oct 30, 2010
    Posts:
    68
    Is there a "stagger" node or a way to do it?

    If someone doesn't know what Stagger means please read below:
    "Stagger controls how rows of texture tiles are placed beside each other. When Stagger is turned on, then every other row of texture tiles is offset by one-half its width, like rows of bricks in a brick wall."
     
  35. melonman

    melonman

    Joined:
    Oct 25, 2009
    Posts:
    19
    Hey Stramit

    The transparency rim light shader problems im experiencing are shown in the attatchment.

    jpg no. 3 is more or so what the shader should like but I have to add emmissive map to get that effect

    but without the emmissive map I get all sorts of streaks like in the other attatchment.

    Also I get some aliasing problems near the inner edges of the alpha map aswell as not being able to see the opaque part of the sphere from some angles.

    Was wondering if the latter was a transparency sorting issue?

    I have added the sgraph and settings aswell.
     

    Attached Files:

  36. bugo

    bugo

    Joined:
    Oct 30, 2010
    Posts:
    68
    If I wanted to lerp inbetween two textures by camera radius distance, what node should I use? ScreenDepth?
     
  37. ehsangamer

    ehsangamer

    Joined:
    Apr 15, 2011
    Posts:
    34
    No Idea guys ?

    I want Parallax map + Normal map in my shader .

    But I don't now how to add and where to ?!
     
  38. zeldafan_mimo

    zeldafan_mimo

    Joined:
    Jan 27, 2010
    Posts:
    23
    Any tutorial or Graph For Toon Shader ?
    A toon Shader with Normal Maps , or some in an Oil Paint Style Like Prince Of Persia ?
     
  39. Vert

    Vert

    Joined:
    Mar 23, 2010
    Posts:
    1,099
    +1

    I would like to know how to add a better outline to my shaders without possible gaps like the default toon shader creates. Anyone know how to make an outline shader without gaps?
     
  40. glitchy

    glitchy

    Joined:
    Sep 27, 2010
    Posts:
    32
    I just wanted to thank you for all the hard work you put into this while providing it for free.
     
  41. noradninja

    noradninja

    Joined:
    Nov 12, 2007
    Posts:
    420
    Just wanted to say, for all the people having issues using SSE with iOS; I loaded a test scene last night onto my 4th gen iPT with iOS 5GM seed on it, and it works perfectly! Now we can use SSE to make iOS pixel shaders, which I know I am not the only one wanting to do.

    On a side note; I have a nice baked normal shader; the problem with it is of course it's only really good for static lighting. Anyone know of a way to fake dynamic lighting (or really, faking the pixel specular contribution) that would give similar results to NM without the expensive calculation?
     
  42. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    hey guys i am trying to build a "lit sphere" shader also known as "spherical environment mapping" like the polycount guys do here:

    http://www.polycount.com/forum/showthread.php?t=68125 (there is actually code for a unity shader at the end of the thread but i want to know how to do it within sse because i need to hook this into a much more complex already existing shader )



    here is a little tutorial on how to do it in udk (the black sphere with the white bulls eye circle lines)

    http://udn.epicgames.com/Three/MaterialsCompendium.html#Transform

    i have problems with figuring out what the sse equivalent to udks: "vector transform -> Transform_view" is

    anybody have any ideas ? thanks in advance !
     
  43. ehsangamer

    ehsangamer

    Joined:
    Apr 15, 2011
    Posts:
    34
    How can I make Shaders Like color correction ? I mean not for a material of an object , for the camera screen .

    I want to make something like rain drops on the FPS camera of the player

    Can I use SSE ?
     
  44. bb0x

    bb0x

    Joined:
    May 16, 2011
    Posts:
    70
    I have a question about sin/cos.
    Basically I'm trying to create an emissive shader that flickers. How do I set up the nodes in SSE for this to work?

    Also how would I go about creating a swaying surface like water? Again one would use sin/cos, for it to move back and forth, but how do I set this up properly?
     
  45. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Hey everyone, sorry about going AFK for a bit I had to have surgery and was not really in a state to post or code. I'm okay now... so I'll answer all the questions that have been adding up.
     
  46. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    There is a parallax offset node. The tooltip describes how to use it. The next example pack I make will include an example.
     
  47. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Toon shading is quite similar to ramp lighting, just with specific ramp characteristics. Watch the tutorial video I made for ramp lighting, then have a google read on toon shading. The way if works is that to achieve the sharp highlight you want sharp gradients. You want bright areas bright, mid areas a mid tone and dark areas a dark tone. The areas in between you want to push towards one of these areas. You can do this with a gradiant ramp. Normal maps affect the base lighting, so they should 'just work' after lighting for areas has already been calculated.
     
  48. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    In the last tutorial pack I included a simple outline shader. Unfortunately outlines are a pain to do and support both forward and deferred. Are you after a very edge outline (silhouette) or are you after an outline that is drawn for every 'backfacing' edge (turning away from the camera).
     
  49. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    If you want to start to get a bit crazy you could hand code a single directional light into a shader and avoid the unity pipeline. I don't think it's worth it (you'll begin to kill performance) but it is possible. Best thing (IMO, no means fact) is to really concentrate on baked colored lighting and nice ambient areas. Use the art to make your game look amazing. I'm actually working on a 'large' title at the moment and we are not even bothering with any dynamic lighting at all. Everything is baked and there is nothing in the way of normal mapping. I'm a sucker for simple art though!
     
  50. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    These are normally post process or particle effects. Both are not really suited to SSE.