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
    @Darkmonk,
    I'm not the author of that shader but I can give it a go if needed. Can you please post more information about the surface you are using it? Like the mesh in wireframe, texture, etc. Remember this is a vertex blending. If you need more precise controls, you may wanna go with an RGBA mask instead of vertex-based colors for blending.

    [EDIT]
    Looks like Daniel found it. If still not working reply to my post. :)
     
  2. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    AWESOME, That fixed it :D

    Thank you so much guys this is exactly what i was after.
    also want to say thanks for the offer tatoforever but its ok as its working now :)

    going to give it a good test on one of my models that is already set up just for a proper final test though.
    thanks
    john
     
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Glad it helped! :)
     
  4. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    im back lol.

    That last shader is working well although now i have found out something i did not think to specify at the start sorry :(
    There is a problem when i try to change the tiling parameter of the indavidual textures, If i change the Black tiling parameter then all the textures tile and when i change the red,green and blue tiling parameters nothing happens :( I had wanted to be able to tile them independently of each other if possible.
    is it possible to have them tile independently of each other with this setup ??
     
  5. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    You'll need to add uv fields to your Input struct for the textures other than _MainTex (line 21). Then change the tex2D() calls for those textures (lines 27-29) to use those UVs instead of uv_MainTex.
     
  6. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    Thanks once again dude, your a star :) got it working perfectly now
    you make it seem so easy lol, i need to start learning some basic shader code so i can recognise how to fix these little issues.

    thanks
     
  7. 747823

    747823

    Joined:
    Apr 10, 2013
    Posts:
    43
    Don't have unity pro yet. Still experimenting to see if unity is suitable for my purposes.
     
  8. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    ripple effect request? or/and splash water effect similar effect when very heavy items throw into water

    and i have ask - your custom shadowmap work with free vesion unity tatoforever ? ;)
     
    Last edited: Apr 11, 2013
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'll try to extend the current Unity water shaders and add the ripple effect. Gimme few days, I have a hellish amount of work to do in my job (finish our game). ^^

    My shadowmapping wont work in the free version as it needs RTs which is only for the Pro version. But I'm working out a nice planar shadows with stencil filtering to give ultra fast realistic and detailed shadows both for the free and pro version of Unity. Coming soon! :D
     
    Last edited: Apr 11, 2013
  10. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    hi all,
    have another little shader request, I would love to have a shader that allows me to paint a dirtmap over my main diffuse texture based on the vertex alpha that ive painted onto my model, but i would like the other colour channels to be kept for vertex colours if that makes sense.

    ill try and clarify exactly what im after.
    1.Vertex colour information
    2.Diffuse texture slot
    3.Dirt texture slot (this texture will be multiplied over the diffuse vertex colours and only visible where i have painted some vertex alpha)
    if i paint only 50% alpha i would expect the dirt to only be 50% as strong

    Will a shader like this work with the beast lightmap or do you need to add something extra to get it to work ? if so it would need it to work with beast as well please.

    any assistance with this shader would be awesome,
    thanks
    john
     
  11. Lyker

    Lyker

    Joined:
    Feb 27, 2013
    Posts:
    60
    Any luck you might find time to create such thing? It would really help me and my team out, since none of us knows shading. :p
    If you were to spend time on this and you need more info, tell me. :)
     
  12. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Fur/hair shader like they advertise in unity4's videos and dont put it in the assets :S
     
  13. 747823

    747823

    Joined:
    Apr 10, 2013
    Posts:
    43
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    If i got it right, you need to show vertex colors? May I ask why (just curious)?
    Plus diffuse texture and use the alpha channel (of your vertex color) to show a dirt map?
    I'm giving it a go.
    PS: Yes, it would be compatible with lights, cast shadows and lightmaps.
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Darkmonk,
    The vertex rgb colors are being blended with the main diffuse colors and vertex alpha defines where the dirt appears. Also, I've added two opacity factors for each textures and a global color for better flexibility/outputs.
    I've made a blind guess for the vertex color as i don't have any mesh with vertex color data to try out, so let me know if it works for you.
    PS: I would like to see some results on your part (keeps us motivated to work free for the community). :rolleyes:
    [EDIT] See my next post with the updated shader.
     
    Last edited: Apr 22, 2013
  16. mrmadprofessor

    mrmadprofessor

    Joined:
    May 22, 2012
    Posts:
    53
  17. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    Hi Tatoforever,
    sorry for the dely in my reply but i was not on my computer much over the weekend so only got a chance to test it this morning.
    I think my description was not very good :( I do not need to see the vertex colours on there own i just need them multiplied into the diffuse texture and then have the dirt texture multiplied onto of the combined vertex colour and diffuse only in the areas where i paint vertex alpha onto my model.
    I have made a couple of images and also created what i want in strumpy shader editor as an example although with the strumpy shaders i cant get them to work with the beast lightmaps and im not sure how efficient stumpy shaders are so i only use strumpy for example shaders.

    attached is a basic scene with an example object and texture to show the rough idea of what i need it to do, ive also included an image of the strumpy graph so you can see what i did.

    Hope this helps.

    Yeah ill post any cool images of work ive done that use these shaders as i do really apprieciate the help from you guys to make these shaders for free :D

    $DirtBlendShader.jpg View attachment $DirtBlendScene.unitypackage
     
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Alright, I'll give it a go.
     
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
  20. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    Dude, your a star this is exactly what i was after :)
    Thank you and ill try and post some images of how i use it once i get some levels built using it :D
     
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Looking forward to your images! ;)
     
  22. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    Hey,

    I'd like to have an Unlit Shader with a blurred outline. It's kind of like the shader in Highlight System but not visible behind other object and not affected by lights. For properties it would be nice to have MainTex, Range and Outline Color!

    Thank you so much if you can do this!! :D
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Such effect can't be done in a single shader. It's an entire post-effect and requires Unity Pro because of the use of RTs. :rolleyes:
    HighlightSystem doesn't do any sort of lighting, it just write to the depth buffer (selectively) and blur it out in an extra pass.
    Re-writing such system myself will take lot of time, if you can buy it i can modify it and customize it to your needs. ;)
     
  24. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    Hey, thanks for the reply! I already bought it and I think I can modify it myself to achieve what I was talking about, but I find it kind of a big system only to do that. That's why I asked you to make it in a shader, but looks it can't be done that way :(

    Another question, what do you think about the strumpy generated shaders? do you think it's good enough to use as a final shader in a game or should it be rewritten clean?
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yeah, post-process effects that requires that uses/does depth stuff, RTs, etc are in most part a little big. Most of the time they have multiple shaders and scripts. But still, I can give it a look (send them privatelly) and I'll make the changes for your needs.

    As for the Strumpy Shader Editor: It's a bit outdated (last version dates back of March 24th 2011). Though I don't work with but have taken a look at what it generates and it add lots of unneeded stuff to the shader. Shaders needs to be cleaned a bit. I can't tell you if you can used for final production products but at least prototype stuff should be fine i guess.
    I write such effects by hand (in Cg programs or CgFX shader language) maybe someone with real experience of the strumpy editor will answer that question better than myself. Perhaps Tim (strumpy shader editor's author) is near and can help you with that question? :rolleyes:
     
    Last edited: May 2, 2013
  26. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    HBAO!
     
  27. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi is it possible using a shader to convert a texture that looks like this



    and make it look like this


     
  28. 747823

    747823

    Joined:
    Apr 10, 2013
    Posts:
    43
    Yes. Sample the texture from a few different points around the current one and if the range of colors is significantly different, make it black. Otherwise make it white.
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    As 747823 said, this is relatively easy to make. :rolleyes:
     
  30. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    http://forum.unity3d.com/threads/70585-Skydome-for-unity3D-3-x

    hi again

    u can improve realistic this day/night scattering shader when u have free time? (version 2.1 and request for improve sunset and sunshine quality majority) if no i think i realse improved this package (majority enh is change&simplify code c#) soon

    i will added random cloud so u haven't to improve cloud
     
    Last edited: May 4, 2013
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I don't see any problem with this package, I've adjusted few things in the scene to make it working fine.
    Here: http://www.fileconvoy.com/dfl.php?id=gcaa93731e4a9abfd999280445815d0966877ae47a
     
  32. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    747823 and tatoforever, thanks for the giving me some hope.

    I have not attempted any shader coding before. I did find a binary shader in the wiki - but it will not run on Unity 4 so I cannot tell if it will do the job or could be used as a starting point.

    http://wiki.unity3d.com/index.php/Binary

    Any takers on porting that up to Unity 4 or writing something from scratch?

    Thanks

    iByte
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Hello iByte,
    I'm giving a look at the shader you've want it to work on Unity4. Do you need lighting calculation on it?
     
  34. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi tatoforever,
    My first inclination would be to say no (not for the images I am initially going to be supplying ) ... but after watching the utube video it looks like lighting support might give better results in some cases, If I was to use the shader on a player supplied artwork/photo for example

    Thanks

    iByte.

     
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Here: View attachment $binary.shader

    Changes: Complete re-write of lighting functions, works with Unity 3.5/4.x
    If isn't much to ask I would like to see some results on your end with the shaders we provide. :rolleyes:
     
  36. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi, Tatoforever,

    Here is a link to some samples. I have not tried any lighting yet other then a single directional light. Would it be possible to thicken the resulting lines?

    $binary.PNG
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Ok, tomorrow at the office I'll give it an other quick spin. Have you tried tweaking the properties? Btw it works with any sort of light (not just directional) and It's vertex based.
     
  38. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi tatoforver, I experimented with some of the settings and was able to get a heavier outline by doubling the modulus number. I think a small improvement would also be to change any white pixels to black if pixels on both sides of the white pixel were black?

    https://dl.dropboxusercontent.com/u/2238318/Unity/SavedScreen 1.png

    One other request, for a final pass can all the white pixels be made transparent?

    Thank you very much for the work you have put in so far!

    iByte
     
    Last edited: May 7, 2013
  39. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    The second pass is when there's no light affecting that mesh (otherwise the mesh will look entirelly black). But I can make a secondary version with transparent pixels on the white colors (color1) in the second pass. Is that what you want?
     
  40. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
  41. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    tatoforever,

    I was wondering if you could show us how to create a transparent shader which renders the depth of an object by subtracting the distance from the camera to its rear surfaces and the distance from the camera to its front surfaces? This would be a great starting point for a volume shader, however I just can't really figure out how to set up a Multi Pass/Replacement shader like this.

    Any help would be really appreciated. I just need to get started so I can understand these kinds of shaders, then it opens a whole new world for me...

    Thanks.
     
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @ sgoodrow and the rest of guys requesting help:
    I was quite busy the last days but I'll take some time this weekend to answer and complete your requests!
    Sorry for the inconvenience!

    PS: If you really need to poke me out for something ultra-urgent, please write me an email directly to:
    tatoforever [at] psychozinteractive [dot] com
     
  43. 747823

    747823

    Joined:
    Apr 10, 2013
    Posts:
    43
    Yeah I was wondering about / hoping for one like that too. :)
     
  44. WalterEspinar

    WalterEspinar

    Joined:
    Aug 23, 2011
    Posts:
    84
  45. Kald

    Kald

    Joined:
    Apr 20, 2013
    Posts:
    16
    I was wondering, whether it's possible to make a shader that would generate on run a texture looking much like this:
    http://libnoise.sourceforge.net/tutorials/images/newheightmap.jpg
    from this tutorial:
    http://libnoise.sourceforge.net/tutorials/tutorial3.html
    I've got it working on CPU, but it's way too slow for my needs - so I was thinking about rewriting it for shaders, but, sadly, I know nothing about writing them ;)
    I'd be very grateful if you'd push me in the right direction of writing this, even if you could not find spare time to write it yourself.
     
  46. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579
    Hey guys, I didn't read all the posts so forgive me if this was answered but -> was the water shader ever started/completed?
     
  47. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    I have a quite simple request (i hope : p):
    A fast billboard shader that renders a specific texture as a billboard and with alpha blend?
     
    Last edited: May 23, 2013
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Hey guys,
    I'm trying to get some free time this week (again) to workout your requests.
    Thanks for being patient. :rolleyes:
     
  49. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    I'll throw this one out there and see if anyone has anything.

    I'm looking for a shader which I can apply to a mesh, which will make the mesh into a volumetric fog zone.

    The idea is to create foggy areas around the level.
     
  50. Dolkar

    Dolkar

    Joined:
    Jun 8, 2013
    Posts:
    576
    I was actually thinking about doing this already, but I don't think it can be done with shaders alone...

    The way this is done is that you first render the depthmap of everything plus the backface of your volume. In the next pass you then sample this depthmap to figure out how deep the fog is at that pixel.