I know people have been looking for this so I thought I’d share our solution. It is fully integrated with Unity 3.0′s surface shaders so it reacts correctly with all lights, shadows, etc. Also, this is real bump mapping using a normal map (doesn’t just use the alpha channel like previous implementations).
NOTE: It also exposes a means of sending textures and values to the built-in shaders, so be sure to let us know what else you guys are able to come up with.
Double NOTE: The bump mapping won’t be visible in the editor since the script needs to run to send info to the shader. Press play and you’ll see it.
I also wish this was for 2.6 but alas, I look forward to this when I make the upgrade . This is one of the most sorely missed features in Unity IMO, and I’m glad you finally found a way to implement it.
Woah, this is amazing! Still tweaking the settings, but let me give you a before and after preview based upon SpaceOreMiner ( not updated the webplayer yet, considering how best to use this ).
Oh, yea that was one thing I forgot to mention - it won’t show up in the editor because the terrain script needs to run.
@elias_t - The shader does not apply itself to the base map, so set the base map distance higher if you want to see it from far distances.
@bigkahuna - I suspect someone will port this to 2.x since it shows the 2 major problems we’ve run into which is sending textures to the built-in shaders and approximating the tangents of the terrain which aren’t provided in the vertex data.
@3dDude - We’re going to work on our own parallax shader soon. I’m sure someone could implement the built-in parallax with ease but I don’t think it looks very good.
@Evsign - It can be viewed only locally. It doesn’t apply itself to the base map so if you want it very local, just set the base map distance low.
In the shader, try changing the tiling rate of the normal map. It looks like the bumpmap is very large. So in the shader where it shows 4 sections for each texture, find the one that applies to the texture you are seeing that looks like that and multiply the UV until it looks right.
I mean not just that. I mean, what would this shader was used not on all terrain, but only in the right places. For example, in one place of my terrain i have the texture of stone, and in another place I have the texture of grass. And I need that to this shader has been applied only in the place where lies the texture of the stone
@Evsign - Yes, for the textures you don’t want bump maps on, just leave “None” in the bump map texture in the terrain script. And remember, the 4 slots line up with the 4 terrain textures respectively.
But having the tiling changed didn’t resolved it. The basemap is 1024x1024 and the normalmap the same. When it shows, the tiling seems correct, but when it’s not showing you can see the artifacts:
could it be that we can’t have the terrain lightmapped?