Search Unity

What shaders would you guys want?

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

  1. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    I know how to enable generating mipmaps, but don't know how to override which gets applied at different distances, so no, I have not tried that. I am searching now for how to do it to see if that would work, but I would think it would have similar problems since mipmaps are just alternate textures, aren't they?
     
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    If you can post your texture and terrain mesh? I'll take a look and see if i can find a cheap solution. Having shaders doing the blurry stuff is inappropriate.
     
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Just a guess, but what compression are you using on your rainbow texture? It could be that the banding is precision loss as a result of compression, and that turning compression off for that particular texture might fix things.
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Daniels suggestion is also a cheap way to get what you want, but for a 4096*4096 uncompressed texture you should have some serious reasons not to have a conventional (multi-splat) terrain. xD
     
  5. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    I am not sure how to disable compression. I have been importing the texture as ARGB 32 bit, but am unsure if that still undergoes some compression (likely). Linked at the bottom is a 36 MB .zip containing some sample files produced from WorldMachine2 (individual files are too large to attach):

    An example heightmap (2048x2048 .raw). Import the heightmap at 250x50x250 for intended scale.
    A corresponding texture (2048x2048).
    A corresponding normal map (2048x2048).

    I can produce 4096x4096 textures if necessary...

    Link to .zip
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @sgoodrow,
    I've attached an image of your terrain and textures (top view):

    $noproblem.png

    I don't see any rainbow effect (the problem you where describing). What i see i a normal blurry behavior when you start to zoom in. In this case, I've set both provided textures to Automatic Truecolor to avoid compression artifacts.
    But anyway, if you need more help on this, try to send me a PM (we are getting a bit of topic here). :rolleyes:
     
    Last edited: Dec 21, 2012
  7. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Merry Christmas, and we hope for a Christmas present :) !
     
  8. ant001

    ant001

    Joined:
    Dec 15, 2010
    Posts:
    116
  9. Phantom-AE

    Phantom-AE

    Joined:
    Jan 7, 2013
    Posts:
    9
  10. Rexcusei

    Rexcusei

    Joined:
    Jan 10, 2013
    Posts:
    9
    thank you for the updates!
     
  11. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    II would like a shader where it used a pre-generated AO mapping (from blender) and a diffuse texture.
     
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    To be lately released, this a preview of a custom mobile shadowmap/lighting system that does everything in one pass!
    Runs extremely fast.
    $06-01-2013 5-14-23 PM.png $07-01-2013 12-26-53 AM.png $07-01-2013 12-21-22 AM.png $07-01-2013 12-18-10 AM.png $06-01-2013 5-22-27 PM.png
     
  13. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    You want the lightmap to interact with Unity lighting system or it doesn't matter to you?
    I guess the lightmaps UVs (2nd channel) are already set inside Blender?

    @To anyone else, I'm trying to get some free time this week to complete your requests, tanks for being patient!
     
  14. Phantom-AE

    Phantom-AE

    Joined:
    Jan 7, 2013
    Posts:
    9
    damn, your custom mobile shadowmap/lighting system looks pretty sweet, nice job! are we getting our hands on it at some point in the future?

    thanks for this thread in the first place, it's totally worth being patient.
     
  15. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    yea, I would like it to interact with Unity's lighting and for Blender you can set up a second channel if you want (I haven't yet).
     
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Only color and lightmaps?
     
  17. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    As soon as we ship our current game (Forgotten Memories) it should be automatically on the Asset Store.
    It is extremely fast, the game runs 30-45 fps with all post-effects, lighting and shadows (on heavy scenes) in iPad2/iFun4S.
    We have a gameplay video coming soon, where the system will be showcased, I'll post it through here once live.
    Cheers,
     
  18. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    Yup, that will work.
     
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Gimme a minute. :rolleyes:
     
  20. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Wait a sec, by interact your lightmaps with lighting i mean real-time lighting (not baking). Is that what you want?
     
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
  22. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    Works, only thing is that I have to put the lightmap in the diffuse texture place and vise versa. Thanks :)
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    You have two textures slots, diffuse and lightmaps. Lightmaps slot is where your custom lightmaps will go. :D
     
  24. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    I tried that, Model instead went fully black.
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Did you tried the build-in shader: "Legacy Shaders/Lightmapped/Diffuse"?
    It does the same.
     
  26. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Any news on the shaders ?!
     
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Giakaama,
    What was your request? I complettly forgot. ^^
    When i get some time this week I'll try to work on it.
     
  28. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Can you please help me with a cartoon shader with an outline ( something like Borderlands2 ) and can it have

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

    Thank you ! :D
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    That's relatively easy to do. I'll see if i get some free time this week and work on it. :D
     
  30. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Consider it S O L D, now get finishing that game! :D
     
  31. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    That would be great ! :)
     
  32. thommoboy

    thommoboy

    Joined:
    Jul 20, 2012
    Posts:
    59
    A proper mobile bumped diffuse to be used with point lights
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Here: View attachment $Mobile-Bumped.shader
    You'll find it under "Mobile/Bumped Diffuse Lights"
    If you remove noforwardadd pragma directive to any surface shader, it will support all pixel lights. But keep in mind real-time lighting in mobile hardware is really costly. :)

    I'll see if i can do others peoples requests today. ^^
     
  34. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Any news on the shaders ?! :)
     
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'm working on it right now. ;)
     
  36. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Me HUG you ! :D
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Giakaama,
    There you go:
    View attachment $Outline_Shaders.rar

    I've packed two versions of the borderland style shader, due to the limitness of surface shaders I've added two versions of it. One that is normal outlines (so you can customize the outline color) and the second which is a dark-only version (as seen in borderland).
    I can do a more optimized CG shader but this will require a bit more of time (which i don't have right now). :)
    Hope it can help, let me know if you like it.
    Post some images of your game, how it looks with the shader. :D
     
    Last edited: Feb 23, 2013
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    When you have some free time, please share your results. :rolleyes:
     
  39. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Thanx for the Shader and I did a test with your shader and with the one I was using already ! Hmmm your shader has more " punch " but Farfarer has more Borderlands feel :) !

    I guess I'll have to decide which one :D ! by the way, your shader gives me a warning

    "Not enough temporary registers, needs 9 ( compiling for flash ) at line 15" ( I don't want to compile for flash )
     

    Attached Files:

  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    The warning is because it's a really heavy shader (bumped+specular+all tweakable properties) in a surface shader. I can create an optimized version of it but i don't have much time right now sorry. -_-

    Btw, my version it's a simplified outline shader nothing fancy. It uses standard Unity lighting model which produces a bit more realistic results (or standard results). Farfarer one looks more like a toonysh with a strong outline due to the custom ramp and lighthing model which is pretty good but it's also heavier.

    So if you are really looking for a bigger toonysh look, go with farfarer mod version. If you look for something less heavy and more realistic (less toonysh) go with mine. :D
     
  41. Giakaama

    Giakaama

    Joined:
    May 25, 2012
    Posts:
    18
    Thank you for the answers :) ! How can I put the outline in your shader ? I've tried but failed :( !
     
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Try to reduce the _RimPower (it will create an inner/deeper outline) if your rise it, it will become thinner. ^^
    And post more images once you get the results you are looking for. :)
     
  43. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    Any chance you could whip up a grass shader with partial transparency and cutoff?
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Sure, not a problem. Gimme a minute.
     
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    There you go:
    View attachment $Ground Grass Wind AlphaTest.shader
    You'll find the shader in this category "Custom Shaders/Nature/Ground Grass Wind AlphaTest".
    You can use any plane or mesh with (better if you use double-side planes), no need to paint vertex colors, works out of the box. Oh yeah, recommended to use standard mesh/flowers/bushes textures as it needs the top of textures UVs to animate the top (and avoid moving vetices at the bottom).

    I'll be happy if you guys shows some results (images or videos) with the shaders we freely provide. It encourages us a lot to work free for the community (when we aren't busy)! :D
    Cheers,
     
  46. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    Got it, thanks.
     
    Last edited: Feb 25, 2013
  47. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'm gonna give it a look later. I would be glad to help for free and have some credits in your app for it. :)
    Cheers,

    [EDIT]
    That glow effect requires a post-processing technique.
    This is how i plan to do it:
    Objects will be selectively rendered into a camera. I then render the objects Glow textures into a RenderTarget (it would be a Black and White full-screen texture), I'll use this texture to selectively get pixels from the screen and to bright them and offset them to create that blurry effect around the glow area. :D
    A cheaper but less accurate effect would be a bloom effect.
     
    Last edited: Feb 26, 2013
  49. MarigoldFleur

    MarigoldFleur

    Joined:
    May 12, 2012
    Posts:
    1,353
    Well, I hope you can help me out here because I'm having a heck of a time doing this myself. I've been trying for over a month but I just can't wrap my head around ShaderLab syntax.

    According to Noisecrime:

    It's no rush, but any help would be great.
     
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    That can be easily achieved. Do you really need the banding effect? Or a linear-smoothing could do your job?