Home Unity

how to mix shaders?

OK so I'm having some problems with Unity default shading system. I have to texture a terrain that I built externally in Blender but am stuck at so many different places. So this is what the problem is -
1.sculpted a terrain mesh,
2.decimated it to create a low poly mesh,
3.baked out a normal map,
4.tried out the 4 layered shader in unity that takes in 4 tillable textures and a splat map for texturing the terrain,
q1 - where do I put my baked normal map?
q2 - where do i put the 4 normal maps corresponding to the textures?

the solution I'm finding should have the independence to mix different shders so that each individual shader goes like this -
shader1 - plugs in the large normal map
shader 2 - plugs in the color, normal maps for 4 textures and a splat map (also a specular map).
shader 3 - adds both shader 1 and 2.

Eric Chadwick (http://www.polycount.com/forum/showthread.php?p=1916656#post1916656) suggested some very nice thing for this but its udk specific. I tried using the stumpy shader editor but its way too advanced for me, I mean its just been like 2 to 3 months that I got into gaming. The above solution that I suggested can very easily be done in 3d packages using nodes and I know the workaround but only if it could be done in unity somehow then only it would solve my problem.

Please guys help me.... thanks

Replies

  • Farfarer
    q1 - I doubt you can, it's likely the shader doesn't support this.
    q2 - There will likely be slots in the material for them. If you're using the terrain shader on something that's not a Unity Terrain then it's likely that it won't work because the terrain system supplies some of these values to the shader for that specific terrain.

    You don't tend to get shaders that add two shaders together. But you could write one that does all of that in one go.
  • bharatnag
    Farfarer wrote: »
    q1 - I doubt you can, it's likely the shader doesn't support this.
    q2 - There will likely be slots in the material for them. If you're using the terrain shader on something that's not a Unity Terrain then it's likely that it won't work because the terrain system supplies some of these values to the shader for that specific terrain.

    You don't tend to get shaders that add two shaders together. But you could write one that does all of that in one go.
    Thanks a lot for that Farfarer. Im getting hold of the strumpy shader editor and its starting to help me out. Im not strictly restricting myself to unity but am alos looking out for udk cryengine resources and trying to achieve similar results in unity. But the learning process is a bit slow. Thanks for the reply, I appreciate it.
  • electricsauce
    Offline / Send Message
    electricsauce polycounter lvl 11
    You can't just add two shaders together. You can write one that does what you want, but it's a lot more complicated in Unity than it is in UDK.

    Here's a few decent tutorials on unity shaders.
Sign In or Register to comment.