Its also possible to write a compute shader to take terrain height maps and generate a normal map from it, blending the normals with the terrain and making sure the terrain follows the same lighting rules as your object will help with that line a ton and you should be able to do it in one pass
It should work in HDRP without changing the nodes or at least there should be equivalent ones in HDRP (except for the output vertex and fragment nodes of course)
You can bake a heightmap from a mesh (if it is in terrain-form) using raycasts for examples. If the mesh is a simple shape (spheres, cylinders) you can use simple maths to do the same. If you have an irregular mesh, you'd have to somehow get and define a SDF for your geometry. So in principle, as long as you can get a distance measure, it is possible!
@blenderfan Great tutorial! Exactly as you say at the end of the video, I would need to use this principle of yours with a terrain with 4 textures (sand, grass, medium and rock, for example) how can I increase these textures within your shader? Using the splatMap too? Unfortunately I'm not too strong in this field 😭 I hope you can help me. A thousand thanks
Yes, you can get a splatmap from the terrain (you can import them with the terrain tools package). The second step is to add each texture to the shader and blend them according to the splatmap (you might want to take a look at the Splatmap Shader video on my channel, where I do something similar... just without a terrain, but the method is the same. Just be careful about the UVs). And once you have combined the textures (which should look the same now as on the terrain), you can blend like in the video as usual.
Its also possible to write a compute shader to take terrain height maps and generate a normal map from it, blending the normals with the terrain and making sure the terrain follows the same lighting rules as your object will help with that line a ton and you should be able to do it in one pass
True.
Thanks so much for this tutorial!
can I do the same thing in HDRP or I must change some nodes .. I hope you'll do a video about how to make terrain-mesh blending in HDRP
It should work in HDRP without changing the nodes or at least there should be equivalent ones in HDRP (except for the output vertex and fragment nodes of course)
Is this possible but for meshes only, not terrain? Without heightmap
You can bake a heightmap from a mesh (if it is in terrain-form) using raycasts for examples. If the mesh is a simple shape (spheres, cylinders) you can use simple maths to do the same. If you have an irregular mesh, you'd have to somehow get and define a SDF for your geometry.
So in principle, as long as you can get a distance measure, it is possible!
@blenderfan
Great tutorial! Exactly as you say at the end of the video, I would need to use this principle of yours with a terrain with 4 textures (sand, grass, medium and rock, for example) how can I increase these textures within your shader? Using the splatMap too?
Unfortunately I'm not too strong in this field 😭
I hope you can help me.
A thousand thanks
Yes, you can get a splatmap from the terrain (you can import them with the terrain tools package).
The second step is to add each texture to the shader and blend them according to the splatmap (you might want to take a look at the Splatmap Shader video on my channel, where I do something similar... just without a terrain, but the method is the same. Just be careful about the UVs).
And once you have combined the textures (which should look the same now as on the terrain), you can blend like in the video as usual.
Cool but it works only for a single tile terrain
Have any ideas for working with multiple terrains?
@@chadfranklin47 sorry I'm not that advanced in unity
great!!