What are you looking for?
Search the Community
Showing results for tags 'landscape'.
Hi Everyone! In the past few months we have worked on optimising a scene for a VR game, which included needing a better running terrain shader than what Unity currently uses. We first made a shader in URP that can handle 4 terrain layers, then moved onto making a version that can handle 8 terrain layers. What's unique about this shader is the fact that we were able to reduce the number of texture samples per terrain layer - going from Unity's default of 3 (BaseColor, Normal, MaskMap) down to 2 layers. So it's a third of the cost of what a typical Unity terrain shader would utilise. For example, a terrain with 8 layers using Unity's system would require 24 textures (that's 8 layers * 3 textures per layer), whilst our shader would only need 16 textures (that's 8 layers * 2 textures per layer). Another area of improvement was reducing the amount of data tied to the terrain mesh required for the shader to sample. We were able to remove the need of vertex normals on the terrain mesh, as well as removing the need for UVs. With some initial testing in RenderDoc, our new shader (with 8 terrain layers) was able to save 11 textures (Unity's had 32, ours had 21). We were also able to save 10 variables used in one of the constant buffers (Unity's had 50, ours had 40). Through testing this early development shader 3 times in Renderdoc I was able to infer that this current version of our optimised shader runs about +9.47% faster than Unity's. It will still need some more testing in different scenarios and devices to conclude any other differences. The aim of this shader is to have an indentical look with Unity's terrain shader, but just run a little faster: Unity's Terrain Shader: Our Optimised Shader: Unity's Terrain Shader: Our Optimised Shader (still needs some work on getting the normals correct!): Let us know what you think about this approach!
Hi Everyone! In conjuction with the new GeNa Mesh Extrusions tool, we are also looking at better blending options in the radius where the holes are cut. We are working on getting a tool set up that, when giving an area, can create a set of PBR textures reflecting the final blended terrain at that position. This saves us from having to sample the terrain shader more times than actually needed, and allows us to explore other areas where sampling the color of the terrain below a surface could be used. Here are some screenshots showing the final result being sampled on a plane gameobject, next to the terrain it sampled from. Can you notice the seams where the plane intersects the terrain? This tool is also supported on multiple terrains (4 terrains are used in this picture, intersecting where the area is captured, with one of them highlighted in orange). We also sampled some other data that Unity's terrain component provides as textures, such as their splatmaps, heightmaps and world normal. Here is a comparision without some of the more detailed terrain textures utilised: Before: After: Sampling the color on the terrain below on object also allows us to blend it with objects on top, such as this rock example! What other uses do you think this could be used for?
Hi Everyone! Recently we have been researching new techniques for rendering terrains, specifically on the shader development side. Much of this research is inspired by some of the GDC talks about landscape rendering over the past couple of years. One of the areas of interests was in reducing the amount of splatmaps needed for terrains. Currently, Unity supports multiple terrain layers through splatmap textures, where each channel (Red, Green, Blue and Alpha) represents a terrain layer mask (white for telling the shader to paint it at that pixel, black for telling it to not paint it). In our early research we have been able to find a method that reduces the number of splatmaps down to 1 per terrain. There are some visual tradeoffs to be made with this approach, but does allow some benefits such as supporting more than the traditional 8 terrain layers that Unity supports. Working along side this system is also the idea of having each pixel on the terrain know all the information about where it is spacially, what terrain slice it is, and it's terrain layers. This idea would potentially also reduce the amount of draw calls required for the rendering of the terrain, as many terrain tiles could use the same material. We won't go into the specifics here, as it is still in early development, but we do have ideas for other features that could work with this terrain approach, such as integrating the weather system that is in development, adding tessellation and displacement, reducing the visible tiling of textures and object blending into the terrain. For now, here a basic showcase of the customly developed terrain shader, without using any of Unity's terrain tools: Let us know your ideas for a new terrain shader you would like to see!