I’ve been googling this problem for 2 days basically. I’m trying to replace the terrain shader with any of the multitude I have. I know that you have to name it the same(I’m guessing FirstPassRealtime.shader), and that you have to put it in a resource folder somewhere, but other then that I’m at a loss.
If anyone could help me out with this, it would be tremendous.
that is really all you have to do.
maybe you will have to restart unity to make it work…
when renaming it make sure that not only the file name matches the original one but also its declaration. so my hacked bump mapping terrain shader starts like this:
edit: Assuming I have figured this out - how do I make sure that the normal will show up? I’ve edited the psd files so that the alpha is storing a normal map, but it still doesn’t seem to be showing up.
What does somewhere mean?
Really anywhere - to my liking?
Or do I have to put the replacement shader inside a specific Resource folder? If so, where would I find that one? In my project, in the Unity installation? An example destination path would be helpful.
The reason I ask is that I cannot seem to find the shader used by the SubTerrain Toolkit to render the terrain. And I am getting billboard tree issues where the billboards seem to show what lies behind a water plane (Pro water, FX-Water4 shader) that covers part of the terrain. So I would really like to have a look at those shaders to track down the error.
You can put the shader anywhere in your Asset folder, like any regular shader you’ve written yourself. Any filename.
So long as the name defined inside of the shader code itself is the same as the one in the shader you want to replace (i.e. Shader “Hidden/TerrainEngine/Splatmap/Realtime-FirstPass” {), Unity will load and use your shader rather than it’s own.
Ok thx, that helps in defining my own shader version.
The original shader cannot be extracted from neither the project paths nor the unity installation path? Guess I have to get it from the shader bundle offered at the Unity website then.
Search the forums for “twotimesnothing” or “terrain bump map”, he has very good samples of how to do it.
Ive also posted couple examples, search for “terrain detail” or “terrain caustics”
Yeah, the shaders are built into Unity somewhere and the source isn’t directly accessible (other than the compiled versions, I guess). So grabbing the shader zip will give you the code for all of Unity’s built-in stuff.
Looks like a problem caused by the depth pass of the water vs.aliasing on the trees. Is it forward rendered ?
Maybe switching to deferred and fxaa could solve it.
Hey virror, thanks for posting that you’re having the same kind of problems. Weird thing is: that’s standart behaviour of Unity Pro.
I would really appreciate an answer from the Unity developers - this issue has been going on for quite a while now. What’s wrong - is it your water shader? Is it the billboard shader? Is it the terrain shader?
That halo effect just shouldn’t be there. How can we sort this out - literally?
I coulda sworn that one of larsbertram’s packages has a shader that fixes the weird tree billboard issue.
UT has remained silent on this issue, but it comes up somewhat often. I think the closest we have gotten is feeble acknowledgement that the terrain system is meh.