Search Unity

Shader Forge - A visual, node-based shader editor

Discussion in 'Assets and Asset Store' started by Acegikmo, Jan 11, 2014.

  1. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    you will like it!
     
    Acegikmo and Deleted User like this.
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahh yeah also, i haven't seen you on the forums in ages ShadowK so i dunno if you've been following this thread, but its a treasure trove of great contributions by some really talented people, def worth a read through
     
    FreakForFreedom likes this.
  3. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    Honestly, you will love it. I can't work without it anymore, I use it everyday. I love Shader Forge. I live Shader Forge. :D
     
    Acegikmo likes this.
  4. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    This recent wave of nice words rather than bug reports is nice - thank you <3
     
  5. Deleted User

    Deleted User

    Guest

    Well you're offering a service that's integral to the engine, I'm surprised Unity hasn't presented you with a massive fat check and begged you to sort it out for them yet.

    I fully understand doing all of this couldn't be easy and that $90.00 is nothing compared to the amount of time saved by us doing it ourselves. So you've done an amazing job, you should be proud :)..
     
    Acegikmo and Marco-Sperling like this.
  6. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    What ShadowK said! Also, we're only posting so much about bugs because we use Shader Forge so often. I can get that this might be tedious to you from time to time, @Acegikmo . But be assured - we like every moment of it!
     
    Acegikmo and Marco-Sperling like this.
  7. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    16
    Hi,
    I recently got Shaderforge and I'm trying to make custom lighting.
    My textures are generally 32x32, and super smooth lighting kinda looks out of place.
    So I'm trying to get the average light per pixel in my texture, but I can't seem to figure it out. Googling doesn't really seem to work as I generally get hits about pixel shaders.


    This is where I'm currently at, I'm also going to put a specular map on it for experimentation but after I figure out what to do with my light before I multiply it with my texture.
    Anyone have any tips?
     
  8. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    That's a very tricky thing to do, because shaders are inherently per-pixel and per-vertex - not per texel.
    You might get a pretty neat look if you vary the glossiness per-pixel though, with point filtering on the gloss map.
     
  9. Deleted User

    Deleted User

    Guest

    @Acegikmo

    Are you going to release a new version to fix all these bugs?
     
  10. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    I'm not sure what you're asking. This basically translates to "Are you going to release updates?".
    I can't fix *all* the bugs ever reported, because the amount of reports far outnumber the amount of time I have.

    Will I fix the bugs you specifically reported as of late? Yes, probably, at some point.

    In the meantime, please don't nag. I've got a ton of work to do that isn't Shader Forge, along with the fact that people at home aren't feeling too well at all at the moment.
    I've got a project that I'm currently very late delivering, along with another project I really have to get going on.
    On top of that, I'm going to teach students Unity and C# in about a week, having no course planned out at all.

    So, yes, probably, but I'm stressed about other things at the moment, so I won't have time for it right now.
     
    FreakForFreedom and Deleted User like this.
  11. Deleted User

    Deleted User

    Guest

    Yes i was referring to all last bug in this thread.
     
  12. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    @Acegikmo no worries, we all understand. Everybody's got a life outside Unity3D&Stuff so it's totally understandable if you need to take some time off. And it's not like Shader Forge doesn't work at all and it's already pretty amazing how fast you throw those patches out. :)
     
  13. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
  14. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Yes, that's possible, but in that case, the UVs has to be different for each barrel in the mesh data, not the shader.

    (Unless the shader randomizes UV offsets based on position of the object, or similar)
     
  15. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Hi Acegikmo !
    I'm recently discovering you're amazing product :)

    However, I have a Strange bug. I'm doing a simple double sided transparent shader :



    But when the camera is going inside my object (a kind of simple tunnel), then the up and left side are not rendering properly :


    I tried to play with a few settings but nothing work :/

    Is this a bug ?
     
  16. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    (Unless the shader randomizes UV offsets based on position of the object, or similar)
    yes it's somethinnk's like this i have think's but object will be move it's maybie complexe to do
     
  17. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Working on a Nebula shader

    crits are welcome : )

     
    shaoyongzhang likes this.
  18. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @Cactus_on_Fire Want.
    It looks like you're in a tunnel and a turn left goes outside. maybe some stars in and around it would help sell it as a nebula. That and a quick google image search, it seems the nebula has a lot of shading where most of the images had little to none of it.
    How procedural is this?
     
  19. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Oh it's not procedural at all. It's a giant 30K poly, cloud like mesh with some self illumination based on an inverted AOS. I'm trying to get it to appear like dusty clouds rather than a block of mesh.

     
    shaoyongzhang likes this.
  20. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    AOS? I would not have guessed mesh. Hmm... i still think stars would help with some transparency on the nebula. and maybe some noise grain texture for dustyness.

    Or.

    looking at it more, while awesome, the mesh might not be the way to go but use it as an emitter for a particle system. and have the particle texures have something like the edges-ish of the shapes in these. http://imgur.com/a/xqSwR as im thinking about it you could try the edges-ish tex on the mesh as well. (if you have After effects i can show you how to do the effect)
     
  21. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Oh yeah I tried the particle emitter when I began. But I don't think there's a way to emit the particle with the material texture color. It would work great in theory.
     
  22. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    It looks lovely, has it any sort of animation?

    Out of interest, and for a smidgen of self serving, im assuming some of you have played the recent DMC. There's a fight with an extremely foul mouthed female insect maggot woman thing, as well as being entertaining, it has a beautiful looking shader trick going on that i'm puzzling how to imitate where there is a maggot-like translucent outer skin and a glowing inner 'organ or internal body moving and pulsing inside, under the surface, it looks amazing (the game actually has a host of amazing shader work going on) does anyone have a thought on how it might be achieved?

    For sheer entertainment value here's a video, watch for bad language, kids

     
  23. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Also i think Particle Playground has exactly the sort of functionality that might be useful here
     
  24. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Nope, no animation.
    Looks like they are masking the sparkly stuff with a texture blended fresnel. They look like they are a part of the mesh.


    Oh yeah, PP looks like it does the trick ! I'll check it out soon.
     
  25. marggob

    marggob

    Joined:
    Feb 24, 2013
    Posts:
    65
  26. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    Is it possible to create a shader material for some rocks that I have so if I scale the rocks up or down the texture size remains the same? By that I mean as the mesh size increases the texture doesn't stretch or grow with it but remains fixed. Is that possible? Because if I can do that then I am most defo gunna buy this! It seems amazing!
     
  27. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151

    These are based on Command Buffers. You can already implement the blurry transparency if you use the command buffer from the Unity demo and call it from a Global Texture in Shaderforge.

    If I recall correctly the texture name is _GrabBlurTexture, so create a Texture (not a Texture2D) Node in Shaderforge, right click -> Make Global, and name it _GrabBlurTexture. Implement the command buffer CommandBufferBlurRefraction.cs from the Unity demo with the SeparableBlur.shader from said demo in your object/scene and it should work.
     
  28. marggob

    marggob

    Joined:
    Feb 24, 2013
    Posts:
    65
    Thank U. I'll try to do it myself. But if it was implemented in ShaderForge - that would be cool. ))
     
  29. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Any chance you'd be willing to post this as it is? This looks really cool and I'd love to learn how it works.
     
  30. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Oh it's literally nothing more than a dozen of mesh layered on top of each other. The bottom layer is opaque, and the rest are alpha blended. Uploading would take time because all the textures are TGA and each one is like 60 megabytes

     
  31. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    You only need to call the global texture in Shaderforge. Because Command Buffers are called from a .cs file and shaders are just shaders, you need to setup the command buffer manually. You can't have Shaderforge attach command buffers automatically to a shader without some crazy shenanigans.

    What you could do is implement the blur functionality directly in the shader, which is possible in Shaderforge, but that would be extremely slow and inefficient compared to using a global texture called from a command buffer.
     
  32. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Oh yes. Works much better when it writes to the Zdepth. No more transparency sorting issues.

     
    lazygunn and Acegikmo like this.
  33. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,141
    Yep! There's two different ways to do it. If you're on Unity 4.6 or earlier, you'll need to put a code node in returning Unity_scale.w. However, you need to scale your rocks up uniformly along all axises. If you're on 5.0 or later, there's a native scale node you can use that'll let you scale them in any direction.
     
  34. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
    Hello,

    I'm just wondering, is it possible in shader forge to create a similar shader to Unity 5 Standard with a custom cubemap input slot? Would that be difficult?

    I don't own shader forge yet, but that is pretty much all I require to have a cubemap overide on a per material basis instead of mesh like default Unity5.
     
  35. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Sure - there's a cubemap node and a main node input called "diffuse ambient light" for diffuse cubemaps, and a "specular ambient light" for specular cubemaps. Be sure to plug the normal direction into the diffuse cubemap, and the view reflection vector into the specular cubemap.

    You may not get all the benefits of PBR though, so, you might have to connect the MIP input as well in the specular cubemap to make it vary based on gloss/roughness
     
  36. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,141
    Alright, I have a bit of a workflow question sort of thing here because I'm, again, working on some weird niche stuff.

    I have some clouds that look like this in photoshop:


    And this in Unity:


    The idea is that I use a channel blend and have it so I can set the highlights, midtones, and shadows from the material or a script to have static clouds but a dynamic day/night cycle where they still present the right colours. Unfortunately, Unity cubemaps kinda S*** the bed resolution wise when I add an alpha channel, hence my use of a multiply blend there. Is there a way to just remove the image black but not blend out the clouds if I make them black?

    edit: ...perhaps it would help if I remembered to attach the shader tree.



    edit 2: With a little experimenting, I got it to work.

     
    Last edited: Mar 29, 2015
    shaoyongzhang likes this.
  37. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    Having a few issues with following the custom Blinn-Phong tutorial. At the first stage this is the result I get in Unity.



    Not sure what is going on exactly haha.

    I can replicate this issue with the Light Atten node in different scenarios. I wonder if this is a bug or error on my end with my lighting setup but I would still appreciate any assistance!
     
    Last edited: Mar 29, 2015
  38. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Slightly upgraded the nebula. Now it looks like this when there's a light behind it.

     
    shaoyongzhang likes this.
  39. Plutoman

    Plutoman

    Joined:
    May 24, 2013
    Posts:
    257
    Just checked back in, and thanks for the tangent/normal/worldspace tag. Appreciate it!
     
    Acegikmo likes this.
  40. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    Looks really nice as a nebula but i feel you accidentaly created a fur shader :)
     
  41. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Haha. I actually tried to use fur shader to blur the nebula clouds. Ended up doing the same thing manually.
     
  42. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    Really like your creative geometry/shader tricks... i used a very similiar idea for clouds and it looked stunningly realistic but the transparancy overdraw was just to slow to be used in a production unfortunately... layered transparent meshes open so many possibilities... i wish the overdraw would not be so expensive. Since i saw your nuke i always check out what you came up with when i see a new post of yours :D

    btw. do you use fresnel fading? I found this can help to reduce the line artefacts a bit.
     
  43. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Dude :v I'd like to see those clouds !
     
  44. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Also there's now mixed layers in the cloud mass. Definitely looks more ghastly now.

     
    shaoyongzhang likes this.
  45. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    I would appreciate any help with my problem I posted above as I am still having no luck in resolving this issue. :(


    Also is there no way of getting all models that use the shader to update in the editor as I make changes to the shader in Shader Forge? Because as I adjust the color in Shader Forge the assets with the shader applied don't change. They only change color when I adjust their values in the inspector section of the asset when selected? Or is that just how it works! :D
     
    Last edited: Mar 30, 2015
  46. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,141
    That's just how it works, I'm afraid.
     
  47. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    That's fine now that I understand that I am good with it! Just still having issues with my other problem further up where I was following the tutorial on creating a custom Blinn-Phong and the lighting in my scene on the cubes and spheres looks completely different and messed up.
     
  48. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    Has anyone been getting an issue where Global Textures reset to Non-Global everytime you open the shader in Shaderforge? It's been like this since 1.06 I believe, not sure if it was introduced with Unity 5 or a Shaderforge bug.
     
  49. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    I have this working so far with my trees, rocks and other assets. Light wrapping but I am really trying to get a SSS type effect on the tree leave geospheres that I am using but all my assets are low poly and stretched UV's (On purpose for the style I am going for). Will this effect how the shaders work? I tried using a Fresnel effect on them but it never showed up on them but it did on the normal unity sphere and cube at certain angles. I was planning on a slight Fresnel effect with fake SSS on the leaves so they seems like light is passing through them even though they are solid objects / assets. But the issue I have had above further up this page is preventing me from getting these results. Almost like my lighting doesn't like working. My project is setup for full dynamic lighting deferred rendering but I have tried both deferred and forward and neither have any effect. Any assistance would be appreciated.




    Leaf Shader which currently works - Wanting a more SSS type effect
    All I can think of is having an emissive setup which increases in power when light is on it and decreases when light isn't hitting the surface.



    Love this asset. Feels like UE4 materials but better! Haha!
     
  50. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    I'll look into both of these! Thanks for the heads-up
     
    FPires likes this.