Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Strumpy Shader Editor [Now Open Source]

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

  1. texasjakit

    texasjakit

    Joined:
    Jul 19, 2012
    Posts:
    2
    Only works on Pro version of Unity.
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,163
    Can you raise a bug against unity for this? It should not do this.
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,163
    SSE is for surface shaders, so it's best not to use it for unlit things.
     
  4. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    563
  5. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    733
    hi,

    i want help about real time sub-surface scattering shader?is it possible in SSE?i am null in shader programming.
    i am only depend on Strumpy Shader Editor.

    dev
     
  6. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,079
    Excellent tool!

    Is there a way to bias the mip maps on a texture within the shader at runtime?
     
  7. foxter888

    foxter888

    Joined:
    May 3, 2010
    Posts:
    530
    hi i'm trying to make a shader similar to the builtin 3d text where you can see it through geometry but i want it opaque and at the same time be able to recieve shadows, i'm not worried about casting them lol.

    so here's what i got so far:


    and here's the graph:


    and yes i'm trying to do the same thing as someone would do with the camera trick like using layers and set it to depth only but it's not so great, first i can't recieve shadows from other geometry since it's being drawn on top of everything through the camera, screen effects don't work correctly and i get lighting on the model even if i'm on a darker area since it's drawn on top of everything.

    anyhow i'm trying to make it as a shader so far it works but if you look at the picture the objects in it are being drawn on top of each other like if they where transparent which is the unwanted result. pretty much i want it to behave like a regular geomtry but drawn on top of the rest withouht using the camera trick.
     
  8. Artimese

    Artimese

    Joined:
    Nov 22, 2009
    Posts:
    794
    Anyone familiar with Shells/Fins using SSE? I need to create a shader that uses them to mimic fur/grass, there are some shaders out there that do this, however doesn't use Unity's Lighting System, so looks like I gotta make my own.

    Any ideas anyone?
     
  9. battou

    battou

    Joined:
    Jan 25, 2011
    Posts:
    183
    Anyone? Please, help!
     
  10. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    How versatile is SSE? Is it limited to specific types of shaders?
     
  11. foxter888

    foxter888

    Joined:
    May 3, 2010
    Posts:
    530
    i'm still new messing with sse, i wonder is there going to be any more updates and tutorials for example i do see the lightning graph and vector. are there going to be more tutorials about it?
     
  12. Irondust

    Irondust

    Joined:
    Jun 30, 2012
    Posts:
    7
  13. TommiH

    TommiH

    Joined:
    Jan 14, 2008
    Posts:
    252
    Hello.

    I tried bringing the ParallaxNode script from this old post into my project but I get the error:

    Assets/Scripts/ParallaxNode.cs(17,33): error CS0246: The type or namespace name `Node' could not be found. Are you missing a using directive or an assembly reference?

    I'm trying to create my own node (for some specialized texture blending). I got the impression that it should be possible to do this simply by inheriting Node the way it's done in ParallaxNode, but clearly it's not seeing any of the core classes. Am I doing something wrong or did something change since 2010 when that hint was posted?
     
  14. VeteranOne

    VeteranOne

    Joined:
    Aug 3, 2012
    Posts:
    4
    I am having an issue. I want to have a reflection on PART of a mesh, like the first picture below (Rendered in Unreal Engine 3)
    I can achieve this in Unity, using this fab editor, but once I attach my normal or specular then it goes pink (error). So, a basic
    diffuse, with the same normal and specular work fine. But the diffuse which has the reflect added in, plus the same normal and
    specular gives me errors. I am so lost.

    Rendered in UDK (Desired Output)

    Rendered in Unity, great (until I attach Normal and Specular)

    Strumpy graph
     
  15. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    419
    Hello! Can you help me please?

    I want to make something like vertex displace by HighMap, but Sampler2D didn't work at vertex graph.
    So how I can define different positions for different vertices?

    I am checked the Vertex Modification example, but it just multiply vertices normals and move all vertices at once.

     
    Last edited: Aug 5, 2012
  16. Demnus

    Demnus

    Joined:
    May 14, 2012
    Posts:
    34
    VeteranOne
    Most likely you just runs out of available for shader model 2.0 number of instructions. Specular and glossiness eats them a lot. Also some of nodes is presented not by one but multiple of instructions, as well as compiler can some how optimize the code, so you can even get different number of instructions by changing values of expressions. Also multichannel operations eats an instruction per channel. You can see a number of instructions of compiled shader in top-left corner - ALU. If shader cannot be compiled and start to give errors means you're out of 64 instructions. For shader model 3.0 this number is greater, but your project will not run on old hardware and mobile platforms.

    Artaani
    There is no way to use texture sampler in vertex graph. So, no, you can't. But you can pass from script a vertex colors.
     
    Last edited: Aug 6, 2012
  17. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    419
    Demnus
    Thanks you.

    So procedural lighting like in example, only possible due to script that will process each vertex? This require a lot of CPU. :(
    Or this is normal? For example, like a water in the CryEngine 3, that uses vertex transformation.
     
  18. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    490
    Artaani, it might be worth checking to see if you can use vertex colours in the vertex graph.

    Not being able to use it natively is one downside of Unity's interpretation of surface shader rendering techniques - and the Strumpy Shader interface being catered to 'natively' work primarily with deferred rendering.
     
  19. Demnus

    Demnus

    Joined:
    May 14, 2012
    Posts:
    34
    Artaani
    I think it's a problem as you need to recalculate normals for displaced mesh. Even tough you can generate procedural transformations based on vertex UV or use a vertex colors.
    So may be it's not completely impossible but you should put considerable effort to figuring out how to do this. Or just pass needed info via vertex colors, or even just do everything trough script. It does consume much resources but it should be OK if you have not to much polygons.
     
  20. VeteranOne

    VeteranOne

    Joined:
    Aug 3, 2012
    Posts:
    4
    Demnus,

    With just the Diffuse the ALU is 32
    With just the Normal the ALU is 15
    With just the Gloss the ALU is 5
    With just the Specular the ALU is 22

    If I attach everything it say's ALU: N/A

    I have shader model three selected. And the object is pink once everything is linked.
    If I "exclude path: forward" then there is no error, but just a black texture with ALU: 37

    I am so lost with this one. I can link each item individually, but once I link diffuse and
    specular and/or normal It wont work.

    Any other advise? Any reason my ALU shows N/A with everything linked?

    Thanks for the initial advice! I was so stoked to see a reply.
     
  21. Demnus

    Demnus

    Joined:
    May 14, 2012
    Posts:
    34
    VeteranOne,
    I think, ALU shows N/A because shader isn't compiled because of errors, so there is no report about resulting number of instructions used by shader.
    Model 3 permits 512 ALU+512 Textures. So I think it should be enough... May be there is some other limits... Read errors in console carefully.
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    Has anyone gotten tangents to work with Strumpy? Or world reflection node for that matter? I keep getting errors with this node (models turn pink) and I am trying to get localised reflections on my models... is there a way around this...?
     
  23. VeteranOne

    VeteranOne

    Joined:
    Aug 3, 2012
    Posts:
    4
    Neptune

    -- If you look at my post on the last page of this topic I have a reflection limited to one area of my model. It's works great, as long as I don't use a normal map or specular map at the same time. Why, I don't know. I have the graph posted though. The reflection/mask is under the diffuse graph.
     
  24. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    I would get rid of that unpacknornal...you don't need it there... and I've gotten reflections to work as long as you don't plan on tiling and use a mesh UV node... I am also trying to simulate a rain street using a cubemap... thanks man.
     
  25. silentfred

    silentfred

    Joined:
    Aug 11, 2012
    Posts:
    4
    Silly issue: I can't seem to find the little preview window with the sphere in =(
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    Click on preview :)
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    Hey guys, I was essing around with a metal shader I put together... still trying to figure out how to get glossy reflections so I can get the look of brushed metal. All this shader takes is a black texture with alpha and a single swatch... normal maps are optional. From left to right: Copper, Bright Gold, Bronze, Chrome. Thinking about selling this on the Asset Store. Is there a way to get glossy reflections, i.e.: blur the cubemap... thanks.
     
  28. silentfred

    silentfred

    Joined:
    Aug 11, 2012
    Posts:
    4
    Can't find anything like that.
    I'm so sorry if i'm busy being an idiot!
    Thanks for the help!
    $Capture.JPG
     
  29. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    Oh, if you are on Unity Free, you don't get the preview :(... you will just have to apply the shader to your object and hit export...which i find easier to work with
     
  30. Sylos

    Sylos

    Joined:
    Dec 14, 2009
    Posts:
    7
    I'm trying to figure out how to make a shader that mimics fog.
    So far I've got an alpha texture to display, with an emissive colour for the fog colour. The problem is, I can't get the emissive colour to have an alpha property to fade it in and out.
    I'm basically trying to get an alpha texture with a fadeable alpha mask on top.
    Can anyone help me out with this please?
     
  31. Sylos

    Sylos

    Joined:
    Dec 14, 2009
    Posts:
    7
    Nevermind! I've worked it out!
    Here is my fog shader:


    You use the slider to change the alpha of the fog, and you can change its colour.
    : )
     
  32. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    563
    I posted a month ago an issue with lights not working as expected on my Diffuse (with alpha channel) Specular Normal shader and nobody answered (that's fine, that was a noob question). Well I fixed it and shared my sgraph and .shader here for anybody to use. (If another noob like me encounter the issue :))
     
  33. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    563
    Is there a way to ignore colors that appear behind a texture? I'm working on an Hologram shader and I would like to avoid the x-ray kind of look. Example below.



    Is it possible to ignore what's behind on the same mesh without removing alpha?
     
  34. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    563
    Ok nevermind I found a way. I simply removed transparency, grabbed the screen texture and added it the emissive. The wheels still appear through the model, but it is unavoidable since it is not the same mesh. I'll add a plane that hide that part when seen from a precise direction.

    Now I also have distortion, which is quite nice.
     
  35. roach_779

    roach_779

    Joined:
    Aug 2, 2012
    Posts:
    29
    Hey Guys,

    I newb using Strumpy and I want to know if there is a way of searching the nodes I want to use. I know I can mouse over nodes in Strumpy and get quick info, but would like to know if Unity has a shader reference page that I can word search for particular nodes?

    While I'm here, does anybody know which node to use for on/off value which needs to be control by time node?

    Also, how can get UV_pan node move from one half of a texture to the other half without scrolling? I need this to go back and forth between the halfs.
    Thanks
     
  36. shbsh

    shbsh

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

    I'm trying to make Tree Leaf Shader but I have some problems with cutout and also the blending with image effects like Global Fog here is the Screen Shot :

    $Transparent_Problem.jpg

    Thanks for Help
     
  37. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    563
    @roach, For the on/off thing, I'd personally use a float property and attach a on/off script that pass the value from 0 to 1 and 1 to 0 via Material.SetFloat().

    For the UV_pan node, I don't think it is necessary to use it. You can change the Offset via material.SetTextureOffset on a script. This way you have more control on it since you can do anything as long as it is mathematically possible.

    It may be possible to do it all in a shader though, but it is most likely harder than going the javascript/C# way.
     
  38. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Strumpy looks very cool. I definitely have to try it out on my latest project.
     
  39. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    Check the ZTest setting. I can't see the shader network or params clearly, but it looks like your shader is writing a z value for the clear parts.
     
  40. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    563
    Hi,

    I'm not working on mobile or anything and I do not really care about performance for the moment. Is there a way to have a glow setting on a shader?

    What I'd like is:

    1. Have the emissive to fade out smoothly to give it a bloom/glow effect like the one I attach on the camera, but only for one object (ex: lightsaber). Is it possible in strumpy?
    2. Have the emissive work with the lightmapper. Even if I add the unity EmissionLM parameter and set it to 1, it doesn't work at all... Any clue?

    I'm working on a Hologram shader that currently looks like this (the model comes from the asset store and is not mine. Only the shader is made by myself).

     
  41. roach_779

    roach_779

    Joined:
    Aug 2, 2012
    Posts:
    29
    Thanks for the info. I'll look into it...scripting is not something im comfortable.
     
  42. EhsanNeo

    EhsanNeo

    Joined:
    Aug 22, 2012
    Posts:
    17
    You can just right click on image and click view image .

    I have tested the other settings for Ztest but didn't work Here I post the image again :


     
  43. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019

    If you want to have bloom and glow on your model, you have to enable HDR in the camera (if you have Unity Pro)... in my shader, I have the emission set to a mask in my diffuse :) so it is possible and you do have Emission LM, which is good... for the shader to work with beast, you have to have the tag "Self-Illumin" in the shader name. It took me a while to figure this out too... but it works :)
     
    Last edited: Aug 23, 2012
  44. thomaslilja

    thomaslilja

    Joined:
    Nov 11, 2010
    Posts:
    9
    Hi there!
    Sorry to get in here and disturb with a n00b questions.

    So what i really want to do is to drive the Spec and amount of Reflection (cube) with the R channel in a texture. With the G channel i want to drive the mipsteps of the cube map to get blurry reflections AND also connect it to Gloss.
    Haven't decided yet what to do with the B channel. Maybe alpha.

    I have several issues. The first one is that my reflection gets distorted when i try to make it become affected by the normal map.

    The second one which result in a crash is when i connect the specular. I want both cube map reflection AND specular to be able to draw the light specular on top of the cube map reflections.

    Shader error in 'ShaderEditor/EditorShaderCache': Program 'vert_surf', output semantic attribute "TEXCOORD" has too big of a numeric index (8) at line 155

    Keywords: DIRECTIONAL, LIGHTMAP_OFF, DIRLIGHTMAP_OFF, SHADOWS_SCREEN





    Edit- It does work with a simple reflection node. But... It's not as nice :( We had a shader almost just like this for Killzone 23, i hope that Unity can handle it!
     
    Last edited: Aug 23, 2012
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    This usually happens when you run out of texture interpolators... I want to tile my textures and the model will turn pink... the one way to solve this is to use a Mesh UV node... do you plan on tiling your textures?
     
  46. thomaslilja

    thomaslilja

    Joined:
    Nov 11, 2010
    Posts:
    9
    @ Neptune: I don't want to tile the uv's, no. It's for characters that need a bit more love than the usual stone age Unity shaders. I've actually got a result that i'm quite happy with! I'll share it when i'm done of course.

    What doesn't work now is still the reflection. I want it per pixel so that it reads the normal map. How do you usually do that?
    Also, i need a way of controlling the mip maps of the cube so that i can get some nice blurry reflections. Any ideas?

    Thanks!
     
  47. thomaslilja

    thomaslilja

    Joined:
    Nov 11, 2010
    Posts:
    9
    Ok, the world reflection works! It was just my normal map that was a bit too simple. Now connected to a proper rendered map it renders beautiful!

    And, Neptune, thanks a lot for that tip about MeshUV! It works! I just skipped the UV connections from sampler2d and replaced them all with UV1 on the MeshUV.

    One more thing remaining. Blurry reflections. How to get to those mip maps. :confused:
     
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    I am still trying to figure that part out too... I added inputs to my shader that control the Fresnel of the reflections and gloss/spec... I haven't figured out how to do blurry reflections yet, other than blurring the cubemap which is virtually impossible at this point. And if you want realtime relfections, I have a script that I found in Unity Answers that allows that to happen... make sure your cubemap input is named "Reflective Cubemap"

    I would also put some fresnel in your shader for reflections...unless you want everything to have a mirror like quality...
     
    Last edited: Aug 23, 2012
  49. thomaslilja

    thomaslilja

    Joined:
    Nov 11, 2010
    Posts:
    9
    It's not impossible, that's the irritating part :D We used it at both Grin and Guerilla Games and the coders didn't complain about it being too complex. How the shader worked was that it took the already existing mip steps of the cube map and connected it somehow to a color channel. I'm just guessing here, but could we use texCUBElod(s, t) perhaps?

    http://http.developer.nvidia.com/Cg/texCUBElod.html

    http://msdn.microsoft.com/en-us/library/windows/desktop/bb509690(v=vs.85).aspx

    Yup, the reflection is getting some fresnel love but i have it slightly affecting the whole mesh as well just to make details pop out a bit more.
     
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,019
    Interesting...

    I am trying to figure this out for my shader... still trying to figure out how to make it work with glossy reflections... I can't wait to see what Stramit has in store for Unity 4

     
    Last edited: Aug 23, 2012
unityunity