Search Unity

What shaders would you guys want?

Discussion in 'Shaders' started by tatoforever, Aug 28, 2012.

  1. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    It's using the same UVs coords as your main texture. You want some options to change the tile amount (instead of depending on mainTextures UVs) something like that?
     
  2. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    Here are some screenshots of the problem. First picture is the standard diffuse-detail shader.



    And this next one is your shader from the post above.



    I'm using a tiling grid texture as a detail map.
    Can you see how the detail map in picture 1 obeys my tiling settings, and in picture 2, it doesn't at all?

    EDIT: Just seen your post. I think this post should explain it a bit better.
     
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Wait i have to get out for a moment when i get back I'll add some UVs options for you to tile it up.
    Cheers,
     
  4. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    Cool stuff- no need to rush :)/
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Here is: View attachment $Reflect-BumpSpecDetail.shader
    I've now added 3 new options (related to the Detail texture). Two of them is a tilling option because that shader is already big and Unity doesn't let me add any more input UVs, so it's a little hackish but it works the same way. Basically I'm using the UVs coordinates of your main texture but you can override it's tilling settings with Detail Tilling X and Y properties. So tweak till you get what you want.
    I've also added a Opacity factor in case you want to adjust the opacity of the detail texture. All those inputs are in float so you can see the exact value you are giving to your material. You can also try negatives values for more wtf effects. :D
    Let me know if it does what you need? :rolleyes:
     

    Attached Files:

    Last edited: Oct 27, 2012
  6. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    It's okay, but still not quite there. Look at how the standard diffuse-detail blends the main and the detail texture. It needs to be more like that, so it won't need the opacity.
     
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    In my previous version I was adding colors which creates a more bright results instead of multiplying because the results was darker as the stock diffuse-detail does multiplies colors. But if that's what you want: View attachment $Reflect-BumpSpecDetail.shader
    [EDIT] You can always get back to the color addition version by un-commenting the line 47 and commenting line 48.
     
    Last edited: Oct 27, 2012
  8. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    A replacement for Unity's default Diffuse shaders. They are bloated and too heavy. Particularly, I would like something like allows for first person views.

    But I'd gladly take a better water system over that. Unity really needs one.
     
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yeah, default shaders are large because they get compiled to support all platforms, all lighting, etc. General use case mind you. It is possible to just write platform/game specific shaders without any lighting stuff (or preselect a number of lights that you want). It's always possible but if you want something fast/small that works everywhere then i don't see how much it would be simplified. At Unite12 there was a talk by Kuba and Tim that explains how to customize shaders and make them more platform/game specific. It is an interesting talk for those willing to get dirty with shaders in Unity.

    I have plans on to make a CE3 ocean water system like (if possible with Tessellation) but I'm waiting to finish our current project (Forgotten Memories) which should be due later this year.

    Btw what do you exactly mean by "Allows for first person views"?
     
  10. Asimov500

    Asimov500

    Joined:
    Oct 21, 2012
    Posts:
    3
    Hi tatoforever,

    Not sure how old this thread is, but I am after something specific.
    I want a neon glow, but using a lightmap image so that it only glows in specific places using different colours. It's kinda for a spaceship.

    So I need glow, which possibly gives off a bloom, then specular, normalmap and diffuse of course.

    Also I don't like using the alpha channel to do my specular and glow maps. I prefer different images.

    Is this possibly too hard?

    I am using a shader that Horror posted on here at the moment, but it hasn't quite got all the features I want yet.

    Asimov
     
  11. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Asimov500,
    That's quite easy but I'm getting to bed right now, I'll try to work that out tomorrow when i get some time.:rolleyes:
     
  12. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Hello, I'm just trying my luck in here :)
    I'm working on a little game with DanieleGiardini (awesome HOTween maker) and it features (would be awesome if it could feature) heavy use of paper overlays.
    Basically I want to apply really tiny 64x64 textures to all of the ingame elements (border, cubes, bouncer) and then overlay different kind of textures (256-512pixels in size) to get the paper-look.
    I managed to get the ground and border done in unity already, with the use of the diffuse-detail shader but now we lack shadows. So I would like to bake in some light/shadow information, therefore calling for a help on a "diffuse,detail,lightmapped" shader.

    BUT:
    Even cooler would be to have the option to not only use black/white paper overlays but to have colored ones that overlay/blend/multiply similar to photoshop layer actions. I happened to stumbled over some trivial information here and there, but these are too much magic overpowering my tiny brain.
    Also the overlays would be bigger in size than the original diffuse texture, meaning it'd be kinda counter-idea to the basic premise of detail textures, I guess. So if there are better terms, solutions, ways of doing that, that'd be awesome.
    Moreover it would be superawesome if all of this would work on a mobile platform as well - much laaaaaaater on in development :)



    Since I fail at explaining my weird ideas every so often, let me know what I need to make extra clear. Would be awesome if this could be realized :)
     
  13. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Acumen,
    It can be accomplished with the build-in detail texture, just change the tiling properties of the detail and you are good to go. On top of that if you want non uniform detail values on your model you can also mask the detail texture with (I've been doing that on our current game to remove main textures tilling repetitions) and it works great.
    It will work on mobile platforms too. If you need something a bit more optimized (no lights, no-thingies), post your request in detail. ;)

    @Asimov,
    I completely forgot about your request! Sorry about that. I'll try to work that out later in the day (when i get some free time) but just in case, keep posting so i wont forget again! :rolleyes:
     
    Last edited: Dec 1, 2012
  14. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Aaaand, the lightmap ? How can that be put into the diffuse-detail slot ?
    Aaaaaaaand the colored texture overlays ? Possible and performant ?

    Any cool information on that :D
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Oh wait, you want a custom lightmap texture property or just support Unity lightmap? Also, your color overlay is for the final color (all textures combined) or for any specific texture input? You may probably want to explain what do you want the color overlay do exactly? Any image or video reference would be nice. :D
     
  16. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    I would like to have a lightmap slot, where I can put in my prebaked lightmap in a 3rdparty application.
    Here's a mockup of the situation.

    Shader reality is what we have going on in unity at the moment. It's a tiny diffuse texture and a 512x512 detail texture. The problem is, I guess, that I'm using it in a way that it's not supposed to be. I don't need a high tiling at all. More like a onceinalifetime overlay to cover the screen, but that's another story.

    Shader need is what I actually need, in any cases. The additional lightmap needs to be there in order to achieve the look we're going for.

    Shader dream would be mighty awesome. Being able to combine a diffuse and a nontileable colored texture would be heaven :)

     
  17. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Your third one can be easily done. :p
    If i understand you well, you need something on top of your lightmap (the overlay texture which i believe it uses the 2nd UV channel) right?
    I got some free time now, I'll do it for ya. :p
     
  18. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    I have no idea what steps I need to do, to make it work, obviously ;)
    If it needs a 2nd 3rd 4th uv set, I can do that, no problem.
    Also I can't answer if it needs to be on top of my lightmap. Could be underneath it, as well.
    At the moment, I only have a mesh that uses the diffuse texture for base colors and then the detail texture gets overlaid. I don't have a set of 2nd uvs for now. I just know what kind of images/textures I would like to combine via 3 slots in unity.
    If I need a 2nd set of uv's, I'll do that, no problem :)

    Can you enlighten me ?
     
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    If you want your detail non-tilled then it needs to use your 2ndUV channel the one used by your lightmap and multiply it with your lightmap. But i need to be sure if that's what you want? :rolleyes:
     
  20. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Hum, why are you putting so much decisive pressure on me ;)
    Aaaah, I can't picture it in my head. Ah, it can (needs to ?) be tiled. *decisionmade*
    The more performant option should be it. Gonna be in trouble with daniele over that anyways. So tiled it needs to be.
     
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    lol, im just asking. Both operations cost the same (tilled or non-tilled) is just UV texture reading/mapping. I'm going to make you two versions (one tilled and one non-tilled), take a look at both and see which one suits you better. XD
    I'll be back soon. ;)
     
  22. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'll be out for a while, please let me know if it suits your needs. :rolleyes:
    Cheers,
     
  24. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    uuuuuuuuuhh, that makes me all sorts of wobbly inside.
    These work wonderfully as far as I can tell :)
    Thank you very much for your help ! What an awesome way to close one's evening.
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Glad it helped. :)
     
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
  27. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Hey tatoforever, I'm seeing you're helping a lot of people with shaders!

    Can I chime in? :p

    I'm in need of a shader that does:

    Diffuse
    Reflection cubemap (+ intensity/refl color)
    Specular map (+ spec intensity and shininess)
    Light map (from file, not unity's own lightmaps)

    Unfortunately I could find various combinations of all of those, but not one that does it all (main problem is finding a refl lightmapped + spec), and I don't have the knowledge to mix and match them myself :p

    Could you be so kind to help me out on this?

    PS: Would it be possible to also have a bump/normal on that? but that's absolutely secondary.

    Thank you a lot for reading!
     
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @akabane,
    I'll be on it. Well, when i get some free time later in the day, I'll give you two of them (one with normal maps and one without). :)
    [Edit] Typo. :rolleyes:
     
    Last edited: Dec 6, 2012
  29. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Wow great, thanks a lot! Merçi! :p
     
  30. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Great work Tatoforever and thank you for your hard work ! So like the others that has asked you for help, I'm doing that too :) !

    Can you please help me with a cartoon shader with an outline ( something like Borderlands2 ) and can have

    Diffuse ( with Alpha )
    Normal Map
    Specular Map (with gloss and intesity)
    Outline ( color and size )

    Thank you !
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Sure no problem, as soon as i get the other requests done, I'll work on it! :rolleyes:
     
  32. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    What can I say than, THANK YOU sir !
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I got quite busy yesterday. Hopefully I'll work out on your shaders later when i get some free time. Sorry for that. :rolleyes:
     
  34. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    No problem, we'll wait ! :)
     
  35. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Any news ?! :)
     
  36. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Is it possible you can a GUI/Text Shader with an outline?
    Currently the GUI/Text Shader is very limited.

    Thanks :)
     
  37. Diezel

    Diezel

    Joined:
    Jun 5, 2009
    Posts:
    11
    Hello,
    I search a lot for grass shader for our zombie survivor project
    http://forum.unity3d.com/threads/159790-Zombie-Survivor.

    But cant find proper, its very simple
    I have green tiled grass and yellow, to break tiling i have black and white mix map
    So is it hard to make it work ? I have some experiments but shaders that i found dont receive realtime shadows and dont affected by beast lightmap.
    Also would be good to use second UVW to manually paint mix map and second uvw also will be used in beast lightmap.
    No normal or specular needed
     
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Guys, sorry for the delay, I'm trying to find some free time to work out your shaders. I should have your requested shaders before next week. :D

    Really nice art Diezel! :rolleyes:
     
  39. Diezel

    Diezel

    Joined:
    Jun 5, 2009
    Posts:
    11
    Thanks ) Thats just 3 monts of my free time.
    And another 2 months to reworked and make it modular, now we can compose level inside unity. Also there a lot of post processing work inspired by left4dead gamma settings and 28 days later movie
     
  40. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    I really hope You get the time to work on the shaders ! I'm still waiting patiently :) !

    Thx again :) !
     
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Giakaama,
    Sorry for the delay, the past days have been those dog days where you can't even find time to eat. xD
    I'll see if i get some time this week. :rolleyes:
     
  42. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Hi tatoforever,
    thank you for the updates!

    Will wait for news as well and take it easy! :)
     
  43. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    Nice work here! If you're still taking requests, I am having a bit of a problem and think a shader could solve it.

    I am trying to create terrain objects which are textured with a single bitmap, rather than a typical splatmap routine. Unfortunately, the result has some interpolation artifacts (150x150 terrain with a 4096x4096 texture stretched across it). The texture itself is very smooth, so I am thinking a material which blurs the texture would solve my problem?

    This boils down to a material shader for a terrain object which has a texture and normal map, and a blur on both of them.

    Keep up the great work, we certainly all appreciate it. :)
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    What you probably need isa multitexture (possibly 2) shader on your terrain, one for the big untilled base texture and the second that will serve as detail when you get close to the surface (to avoid the over stretched/blurry textures). Don't you think?
     
  45. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    I'm not so sure. I think I understand what you mean, but I don't think I adequately described my terrain object. See the image below.

    $Terrain.png

    This is possibly not the best image to demonstrate with since it only has a few colors mixed in, but it's all I have currently.

    There is no tiling here, as there are no detail textures (I am not using terrain textures). The entire terrain object is textured with just one bitmap, composed of various color gradients blending into one another. The goal is a smoothed look. So long as the terrain object isnt terribly large (~150x150), the artifacts are minimized, but I'd really like for everything to be smooth instead. The diffuse lighting has similar artifacts because of the normal map for the entire terrain object, so both need to be smoothed.
     
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    What do you exactly mean by "everything to be smooth"?
    Sorry, I'm not sure to get what are your exact needs. :rolleyes:
     
  47. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    No problem. Suppose I have a very basic square terrain which has a rounded hill in the center. Maybe the hill is colored like a rainbow, with bands of color transitioning radially about the hill. In this case, the texture of the terrain would be a radial rainbow gradient, and I have done this part already. It would look something like this, applied to the terrain:

    $RainbowContinuous.jpg

    The problem is one of resolution. From afar, the terrain object look fine (like the image in the previous post), but when I actually load into the scene and place the camera near the terrain, you can start to see interpolation limits (distinct bands, rather than smooth gradients), like:

    View attachment $RainbowDiscrete.bmp

    I want to remove the discrete bands by applying a blur shader to the terrain (not the texture, the texture is already continuous, its the stretched application on the object that is discrete).
     
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Ok i got it, but before start thinking any possibly unnecessary overhead (through custom shaders), try setting your terrain texture's filtering to trilinear and see what happens. :rolleyes:
    [EDIT]
    Second option would be a 4 taps offset blur filtering directly in the fragment shader but this will of course means reading 4 times your terrain texture (it won't come free as reading only once in a diffuse shader).
     
    Last edited: Dec 19, 2012
  49. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    Yeah, I tried trilinear filtering and it improved things a bit, but not enough to remove the eyesores, unfortunately.

    Though I have started to dabble in shader programming, I am still pretty amateur. What is a "4 taps offset" blur filter? Thanks for the assistance, it is greatly appreciated. :)
     
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    It's a simple technique to blur things out, consist of coping the current pixel 4 times and offset it in X/Y directions. In this case you would actually have to multiply it with it's neighborhood pixel colors to get a decent blurry effect.
    You can also display a lower mipmap value on your terrain (which is an already blurry version of your texture). Have you tried?
     
    Last edited: Dec 19, 2012