I try to influence how the terrain is drawn. Actually I try to make a transparent hole in the Terrain. Unfortunately I can not change the RenderQueue, the console gives me an "No 'Renderer' attached to the 'Terrain' game object" error.
Therefore I can not influence the rendering order for the terrain.
Is there any workaround to do that?
asked Nov 24 '11 at 01:14 PM
The built-in Unity Terrain doesn't use transparency. Sure, you can select a png and paint with it, but the hard-coded drawing routines don't look at alpha. Even if you could get it in the transparent queue, the terrain would still be drawn solid. You can modify the shaders to use alpha, but the built-in paint tool won't know that, and won't work right.
I look at it this way. Most game engines have everything built-in and that's just the way it is. In Unity, only Terrain is still that way. That seems fair to me, since efficient terrain rendering is such a complex area.
For the hole, do you want it to also not have collision? Like making a cut-out for a cave mesh? Because collisions are a whole other area. Best is to built the "terrain" out of your own meshes.
answered Jan 03 '12 at 05:22 PM
You can set the shader's RenderQueue (to get the same effect) by writing a replacement shader.
For creating terrain holes, though, I've put together a Unity plugin that does just that: Terrain Hole System
Description: "This Unity extension lets you make holes in your terrain that characters and other objects can go through."
More information can be found on the forum thread.