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. Beneuji

    Beneuji

    Joined:
    Apr 15, 2010
    Posts:
    3
    Hello there !

    First, thank you very much for this wonderful tool !
    I was able to finally do something I couldn't code : vertex texture blending with normal maps :)
    I'm still struggling with something : the glossiness range slider...
    I can't get it to work.
    Could you please help me on this ?
    Here's a picture of my shader.

    Thanks all !

     
  2. low_seb

    low_seb

    Joined:
    Jun 13, 2011
    Posts:
    76
    hello

    thanks for this great tools

    I have a transparency issue on my model but I followed the shaderLab instruction

    my model

    and the graph


    thanks
     
  3. bb0x

    bb0x

    Joined:
    May 16, 2011
    Posts:
    70
    Your gloss range is too low. try setting it minimum to 0 and the max to 1.

    Your settings work fine for me.
    Did you make sure that your specular texture is 100% black where the mesh is transparent?

    Actually looking at your image again I see what going on. Its either something with the culling of faces (tried to disable it so it renders both sides? Or its something with Ztest, more likely.

    Oh wait. try putting render type to transparent as well.
     
    Last edited: Jul 5, 2011
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    If you also want a very glossy look as well, I would also use an Add node plugged into the gloss channel, then your texture into the first input, and then a float node. This allow you to get very higher range. :)

    You can also delete the unpack normal node if you are using a Normal Map
     
  5. bb0x

    bb0x

    Joined:
    May 16, 2011
    Posts:
    70
    Or simply set the max to 5 of the range slider? youd have a 5 x tighter specular spot.

    Yeah I forgot to mention that as well.. use a Tex2dNormal instead of Tex2D with unpack normal. If you dont need the alpha slot.
     
  6. low_seb

    low_seb

    Joined:
    Jun 13, 2011
    Posts:
    76
    for the wings its a simple plane but in max I clone the planes an I flipped it ,its maybe wrong ?
     
  7. bb0x

    bb0x

    Joined:
    May 16, 2011
    Posts:
    70
    You could try making the Shader double sided and use only 1 plane in max. see how that goes
     
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    I started a Shader just for that...except the normal maps didn't work on it... Texel showed me a way to do it...
     
  9. Gigablargh

    Gigablargh

    Joined:
    May 27, 2011
    Posts:
    28
    \
     
    Last edited: Jul 10, 2011
  10. Dan-the-Man383

    Dan-the-Man383

    Joined:
    May 24, 2011
    Posts:
    23
    Wow this is awesomely cool! I just downloaded it, but I can't seem to make work. Does it work with unity indy?
     
  11. Texel

    Texel

    Joined:
    Dec 25, 2009
    Posts:
    61
    Yes, but the preview will not display. Instead, export the shader, apply it to an object, and when you want to see your changes, re-export (This isn't too bad so long as you don't export as each time)
     
  12. a1s2d3f4

    a1s2d3f4

    Joined:
    Mar 20, 2011
    Posts:
    415
    Hi, I'm not very good with shaders, but i have made a nice looking specular shader and i wanted to give it reflections but i cant quite figure out how to use a cubemap reflection. I thought the reflection stuff had to go into the emission part of the master block so i did that and i have a texCube block and the sampler but im stuck there. Please help
     
  13. noradninja

    noradninja

    Joined:
    Nov 12, 2007
    Posts:
    420
    Just wanted to post something I have been working on:



    and again say thanks for the tool, it's awesome.

    I am working on a way to feather the opacity on the edges of the models with an inverted fresnel, but I cannot seem to make it work...is this a reasonable way to go about it or do I need to do something else?
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Would be awesome if strumpy incorporated Aras' little http://aras-p.info/blog/2010/09/29/glsl-optimizer/ GLSL optimizer so that it optionally spits out really tight (and much faster) shaders.

    In fact that thing isn't perfect either, there's bound to be room for further improvements with it. As I understand its an ongoing project. It's stuff like that which would really get my interest in strumpy. At the moment strumpy is too slow to use for any ios projects.
     
  15. ScienceFiction

    ScienceFiction

    Joined:
    May 28, 2008
    Posts:
    393
    I've been really impressed with your shaders, can't wait to see some of your scene there, in motion.
     
  16. psygnisfive

    psygnisfive

    Joined:
    Mar 1, 2010
    Posts:
    5
    Slight error in the description for the step node; the current description is "Arg1 > Arg2 ? 1 : 0 - That is, if the first value is larger, it returns one, if less, it returns zero. Used for conditional logic and thresholding." when it should be "Arg1 < Arg2 ? 1 : 0 - That is, if the first value is smaller, it returns one, if greater, it returns zero. Used for conditional logic and thresholding."
     
  17. noradninja

    noradninja

    Joined:
    Nov 12, 2007
    Posts:
    420
    I have had no issues, but I can tell you I do enable Approximate View and Half As View in most of my shaders; most of the time, you can get away with less precision there and it wont make a notable difference (especially on the smaller screened iOS devices, although I dont notice anything real different on my iPad 2 either)...did this on my paint shader shown above and it nearly doubled my FPS in Retina Display mode on an iPod Touch 4G from around 19 FPS to near 40...didnt matter on my iPad 2 but I am sure I am not coming anywhere near maxing the fillrate on THAT beast yet.
     
  18. noradninja

    noradninja

    Joined:
    Nov 12, 2007
    Posts:
    420
    Here you go. Sorry for the quality, but you should be able to see the shader effect fairly well.

    On-device Demo
     
  19. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Hello everyone, I haven't been posting in a while and I haven't been answering any questions. But I have been doing so with good reason...

    2 weeks ago I started in my new job working for Unity in Denmark. I had been planning the move for a few months, but decided to stay quite and withdraw from the forums until I was settled in.

    What this means for SSE is the following:
    *Nothing bad!
    *Release of the next version has been pushed back until (probably) mid august, due to my moving and having not had time to code for 2-3 months
    *I can now make SSE even better
    *I should be able to find more time to work on better mobile device support
    *SSE is *NOT* a unity product. Do not report bugs about SSE to unity.

    I will be back around the forums again now, helping where ever I can (not just in this thread!), and working on the new release!

    I have had some great ideas on how to simplify and fix many of the aspects I am currently not happy with. I'm very excited for the next release but I'm still in the planning stage for the big feature points. If there is anything you MUST HAVE for the next release, or any big bugs let me know.

    We have also created an email address ssebugs@gmail.com for any bug reports of feature requests you have. Note that this is NOT for 'how do I make shaders' but for us to have a better way to track issues as they arise. Feel free to tell us about bugs here, but please also send an email. If you include screenshots and an example project I will <3 you even more.
     
  20. kerters

    kerters

    Joined:
    May 13, 2011
    Posts:
    164
    Congrats stramit ! :) do you integrate the shader editor in Unity now ?

    Cheers,
     
    Last edited: Jul 18, 2011
  21. windexglow

    windexglow

    Joined:
    Jun 18, 2010
    Posts:
    378
    integrated sse gogogo
    Congrats on the job, and best of luck in moving about.
     
  22. a1s2d3f4

    a1s2d3f4

    Joined:
    Mar 20, 2011
    Posts:
    415
    How Do you add a cubemap reflection to an sgraph?
     
  23. AaronG

    AaronG

    Joined:
    Jun 30, 2011
    Posts:
    39
    Congratulations, stramit! Love SSE and can't wait to see what sort of improvements to Unity come about as a result of your hiring.
     
  24. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Congratulations Stramit!, Can't wait for the next update of SSE :)
     
  25. chadchat

    chadchat

    Joined:
    Apr 5, 2008
    Posts:
    154
    Grats on your move to Unity~
     
  26. gy40

    gy40

    Joined:
    Jul 18, 2011
    Posts:
    5
    Hey, guys. It's my virgin thread to post ~~
    I am a struggling indie developer which happen to stuck with some graphic mechanism. As one of the non English speaking people, critical shortage of resources often leaves me confusion that I felt I have no one to turn to T.T

    The problem leads me here is I want to do something exactly like or better than the gif below shows, but still I get no clue after hard working at it for a whole week:



    Can anyone show me some clues of how the flashing reflection mechanic works that way? Sincerely thx for helping me on that. Will keep online today````
     
  27. noradninja

    noradninja

    Joined:
    Nov 12, 2007
    Posts:
    420
  28. Ali-Nagori

    Ali-Nagori

    Joined:
    Apr 9, 2010
    Posts:
    151
    it's possible with Strumpy shading editor , but it's going to take some work from you in the node editing , nodes for scaling and panning as an alpha and a basic diffuse node would get it for to the example above , hope you do your home work and get to know all the different nodes and there functions.

    and by the way unity is a complete AAA gaming development tool you just need the right direction and assets

    good luck
     
  29. ehsangamer

    ehsangamer

    Joined:
    Apr 15, 2011
    Posts:
    34
    Nice to see the news and hoping for integrated version !!

    Plz make some examples for how to make a parallax map or reflection map .

    And I think matching the operations and other stuffs name with UDK's material editor will help a lot . because the are lots of tutorials for unreal material editor but I can't find some of the functions in SSE for example reflection vector or vector transform .

    Or at least make a Dictionary for beginners like me !!!
     
    Last edited: Jul 19, 2011
  30. brn

    brn

    Joined:
    Feb 8, 2011
    Posts:
    320
    Awsome news about the Unity Gig, Congratulations and best of luck. :)
     
  31. WarpedAxiom

    WarpedAxiom

    Joined:
    Oct 27, 2006
    Posts:
    245
    Wait, so you're moving from Australia to Denmark? That's a pretty big change. Hope it's all worth it in the end.
     
  32. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    Hi,

    Is there any way to get the light vector when in the pixel graph ? i know you can use the Light Colour node when in the lighting graph but this node does not work in pixel graph.

    I am an artist so im not fully aware of how all the nodes so a simple description would be useful :)

    thanks
     
  33. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    He's actually just moving for the Lego.
     
  34. brn

    brn

    Joined:
    Feb 8, 2011
    Posts:
    320
    Lol, that works for me to :)
     
  35. melonman

    melonman

    Joined:
    Oct 25, 2009
    Posts:
    19
    Well done mate good job hope all go well for ya man.
     
  36. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    Quick question. I'm reading over the documentation--specifically, the functions--and I'm having trouble figuring out what I need. What function(s) would I use to determine transparency using a greyscale alpha channel image? Basically, I want it to take a primary texture and determine the transparency of the image by use of the texture in the alpha channel. I'm not interested in built-in shaders that already do this because I don't understand those, but I do understand Strumpy well enough. This isn't the end of what I am trying to do with this shader, so odds are I'd have to modify a built-in shader anyway, which I can't do.
     
  37. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    309
    I made what I think is a fairly simple shader. The idea is to use it on models I import at run-time (NOT through the FBX model importer path!) These models do not have tangents. But then again, neither should my shader, as it does nothing with normals nor bumps AFIK. But I get this warning: "Shader wants tangents, but the mesh doesn't have them" and just whiteness is rendered. My 'Master' node has no input for Normal, but I do have Gloss (constant) and Specular (constant). Any ideas?
     
  38. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    Can't you calculate the tangents at runtime when you import the model?
     
  39. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    309
    I'm rather new to the concept, not sure how to do that. I know how to calculate normals, (and these models may or may not have normals in them), would it be like that?

    But really, why would it expect them at all? Which input triggers that need? I have one texture and some color and constant inputs is all, with an alpha channel to boot.

    Looking at the SSE output ('shader') I don't see anything about tangent. But looking at the compiled code ('Compiled-myshader') I do see several places it's mentioned. My guess is that the 'master' node has this in it generically. Is there a safe way to edit that out?
     
    Last edited: Jul 26, 2011
  40. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
  41. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    309
  42. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    Can someone, please, explain to me the operations/nodes I need to use to use the alpha channel of a texture as a transparency mask for another texture? I don't even know if I am using the right terminology, that's how ignorant I am. Basically, I want to be able to adjust the alpha cutoff value through scripting to determine how much of the target texture is transparent. Can anyone give e a general idea (in Strumpy terminology) how to accomplish this??
     
  43. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    @Maker16
    You don't actually need any functions to do that, just plug the alpha channel into the alpha output and make sure the shader is set up to be a transparent shader (depth write off, transparent render queue etc).
     
  44. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    See, that's what I figured, so I created a texture with an alpha channel and tried it, but it didn't work. I created a Sampler node, a Tex2D node, ran the RGBA node to the Albedo, and the A node to alpha, set it to render transparent, depth off (and tried on b/c, after a couple hours, I was just trying any and everything to get it to work). Wouldn't work. After that, I tried masking out the alpha between the RGBA node and the Albedo b/c I thought that would do something, but that didn't work either. Is there maybe something I have to change by manually editing the compiled scipt?
     
  45. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    Ahhh...I found the first problem. Now I have a basic shader that uses the alpha channel for transparency. Now, the second obstacle. I am trying to set it up so you can use a slider to alter the output of that alpha channel before it goes into the alpa component of the shader. Basically, I want to multiply the value in the alpha channel by the slider value, and pass that into the final alpha component. So, if the slider is set to .5, and the source alpha value is .8, the final output will be .4, I tried putting a multiplication operate between the Tex2D node and the alpha output, Arg1 was the alpha from the Tex2D and Arg2 wsa my slider value. This didn't work. I suspect blending method has something to do with it, but I don't really get what the blending options mean.
     
  46. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    That's great news stramit, congratulations! Now that you're on the Northern Hemisphere, any negative effects from standing upside down all the time? ;)
     
  47. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    It sounds like what you did was correct. You might just have something wrong like you're not exporting the shader to the location that you think you are.

    *shrugs*
     
  48. Gigablargh

    Gigablargh

    Joined:
    May 27, 2011
    Posts:
    28
    This is a great editor... But it's not well documented in the places I need for it to be. Right now I'm trying to make a vertex-moving shader. I want to reposition each vertex a (fixed) Vector3 distance from its original position, relative to that vertex's original distance from a second, (variable-every-frame) Vector3 point in world space and in the same direction from the point as it was before.

    How can I do that? I'm having a mild case of the braindeads and can't even see where to start.

    The matrix nodes are what I think I need to use but aren't intuitive to me; is there a good tutorial for vertex positioning shaders in general?
     
  49. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
    I must thank you for releasing this tool! It's been a tremendous help with the projects I've done at school this spring. Our shaders would have been the built in ones without SSE. So many thanks, and I wish you the best of luck with your new things.
     
  50. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This just won't install on unity 3.4 pro PC.

    Get a package failed to import error.