Search Unity

Strumpy Shader Editor [Now Open Source]

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

  1. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Use the mask node :)
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Thanks Jesus I didn't see this and had already responded.
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Have you selected advanced shadow pass in the settings?
     
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Morning Stramit, any word on getting SSE to work with light probes properly? I am using it for characters but I lose my normal mapping when I use lightmaps and probes (even if i bake them separate)
     
  5. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Hi guys,

    I'm trying to get a grasp on parallax, I feel like I'm close but it doesn't work out right at this moment.

    Here's the graph I got so far.
    http://imageshack.us/photo/my-images/850/test1sq.jpg/
    $test1.jpg

    I'm sure a lot of people would love to be able to use it as much as I do, plus if some angel fixes my issue I'll do the chicken dance ^^

    Thank you for your help.
     
  6. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Well light probe information is applied per vertex not per pixel so you will lose normal mapping information, you can apply the light probe information per pixel though but it takes some manual shader work. SSE does not currently support this.

    See this thread here for more info:http://forum.unity3d.com/threads/116497-Light-Probes-Questions-Feedback/page3
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    I think you need to add the parallax offset to the UV before you use it, you can't just use is straight up like that. You also want a pretty low bias afaik.
     
  8. Demnus

    Demnus

    Joined:
    May 14, 2012
    Posts:
    34
    Hi Stramit,
    Can you answer please on my question about "shader wants normals, but mesh doesn't have them"?
    3dtext object doesn't produce normals and tangents, is it possible to make shader with SSE that doesn't use them? If not, can you tell how to modify, produced with SSE, shader to not use normals?
    Shader doesn't use any nodes that use normals, also diffuse channel and normals channel isn't used.

    Thank you for your help.
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I was looking at this...have no idea how to modify the shaders to work with light probes properly...I may end up dropping the use of the probes
     
  10. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    The reason for this is that sse writes the normal behind the hood. If you go into the shader remove when the normal is written too. That may fix the issue.
     
  11. shbsh

    shbsh

    Joined:
    Jan 28, 2012
    Posts:
    34
    Hi Stramit .

    any news on next release and improvements ?

    Why I can't use world position node in Vertex Graph ?
     
  12. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    Stramit, I did just that and it worked like a charm!

    There you go: the chicken dance!

    $chickendance.jpg

    Big up for the phenomenal Stramit, your work is priceless, will donate again!
    Regards
     
  13. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    Hi guys is there a way to do a mirror material in strumphy? can some one point me in the right direction?

    Thanks stramit i will search that shadow pass and let you know.

    Please help me some one with the mirro shader please
     
    Last edited: Jun 14, 2012
  14. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    Yes stramit it worked the shadow pass perfectly thanks a lot !!
     
  15. Demnus

    Demnus

    Joined:
    May 14, 2012
    Posts:
    34
    Well it didn't solved the issue. Normals are used in lighting model definition. Now it's a Blinn Phong model. But in my case it must be some Unlit model. I think it must be something really easy to implement but I'm not good at all on this kind of things...

    I think the ability to choose between some number of precreated lighting models will be a nice addition to SSE.
     
    Last edited: Jun 14, 2012
  16. DEADDUCKGAMES

    DEADDUCKGAMES

    Joined:
    Nov 11, 2011
    Posts:
    72
    Nice Shaders!
     
  17. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    [/IMG]I cannot have the reflection of the room im making it receive the shadows correctly but dont know what im missing here .

    Can some one point me in the rigth direction please?
    i want to do a mirror shader and this is what i got very simple but is not working.
     
  18. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    So you want the room to have real time reflections? Firstly, you would want to plug a mulitply into the emission node, then plug the texture cube into slot 2 of the multiply, and then a float constant into slot one (set the value of it to one). Also replace the "WorldNormal" node with a "WorldReflection" node...and plug the normal map into the normal port of the reflection node.
     
  19. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    Hi there :) here is a image i was working on in this week , well took me a week to do .
    This image was made for intention to probe my new shaders , i have done few cloth shaders for leather and other stuff and also some different types for wood , and for the bricks and walls , the only shaders that are not mine are the metal ones , basicaly the ones that looks kind of reflected and dark yellow , and also i model all the whole scene by hand exept the candles the rest is mine .

    But as i dont like to never stop doing something i find this very ritchfull to me becuase those shaders will be the ones that i will use for my game , and at last i got the correct shaders to react fantastic , took me a while to do those and by error i have made it until i find the right and best results.

    I forgot to say all those shaders are multyshaders becuase i was looking for a grungy style so if i remove the effect of the shaders the scene will be kind of clean , so imagine you will not see cracks and double textures in top of each one and the wall only with the bricks !...thats the no effect and with the effect is how it looks now and all is like that , i love it and it probes to me my success making the shaders. :)

    This image is in real time play mode inside unity , also you can move around the scene the only thing i put in photoshop was a little bit of sharpen and my text name.


    One more thing the scene is not light baked yet ! and the scene has 6 multyshaders i will need ot do one more for my game but will do later !

    I just love this scene and still is low poly.

    Remember Im Avaliable for characters or enviroments.

    My skype ... smiljan66
    My email......smiljan66@yahoo.es
    My webpage...www.smiljanpecjak.com

    Best to all :) !


    Here is the full size image......http://www.smiljanpecjak.com/#!image3h9

    ------------------------------------------------------------------------
    All Looks Good in UDK but make something in Unity !
     
    Last edited: Jun 14, 2012
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Holy crap.... very nice...
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey everybody... does anyone have information on using the reflect node... ? I am still trying to figure out how to use it for custom reflections.... thanks
     
  22. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Looks good! You should make a webpayer :)
     
  23. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    Why make a webplayer stramit ? becuase this room if for shader testing purposes nothing more , besides i dont kwno how to upload a webplayer here in unity forums.

    thanks i was thinking that you will like it :)
     
  24. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    A picture says a lot, I just really like seeing it being rendered in realtime :) It looks great.
     
  25. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    I dont know how to upload a webplayer here but i will make a video of the walktrough very simple , also this image was made for stills purpose not walkthough or video but i will make that if thats what you want.
     
    Last edited: Jun 15, 2012
  26. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    Here it is the video i just uploaded sorry the frame rate from camstasia is really bad but for me runs like a charm here.

    [video=dailymotion;xrjtct]http://www.dailymotion.com/video/xrjtct_capture-5
     
  27. rowan_moss

    rowan_moss

    Joined:
    Jun 15, 2012
    Posts:
    2
    Hey guys,

    Loving the strumpy editor so far - great interface.

    I am trying to give a range of the depth of a normal map - here is a screenshot of my current setup.



    When I slide the NormalDepth bar it just messes up the rim lighting effect I currently have and generally destroys the shader, it seems like its affecting the texture coordinates instead of the RGB values.

    I have also tried masking out each channel, multiplying the green one, and assembling but to no avail.

    Any kind of help would be massively appreciated.

    Thanks!
     
  28. shbsh

    shbsh

    Joined:
    Jan 28, 2012
    Posts:
    34
    Very nice smiljan.

    How did you made the volume light ?
     
  29. smiljan66

    smiljan66

    Joined:
    Jun 9, 2010
    Posts:
    610
    thank you :)

    thats only a plane
     
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    If you are trying to control the strength of your normal map, do this: create a multiply node, plug a tex2dnormal into the first slot and add a sampler. then in the spare slot, plug in a Float4 const and set the values to 2, 2, 1... hope theat helps
     
  31. rowan_moss

    rowan_moss

    Joined:
    Jun 15, 2012
    Posts:
    2
    @Neptune Thanks, this helped a bunch
     
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    it was simple as pie... :) just a multiply and a float is all you will need to control your map details
     
  33. darksblood

    darksblood

    Joined:
    Apr 12, 2012
    Posts:
    31
    I have a question. looking at these two graphs, is there actually a better way i could have set this up that would be more optimized? Have any of you done something similar? Thanks in advance.

    $pixel.jpg $mmap.jpg

     

    Attached Files:

  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    How did you solve the parallax mapping? I am trying to do the same thing you are doing
     
  35. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    If you have a look at his graph it's mostly right. What he was missing was that he had to add the result of the parralax node to the UV used to sample. He wasn't adding it to the initial UV.
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Good morning stramit, I eventually figured it out... :) although I don't have a height map from my texture, i ended up plugging in the norrmal map into the height node and using bias values to make.. thanks a bunch...
     
  37. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    A simple way is to put height in the alpha of the normal map. Can't to DXtn compression then though :( (basically use parallax sparingly when needed).
     
  38. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    hi,

    i love to use substance,they work with unity shader,but still not working with SSE, i don't want substance convert to texture.

    i do anything wrong???

    error is "substance failed to intergrate"

    pls help me!!!!!!

    dev
     
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467

    But I have to somehow derive it from the normal map... the texture i am using didn't come with a height map :/... I could try and get away with this by using the Diffuse in Zbrush and inflating it to look like a height map... but it would end up just being a black texture with an alpha on it.

    and while I am here, I have been working with getting refraction and while it works, the shadow is still black... is there a way to get a transparent shadow?
     
  40. Mr.M1k4

    Mr.M1k4

    Joined:
    Jan 1, 2012
    Posts:
    24
    Can someone tell me how to install it? I'm kinda new to unity3d, and this might seem like a stupid question but i couldn't get the info i needed.

    Edited:

    Turned out i already had it installed, but i didn't saw it on the top bar... SIlly me.
     
    Last edited: Jun 18, 2012
  41. Krodge

    Krodge

    Joined:
    Jun 19, 2012
    Posts:
    2
    Hi
    Ive got a couple of problems, And they are either me doing something really stupidly obviously wrong or bugs.

    If I load up the sample clip shader, it displays fine. But if I simply disconnect its nodes attach my own black and white mask it will show up black, no masking. If I hit update on the preview window a few times it will show up as if it were attached to the diffuse channel.
    No matter what I try I can never my own masks to display.

    The other problem is in regards to alpha transparency.
    Even with the correct blend settings, areas that should be in full alpha will become faintly visible under certain lighting conditions.
    I found a few posts about it in this thread but no replies.

    I used this editor about 6 months ago on a different pc and don't remember having either of these issues.
    Maybe I'm getting dumber :)
     
  42. shbsh

    shbsh

    Joined:
    Jan 28, 2012
    Posts:
    34
    You should Subtract your Texture with a value and then plug it to Clip
     
  43. heaversm

    heaversm

    Joined:
    Jul 12, 2011
    Posts:
    11
    How do I get the preview window to show up? It's not visible when I import the package and click around the nodes...
     
  44. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hi I'm trying to create a multi texture shader to combine multiple textures, I've managed to do it using this code, but doesn't work fine on SM2

    Code (csharp):
    1. SetTexture [_MainTex] {
    2.                 combine texture
    3.             }
    4.             SetTexture [_Tex1] {
    5.                 combine texture lerp (texture) previous
    6.             }
    7.             SetTexture [_Tex2] {
    8.                 combine texture lerp (texture) previous
    9.             }
    10.             SetTexture [_Tex3] {
    11.                 combine texture lerp (texture) previous
    12.             }
    Any tips on how to do this with Strumpy Shader Editor?
     
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    How many textures are you looking to use?
     
  46. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    I'm working on a shader to draw crosshatch shading for shadows. The way it's meant to work, in theory, is that there are several textures with crosshatch lines in different directions, and the darker the light level of a pixel, the more of them are multiplied together. They're then drawn entirely in screen space. (UV is normalizedScreenPos).

    Unfortunately, I've run into a few issues.

    1. I either need to get the screenPos coordinate (hard) and the textures (Simple Sampler2D seems to be what I'm looking for) into the lighting graph, or the light level into the pixel graph. (Which is out of order, unless maybe I can do it in a second pass...) Does anybody have any suggestions how to do this?

    2. I can't make textures draw pixel-perfect in screen space, they stretch. Although I suspect I may be able to rectify this by %ing the screen pos with the texture size to make it tile instead, I haven't gotten a chance to try yet. Has anyone faced this before?

    3. Eventually, I'm going to need to draw outlines, and fresnel-based outlines won't be good enough. I'm not sure what technique I'd use for them, I've seen a couple. Does anyone have any suggestions that won't produce any internal lines?

    4. Every so often, I seem to be breaking Unity. The shader I'm working on turns pink, and I get errors about the material not having a texture named _HorizontalHatches. Restarting unity fixes it. Is this a known issue?

    Thanks for all the help!

    -Lou
     
  47. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    504
    brisingre, find the 'default lighting' example graph. Have a good look at that, because that's what you should be basing this off. Once you understand that, set up your ramp with the appropriate lighting divided into blocks of hatching thickness (or leave it as a smooth ramp if you want it linear). That lighting ramp will be used as a custom ramp for the intensity of your hatching, we'll call it light intensity.

    The screenspace hatching tiling is easy - you'll need a variable for your aspect ratio (1.6) and some UVs. Then multiply the U by the aspect ratio, and multiply both U and V by the number of times you want it to tile. There are different ways you can blend things here, straight multiplying the SScrosshatching by the light intensity, or performing screen (1x(1-intensity)) or overlay functions. Try this in photoshop first (grayscale image on one layer, hatching on another, then change the hatching layer's blending).

    For the outlines you're going to want to look at SS Anti-Aliasing effects. Dig into FXAA and see how they determine what needs AA. Same with DLAA. Then what you can do is to use that, and create a toon outline where a) there's a significant change in depth (by depth) and/or b) where there's a significant change in surface normal (need this for corners, etc).

    In the end, this can all be combined into one single post-processing if you want, by incorporating the hatching into the shader (look into how bloom and tonemapping detect luminosity, then apply that to the hatching strength).
     
  48. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Like 5-7? is that too much?
     
  49. MariuszP

    MariuszP

    Joined:
    Sep 28, 2010
    Posts:
    4
    Hey.
    It is posible to tile only quarter of texture (let say 512x512) from 1024x1024 texture?
    Regards
     
  50. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Anyone?