Search Unity

Shader Forge - A visual, node-based shader editor

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

  1. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    Vertex offset is usually in tangent space. So, if you want to move a vertex out by grayscale 0-1 value (height) you multiply (height) by a vector3 that represents outwards (0,0,1). Plug that into Vertex Offset.

    Terrain and Alpha don't really work that well I think. You might get lucky, but it'd be easier if you could just blend to a solid color.
     
  2. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Did you find any solution to this?
     
  3. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    I am still trying to do it mate.
    I have taken a few days off from it to work on some more of my first chapter's scenes but I am still very much in need of it.
    I will need to get it finished before release, preferably before my next batch (my self-evaluation milestones).
     
    Gekigengar likes this.
  4. IL4Mi3y

    IL4Mi3y

    Joined:
    Dec 29, 2014
    Posts:
    38
    Another question.
    I created a depth alpha blend. It looks okay for me, but if I zoom in it starts looking weird.
    Does anyone have an idea why this is looking bad?

    Bildschirmfoto 2016-04-12 um 00.16.01.png Bildschirmfoto 2016-04-12 um 00.16.11.png
     
  5. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    wow we're going for the same lowpoly style lol

    Anyway, that seems to pop up as a Unity Rendering thing, I've got the same effect. Obviously check shadows are turned off, and maybe even go so far as to set the renderer for the water to be forward in case Unity just ignores everything and auto-calculates shadows for deferred or something.

    Also I think there's a render paths option in the top left above the scene view, where it says shaded. Try cycling through those, see if anything pops up.
     
    IL4Mi3y likes this.
  6. IL4Mi3y

    IL4Mi3y

    Joined:
    Dec 29, 2014
    Posts:
    38
    @Jesus
    This worked!
    I set the water layer in the directional lights to "ignore" and turned off the shadows on the water plane.
     
  7. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    Hi @Cactus_on_Fire,

    This looks fantastic. Quick question. When I download the build I am not seeing any executable. Is it a build or does it need importing into a new project with shader forge?

    Thanks

    doc
     
  8. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Nope. The executable "Smooth Grass.exe" is inside the rar file.
     
  9. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    Thanks for the reply. For some reason when extracted it hadn't included the exe in the extraction.

    Thanks.
     
  10. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
  11. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I started trying to get this going based off your suggestion, and the closest I can get is if I lerp a screen pos/scene color with some depth stuff so that distant terrain matches the skybox/background terrain. However, it appears I may need to do custom lighting (which I've since tried somewhat successfully) because you can see lighting placed down on top of the 'invisible' stuff.

    I'm also having problems with:
    - no shadows of any kind with either my custom lighting solution or the PBL version.
    - seeming inability to adjust anything at all with the BaseMap (it almost seems auto generated and ignoring whatever I do)

    Appreciate any thoughts/help!
     
  12. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Thanks doc :) Glad it worked out
     
    docsavage likes this.
  13. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Hard-Normal Shader

    Due to time-frame issues and money getting short (we have had several...um...snags), we have decided to follow a largely untextured approach, as this would negate the need for both texture sets, and even UV's in some cases.

    This means, I am now looking into ways to alter the graphics to our existing graphics.

    My main plan is a shader where I can change the colour of the object, add a details texture if required, and alter the smoothing threshold.

    I know this is possible with a shader, but I don't know ShaderLab, and after my first experience with it, I don't really want to go near it again.

    This brings me to why I am here (maybe I should have led with this):
    Does anyone know how to create a coloured shader with control over the smoothing threshold angle in Shader Forge?

    Thanks everyone in advance, I am trying to get this done as fast as possible :D
     
  14. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi. I'm trying to create a 'funhouse, distorted mirror' effect from a live webcam. Can anyone suggest whether this might be possible using ShaderForge? Are there any SF demos that use video as input and apply some type of distortion effect?
     
  15. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    I'm not sure if shader forge will accept video as a texture, but the workaround to that is to find some other way of displaying video as a quad or plane or whatever, aim a camera at said videoplane, and use Rendertextures (create rendertexture, assign the camera to output to it, and assign it to the material that uses your custom shader). I did that for another guy to help him with using movies as textures.

    For the distortion effect, that's easy. You'll basically be adjusting the UV mapping. Look for UV distortion and similar effects, you'll quickly get the hang of it.
     
  16. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    Hi. I hope someone can help with my following questions: how does ShaderForge handle tasks like depth mask / shadow only / light only - I ask, because this is very interesting in AR and VR related apps... example: A cube with this special shader should:
    • be invisible in general
    • hide objects behind it
    • recive hard/soft shadows from objects (= shadow only)
    I use such features currently in single shaders, but not combind - can ShaderForge handle this - optimised for mobile?
     
  17. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Is there any way to create a blend between 2 textures using object height?
    For example, I want to blend my floor texture (A), with my wall texture (B) at a height of 0.5 units.
    Is this possible?
     
  18. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
  19. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    Is this absolute height (in worldspace) or height from the object? Either way, look at the Step node. You would lerp between texA and texB by Step(worldspace.y, 0.5).
     
  20. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Thanks, but is there a way to make it kind of gradient or ease in to the blend, instead of have a defined line?
     
  21. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675

    How is the FPS on that ?
     
  22. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Is there a simple-ish solution for translucency (or any solution/example at all)?
    I can't find anything on Google, but I thought someone here may have something.

    Just to clarify, by translucency I mean solid objects that let light pass through them such as thin skin, candles and gems (I need this for a rock that needs light passing through it, and allows a light inside it to radiate out).
     
  23. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    On youtube there's a custom lighting tutorial for shader forge. it's really outdated, but what you want. It's got point lights (red and blur) and some cubes.

    Basically, make the custom lighting shader. Then remove the N(dot)L stuff. So basically attenuation and light color only. that'll get you the appearance of very clearish wax or smoke, kinda of.

    That's a good start. Work from there.
     
  24. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    64
    Dear members and developers,

    I am working with DAZ Studio, and with MCS characters. I haven't read the full thread, just ran it through, maybe I have missed it... Can someone help me with a good hair shader recipe? I have tried some free and cheap shaders already, but none of them worked well with DAZ and MCS hairs... Also, I'm totally new with Shader Forge, the most closest thing to this kind of shader making is maybe Unreal's material editor, but I don't know...

    Thanks in advance,
    VargaPD
     
  25. games_lam

    games_lam

    Joined:
    Nov 2, 2015
    Posts:
    8
    Hi all, I'm trying to use Edge length based tessellation but it seems to cause the geometry to wobble up and down in a wave like manner as the camera moves about. Is there a way to eliminate this effect? or is this the nature of edge length based tesselation? Thanks.
     
  26. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
  27. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Anyone know how to make this kind of outline glow? (It becomes more transparent as it goes further from the mesh)



    I could simply achieve this with billboards, but the object is a complex animated mesh.
    (Animated character).
     
  28. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
  29. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hello,

    is there a solution for bloom without HDR. Selective Glow asset has a such shader, but they do not support the PBR shader, and I need the metallic map and additional my own maps too. HDR Glow/Bloom is not that good for my RTS game, I would like to bloom my emission maps and lightly glow/bloom the environment, when the sun shines intensive.

    My problem is that bloom script on camera without HDR over glow/bloom the environment when the sun shines to intensive, and if I lower the intensivity of the bloom, then the lamps on my buldings does not bloom enough.

    Now I have 4 possibilities:

    1. Make for all my emission map materials an own material and use the Slective Glow asset shaders on them.
    2. Lower the max intensity of the sun and set the max intensity for my emission map shader.
    3. Use HDR and lower the intensity of my lamps until it match my desired lamp bloom and terrain bloom.
    4. Or someone tells me how to bloom without HDR :)

    I read in the Unity docu that the HDR is not supported on all video cards and it needs more VRAM and performance on the video card. I make a game for desktop, am I have to still care about the performance reasons?
     
  30. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
  31. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
  32. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    So create the shader. It's very legible.
     
  33. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    The first node where the white begins to split into lines, I cannot work out what it is, not sure what kind of monitor your using, but it is not "very legible".
     
  34. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I have to agree. I can't figure out how to read it either.
     
  35. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    The Floors or the Fmods?
     
  36. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    It cannot be an Fmod, the image stays black when I use an Fmod.
     
  37. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    You can't trust the current version of Shader Forge's node previews for this. 600 is too high a resolution. Fmod+Floor definitely produces striping like in that shader:

     
    hopeful likes this.
  38. knotFF

    knotFF

    Joined:
    Apr 13, 2013
    Posts:
    66
    Is it possible to project different colors via World Space or Local Space, including different colors for the back and front faces?
    At the moment I can make it work using 3 color on XYZ, say Red on X, Green on Y and Blue on Z, but this means that if applied to a cube there will be 2 red, green and blue faces no this cube.
    What I need to be able to add 6 colors Top, Bottom, Front, Back, Left, Right. Any suggestions?
     
    Last edited: Apr 24, 2016
  39. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Is this possible? anyone?
     
    Last edited: Apr 25, 2016
  40. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    64
    Any idea?
     
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
  42. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    64
    Thank you. Well, I was not enough specific, I'm looking for a bit more realistic hair shader, than they provide with the MCS pack (some kind of Volund one). I didn't want to use toonish look, but I think I have to consider it :/ It could be easier to work with, than realistic looks.
     
  43. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    What I was thinking is it could get you started on making your own hair shader. I think there is some interest in such a thing, so if you end up with what you think is a nice, realistic shader, please post your graph in this forum or on the Shaderforge wiki.
     
    VargaPD likes this.
  44. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    64
    Oh, I see! Very good idea! Thank you :)
     
  45. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    64
    Just one more question (like Columbo). Where should I start if I want to tweak Opacity, Cutout, Fading, etc options? I have searched these words in the wiki: Opacity, Cutout, Cutoff, Cut-out, Cut-off, Translucency, Transparency, Transparent, Fade, Fading - with no useable results.

    Only found Intersection Fading

    Thanks, in advance
    VargaPD
     
  46. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Working on a Subsurface Scattering shader. Although it requires you to use two directional lights.
    Works with point lights and spot lights as well.

     
    Last edited: Apr 25, 2016
  47. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    First off, you've found this link, right? http://acegikmo.com/shaderforge/nodes/

    Second, I suggest you look at some of the different examples out there and play with them. For instance, if you want realistic hair, you'll probably want to use lighting for PBR, and so you'll want to research, looking for examples that use that.
     
  48. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    64
    Yes, thank you. So, the only way is researching, right? I have little experience in PBR, but I know the basics. Thank you, again.
     
  49. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    You can do this by using the normal dir node. The normal dir node outputs values from -1 to +1. Setup conditions based upon that.
     
  50. Pixeldamage

    Pixeldamage

    Joined:
    Sep 6, 2010
    Posts:
    52
    I've made a sprite-sheet shader using Shader Forge and it works fine in the editor and on Samsung S6. However on the S3 the image pixelates as the offset moves along the columns/rows. The pixelation gets progressively more blocky each time. I'm wondering if it's an issue with Modulo / UV offsets losing accuracy on older devices? I've got all the precision set to max in SF (32bit float) though I assume this gets altered at build time per device. Is there anything I can do in SF to rectify the issue?