Search Unity

Shader Forge - A visual, node-based shader editor

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

  1. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,363
    I see, so i could get a mid ground effect, which is cool :)
     
  2. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
  3. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    I apologize if this has been asked/answered in previous pages of the thread (not going to wade through 60 pages of it, sorry), but what support does ShaderForge have for multiple UV sets?
     
  4. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    SF comes with a UV node that let's you chose which UV set you want to work with. UV0 oder UV1. And you can have both inside the same shader graph.
     
  5. Deathnote

    Deathnote

    Joined:
    Nov 26, 2013
    Posts:
    52
    Plz Someone Help me

    i have this error

    file my shader
    https://mega.co.nz/#!uUsHnLZS!kv3p1G...98K6plkRySspMg


    i cant do shader wotare like this http://forum.unity3d.com/threads/222...=1#post1569506
     
  6. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Do not know if this was asked already but can I use the shaders I make with my package that I will sell on the asset store. The package is an environment pack. Thanks.
     
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,363
    I think you can sell them by default, otherwise why buy the package if the shaders cant be sold with your game for example ?

    As long as you dont sell the pack itself, the results can be sold i guess, it is like selling 3D items you make with 3D software for example
     
  8. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Thanks for the reply. That is what I was thinking. Just purchased SF and have not used it yet. Do the created sharers work on their own or do they need the SF folder?
     
  9. Beardbotnik

    Beardbotnik

    Joined:
    Jul 27, 2013
    Posts:
    49
    Man...I wish I had this when I started my project, I just replicated a layer slice shader I was using and got it working with camera movement and everything in a matter of minutes.
     
  10. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    Can i use sf together with substances now or maybe later?
     
  11. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,211
    Is it possible to make a tessellated skin shader with your system? Is Skyshop integration working, or is that still in development? Thanks.
     
  12. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Hey I've been using shader forge for awhile and I think it's great.
    I have a problem though with my model and lighting.
    So here is how I want the specular to look with normal maps applied -

    But it looks like this -


    Any help?
     
  13. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    102
    humm.. I don't think it is shader problem, maybe your texture...

    Did you try to change the compression of the texture? Try true color.
     
  14. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    You appear to be correct, perhaps there are small in differences on the normal map texture, slightly affecting the shading. I'll see if I can fix the problem :D True colour doesn't appear to change too much.
     
    Last edited: Apr 8, 2014
  15. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I downloaded and read the readme. For selling models using SF shaders on the asset store Joachim said this:

    If you are creating assets for the asset store using SF shaders, people will probably want to know if the shaders are created with Shader Forge,
    so they know they can easily be modified!
    I would also be super happy if you were to credit SF in the asset store description,
    linked to either the website http://www.acegikmo.com/shaderforge/ or the asset store page http://u3d.as/6cc :)

    Put it on for people who did not know. This is great. Will help my models tremendously. Thank you very much Joachim.
     
    Last edited: Apr 8, 2014
  16. donzen

    donzen

    Joined:
    Oct 24, 2009
    Posts:
    54
    It looks like JPG compression, try to use a better format like PNG or TGA.
     
  17. Deathnote

    Deathnote

    Joined:
    Nov 26, 2013
    Posts:
    52
    someone can help me ?
     
  18. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    I found the problem.
    BTW, I always was using PNG.
    It appears the blender bakes normals strangely, so I decided to learn how to use Xnormal, which has given me a very clean result.


    I be using Xnormal from now on :)

    Loving shader forge as well
     
    Last edited: Apr 8, 2014
  19. Leanimal

    Leanimal

    Joined:
    Sep 1, 2013
    Posts:
    28
    Is it possible to create a shader for use with projectors in SF? i.e one similar to the Projector/Light and Projector/Multiply shaders included in the Unity standard assets package?
     
  20. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    This is probably due to OpenGL / DX differences. The sign output here may help you: http://acegikmo.com/shaderforge/nodes/?search=projectionparameters

    Use it to flip the Y axis of the UV coords.

    You have properties using the same name, which breaks the shader. Use unique names for your nodes

    Yep! It would be nice with a credit mention though :)
    And if your customers use SF already, it's probably nice for them to know that they can tweak the shaders if needed
     
  21. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You can use shaders created in SF on their own

    You can use textures generated by substances, yes :)

    Tessellated skin shader - Yes, if you're targeting Windows or Xbox360. Unity only support DX tessellation, but not OpenGL tessellation, and DirectX is owned by Microsoft.

    Skyshop integration is done on my end, and Marmoset is pretty much ready too :) They just need to get their next update out, which I think is pretty soon.

    Possibly, I haven't looked into those shaders yet actually.
     
  22. Deathnote

    Deathnote

    Joined:
    Nov 26, 2013
    Posts:
    52
    its WORK !!! Whoo, But Looks unrealistic, anyone have any ideas how to make better?

    SreenShot
    $sf_watershader_test2.jpg
     
  23. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,211
    Is there a way to add smoothness or rounding when using tessellation, similar to how unity has their setup? I want to use it for character meshes.
     
  24. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,211
    How did you achieve the real-time spherical lights in this vid?
     
  25. bcoyle

    bcoyle

    Joined:
    May 22, 2013
    Posts:
    57
    Is it possible to control normal map intensity? ie, make the normal map have more or less influence over the 'texture' of the material?
     
  26. trasher258

    trasher258

    Joined:
    Apr 2, 2013
    Posts:
    21
    Hello, I got a little brain-scratcher for you because I'm certainly stumped. I'm trying to use remap a gradient in order to animate a pulsing effect but instead of just fading back and forth, I want it to look like it continuously looping. I'm wanting to be able to apply this for getting an appearance of electricity pulsing on a mechanical character.

    In more technical terms, I guess if the gradient value is greater than one, subtract down to 0; if it is less than 0, add up to 1.

    Here's what I got so far: $sf_gradientmapping_482014.png

    Right now, I'm just trying to get it to work before I bring it over to the final shader. Got any ideas?
     
    Last edited: Apr 8, 2014
  27. AndreasAustPMX

    AndreasAustPMX

    Joined:
    Mar 2, 2014
    Posts:
    9
    Hey, how can i use just one shader for multiple material ids ?
     
  28. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,363
    I asked the same, the effect is too cool to miss and we are going to get a tutorial on this soon :)

    Cant wait
     
  29. Deathnote

    Deathnote

    Joined:
    Nov 26, 2013
    Posts:
    52
  30. trasher258

    trasher258

    Joined:
    Apr 2, 2013
    Posts:
    21
    As far as I know, you're going to have to create multiple materials for each material id slot. You can then use the same shader for each material. If you're trying to use a shader effect that needs to be in sync, you might want to try re-export the model with no ids or perhaps make an offset parameter in your shader and eyeball it.
     
  31. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Is it possible or will it be possible in the future to create shaders for tree bark and leaves that will work with the Unity terrain system?
     
  32. vidjo

    vidjo

    Joined:
    Sep 8, 2013
    Posts:
    97
    Is there stencil buffer support?
     
  33. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Not at the moment no
     
  34. vidjo

    vidjo

    Joined:
    Sep 8, 2013
    Posts:
    97
    Plans for the future?
     
  35. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Lerp towards a Vector3(0,0,1) to lower the intensity of a normal. (Though this should be done in the texture itself to save computation power)

    Sounds like you want a frac node?
    I think this will help: http://acegikmo.com/shaderforge/wiki/index.php?title=Waveforms

    Possibly, we'll see! I did start implementing it, but I ran into some issues and started working on other more important things
     
    Last edited: Apr 10, 2014
  36. Mikael-Persson

    Mikael-Persson

    Joined:
    Jul 14, 2011
    Posts:
    29
    Hello,
    I have what I hope is a simple question. I would like to tile U and V independently. I watched your blend tutorial where you showed how to tile and image uniformly. But I'd like individual control over U and V. Piping U and V on their own into multiply nodes and then multiplying those nodes gives me a black and white image. How should I go about creating something like that?
    Thanks for the help!
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Just multiple your node by a Vector2 and the x/y component of the vector 2 will control the U and V independently.
     
  38. trasher258

    trasher258

    Joined:
    Apr 2, 2013
    Posts:
    21
    Wait, I did something similar with a light ramp shader using a sample 1D texture... fancy that, I already solved my own problem and didn't know it. :p

    In the spirit of sharing knowledge, here it is. $sf_diffuse_4102014.png

    Good thing I took a screenshot of it because now I can't reopen it in Shader Forge. There's a rogue node showing up in the parameter area that isn't even in the graph so maybe that's causing it.
     
    Last edited: Apr 10, 2014
  39. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    I found a hell of a performance bug just now. When a slider has a min value that is higher than its max value, it completely bogs down SF and Unity in general.
     
  40. Mikael-Persson

    Mikael-Persson

    Joined:
    Jul 14, 2011
    Posts:
    29
    Interesting. Thanks for the input! However this Vector 2 node is now buried inside of the shader. I would like to expose the Tile control node to the coder.
    Is there some operation that can put two value nodes into an array so I can use them instead? Or is there some other better method of achieving this?
     
  41. Mikael-Persson

    Mikael-Persson

    Joined:
    Jul 14, 2011
    Posts:
    29
    A bit of googling told me to use an Append node. That will combine two inputs into one user controllable vector!
     
  42. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    I've run into a strange little thing I can't seem to fix.



    This is my (incomplete) Wind Waker style ocean shader and this is the texture it references:



    The later version will have a more logical blur to it, but for now what I'm doing is basically just using a sine wave and a simple remap and round function to make it so the waves pulsate:



    However, if I change the value in that clamp to be anything greater-than-or-equal-to 1.5, I get some weirdness going on when I try and change the opacity:



    So what incredibly obvious detail am I missing here?
     
  43. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    Normal maps do not work on terrain objects, So if you are planning on creating a complex terrain shader please bare that in mind, wondering if there is any code I can inject into the shader to force rendering of normal maps on
     
    Last edited: Apr 11, 2014
  44. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Quick question: how would i go about pulling a specific pixel colour/float4 from a texture?

    (For example, I'd like to get the value at position (3,7))

    Any suggestions ? Can the new code feature use tex2Dlod?
     
  45. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    http://acegikmo.com/shaderforge/wiki/index.php?title=Basic_Terrain_Setup

    Just use a regular Texture2D node, and throw in the UV coordinates you want to sample it at. Mind that they are not in pixels, they're in normalized coordinates. 0,0 is the bottom left corner, 0.5,0.5 is the center of the texture, 1,1 is the top right corner.

    Yes, plug in a texture asset node into a sampler2D input, and you are free to use it :)
     
  46. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    The terrain system seems to be a mess. Considering writing my own terrain plugin by now...
    The shader requirements and interfaces you need to match when adapting it for terrains seem a bit silly.
     
    p87 likes this.
  47. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Maybe, but I'm not sure. Normals maps are usually in tangent space, and given the terrain objects don't have tangents, things get trickier quickly.
     
  48. P1st3ll1

    P1st3ll1

    Joined:
    Dec 13, 2012
    Posts:
    69
    Hey guys !
    I'm still creating that water shader u_u
    But I'm almost done... I just need to know, how do I invert the V coordinate for the reflection ?
    I got it working but I need to invert it's position.

    These are the nodes:


    Here's the result:


    Don't mind the eyed-terrain XD
     

    Attached Files:

    Last edited: Apr 12, 2014
  49. Deleted User

    Deleted User

    Guest

    I too would love to know if it's possible. I spent several hours trying, but eventually gave up. Unity's terrain system is severely lacking, but it's still extremely useful for easy billboarding and LOD management.
     
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'm not sure of results but the writer of Relief Terrain Pack, as far as I can see, has normal maps working both on detail maps (as part of parallax occlusion and parallax mapping) and as a global map applied to the terrain, he may be able to shed light on the situation, although i don't really want to be the instigator of him being sprung upon unware