A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by eagle555, Sep 16, 2012.
Turning on auto-scale seems to have now done the trick.
Thanks for the help.
The only issue now is back to the detail textures. I cant really think of a way of doing it. I am sure RTP will have the same issue as ATS? Does RPT use a base texture and then splat texture slots as the detail textures?
As currently using terrain composer, I have slot 1 as my base texture that we spoke about above, then I have another texture that is also big for long distance viewing, then one more texture that I use to help break the tiling up. To use ATS or RPT the above would need to be compiled into one base texture leaving the slots empty for the detail textures?
Nope. I allready tried it. It doesn't change anything. This problem with shadows is really annoying but I'm sure there is a solution. I guess many people have to deal with this, because it appears as soon as you have big objects.
HI, im getting a bit confused with placing trees using filters.
What I am trying to acheive is to place trees by colors of the image AND only under certain height.
So I add a height filter, works fine, places trees everywhere but all below a certain height. I then add another filter that uses an image but when generated it seems to ignore the height filter and still place them high up according to the image filter?
They acting like two seperate filters, I would have thought you add multiple filters to set the overall outcome?
it worked! however I found the weird string in some other places (see screenshot below), but it doesn't cause any problems (so far). Is it harmful?
Thank you for great support.
Think of it like this: the trees that are output from each filter are added together.
You need to look into Masks to achieve what you want. For example, you can use the image to generate the trees and then use a mask to limit the height at which the trees are placed.
I am having great success setting up a multi-terrain system from World Machine into unity with RTP Shaders using TerrainComposer, and was wondering if there is a way to define the splat coverage based on individual sets of grayscale images like Thomas does in his RTP Example scene's World Machine project (low rocks, high rocks, sand) based on layer coverage instead of splatmaps? I will be combining the those maps into splatmaps for simplicity, but figure'd I'd mention it incase anybody else runs into a similar situation where they want to individually control coverage outputs instead of combining them into splatmaps
Well neither ATS and RTP use the splat texture slots, those you have to leave alone, you have to set them up in the script that you assign to each terrain.
As Weasel suggests, you need to use masks for this, as a filter decides which tree to place, a mask decides if the tree is placed or not. The first mask output you leave on Max, and the second Mask with the height you have to put output on Min.
No it's not harmful. I will look into this how to resolve it...
This seems to be a limitation in Unity. What Unity version are you using? I tried in Unity5 and it seems to work ok for a 450x450 km terrain.
A better solution for very far terrain would be to use Horizon, as it doesn't cast shadows and works directly on GPU.
Peter is almost ready, and will release it hopefully next week.
I apologize, but do you think you could go into more depth on this (or could someone else if they wish)? I'm trying to do something similar, but I have no idea how to do it. I've set two masks, one at "Max" and the other at "Min." Both have the mode set as "strength" and the input as "Height." I've tried making the "curves" flat lines with max high and min low, and also reversed with max low and min high. I've tried making them simply "angled up" and "angled down" lines and adjust each of the four sides individually to see a difference, but I'm seeing it.
Also, maybe I'm doing something wrong, but it looks like the mask is actually adjusting the AMOUNT of trees, not where they are generated. It's called Mask>Tree Density (Height) after all.
Also, do you (or again anyone) have a suggestion for colliders for trees? Given Unity's limitations, it's not possible to give them all colliders...is it? The only thing I can think of is attaching them to the terrain mesh, but for what I'm planning that won't work.
Why do you use two masks for height? Yes the mask is for the amount and a filter for choosing which tree. I've made an detailed tutorial for this:
TerrainComposer tutorial about filters, masks and curves (New)
As for the tree colliders in U4.x is this limitation of 65k colliders. Unity5 has a new physics and has no collider limitation:
So for that Unity5 is the way to go...
I think this happens because TC uses 2 prefabs. 1 for each Scene and 1 globally. I only put the one for the Scene. Here's the 2, be aware that in the global all WorldComposer area settings are saved, so that will be resetted.
Yes this is possible. I write about this 2 pages back:
There's 3 possibilities in TerrainComposer for using images for splatmaps.
1). The image uses the 4 RBGA channels for each splat texture. This is how splatmaps work on Unity terrain and how they are exported from WorldMachine. For 8 splat textures, you would need 2 splatmaps. This technique give you full control over the mixing between splat textures. In TC put mask input to Image, in settings enable Splatmap and Alpha channel toggle.
2). Create everything in one image where you use solid (no gradients) colors (can choose yourself). In TC mask put input to image, in settings splatmap needs to be disabled. In Color Range you put mode to 'Select' and then drag and drop your splat texture in the image slot and shift click <Detect> to automatically detect the colors that are used in your image. Then with the integer field behind each color you can choose the index of the splat texture to use with that color. This is easy to use but gives limited control between the mixing of the individual splat textures, there's 1 settings that controls the blending for all and that is 'Edge Blur'.
3). Use the method as you do were you use a black/white images. This gives the most control. You can use multiple layers where you put 1 or even more splat textures and add you images as a mask to the filter. The filter always chooses which splat texture to place from the layer, while a mask is the paint strength (alpha) of the chosen splat texture. I show in this video how the masking works with black/white image:
For using 1 splat texture as a base, you can have the first layer with the splat texture in there. Then the other layers you can overwrite by setting output to 'Change' and mode to 'Layer'.
I used the greyscale mask feature in doing the splatmaps for the 24 hour demo:
https://www.dropbox.com/s/if9dpxqeseenj11/24 Hour demo - How we made it.pdf
I'm using two masks because you suggest it in your statement a few posts up:
Perhaps I misinterpreted you. Just to be clear, I'm trying to do what that other user mentions--make trees below and above a certain height. I'm not sure how to do this.
I did see your tutorials, but I'll be honest, I have a limited internet connection that I can't use on lots of high-quality Youtube videos. I was planning to go to a coffee shop or something and download them, but as it is I don't have the bandwidth to "spend." But--DOES the video address that specific problem? If it does, I'll stop bothering you and watch it when I can.
Thanks for the info! I wonder when U5 gets released, or if the beta is worth it...
Yes but he's using 2 masks because he's using 2 rules. 1 mask for the height and the other based on an image where he only wants to place trees where the image has green tint. If you only want to use height, you need 1 mask, another mask you can do for steepness (if you don't want trees on high slopes).
Yes I explain everything in the videos...
So for a height mask:
1). Add 1 mask and keep input on max.
2). Invert the normal curve. (Click curve button -> Line -> Invert).
3). Drag the right curve key to the left (this is the height where you put density on 0).
P.s. heights on Unity terrain are normalized between 0 and 1 (1 is the height you put into TC terrain list -> Size -> y). You can measure with the measure tool what the normalized height is on any place of the terrain, and put your curve to that value...
Man, I hope to one day make terrains that look that good (I just got RTP as well but haven't figured it all out yet)
But anyway. That worked! Thank you so much for helping out, and especially for the visual aid.
Hi, I have the ATS terrain shader and you hav to assign your splat textures in unitys texture slots prior to assigning the shader to the terrain. In the script properties you set the basetexture, and then you assign splat textures in unitys texture slots, then you add a splatmap ETC.
Is this not how RTP works?
RTP has a much more advanced terrain script. To see how RTP works you can look at the RTP tutorial video, the link is on the RTP Asset Store page.
Now I'm using Unity 5 RC3. But this appears also in Unity 4. Your probably right, it's certainly a limitation in Unity. I made the same terrain but with smaller parts and it work much better.
Thanks a lot for the link to Horizon On, I'm very intersted in.
I'm glad to see talented devs speaking together : Tom, Peter and you are the dream team for terrain creation.
Thank you again for trying to help me.
I'm using 8 layers with RTP and getting index out of range errors when trying to set the splats. This is with 64 terrains with 2048 resolution for the heightmap (unity 5).
It was working then I started getting this when I changed splat #8. Now it's stuck on the last one in that slot that worked. The splats are getting set correctly in the terrain script and RTP.
IndexOutOfRangeException: Array index is out of range.
rtp_functions.CombineHeights (UnityEngine.Texture2D source_tex0, UnityEngine.Texture2D source_tex1, UnityEngine.Texture2D source_tex2, UnityEngine.Texture2D source_tex3) (at Assets/TerrainComposer/Scripts/rtp_functions.cs:135)
rtp_functions.PrepareHeights (Int32 num, Int32 numLayers, UnityEngine.Texture2D Heights) (at Assets/TerrainComposer/Scripts/rtp_functions.cs:111)
TerrainComposer.create_rtp_combined_textures (.terrain_class preterrain1) (at Assets/TerrainComposer/Editor/TerrainComposer.js:17867)
TerrainComposer.draw_terrain (Int32 space) (at Assets/TerrainComposer/Editor/TerrainComposer.js:6203)
TerrainComposer.Paint () (at Assets/TerrainComposer/Editor/TerrainComposer.js:2471)
TerrainComposer.OnGUI () (at Assets/TerrainComposer/Editor/TerrainComposer.js:890)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Bind
Went back down to 4 splats and same issue. if disable RTP in TC then set the splats that gets them synced with RTP, then enable RTP in TC again and it works even though I still keep getting the same error.
I have few questions, sorry if it has been asked before.
1) Is it possible to use TerrainComposer with existing terrain.
2) Can you say that terrain painting in TC is better than Unity's terrain painting? Is it covered as a feature?
Thanks in advance
That's an ambitious heightmap 8x8 x2k = 16k heightmap, yes Unity5 can render this, how's your performance?
Do you have all the height textures assigned? Can you send a screenshot of the splat texture window?
1). Yes this is possible, just drag and drop your terrains in TC terrain list.
2). TC is not a terrain painter tool, but a terrain generator tool. So you can use TC to generate height maps/splat maps/color maps/normal maps/trees/grass and place objects. Then you can use the Unity terrain painting to make manual adjustments.
All height textures were assigned but had a mix of resolutions. The issue appears to be RTP caching old data. The fix turned out to be going into the RTP layers and making sure to refresh them after TC assigned them. I figured that out after I saw old splats on the terrain even when RTP, TC, and the terrain script all showed the old splat wasn't there, even though it obviously was because I could see it on the terrain.
Performance for the terrain itself is good. Trees hurt a bit, and object meshes kill it. I dynamically load/unload terrains based on distance from the player, and only load meshes on the terrain the player is on. That works pretty well at runtime. I've found it's really the number of regular meshes that effect performance the most. So I'm probably going to move to using a spatial hash with meshes categorized by size, and activate larger meshes at a further distance and smaller ones at a closer distance.
Bit of an issue, I'm getting an odd flickering on my trees when I move around in "play" mode or in a standalone build. It's also visible in the editor, but it's very very much reduced.
See the image for reference--if you look on the right side, about the middle of the bottom part of the hill (just look straight up from the grey cube), you'll see green areas that look like there are no trees there. That's not true--they aren't visible, and when you move the view or move around a little, they flicker in and out, and those trees become visible, while others that WERE visible aren't visible anymore.
It's worth pointing out that my terrain size listed in Terrain Composer's settings are X=15000, Y=2000, and Z=15000. A single terrain. And I've generated 100,000 trees roughly. Could it simply be the huge size of everything (I have the terrain centered at the world coordinates origin, FYI) that's causing the flickering? Or do you have any idea?
Any suggestions on a great terrain texture pack? I'd like to find something that has a wide range of terrain types. The textures I have are alright for placeholders but they don't really pop like some of the screenshots I see here.
Are there any recommended settings for Unity5 and GI wrt: WC/TC terrains. Mine are baking forever and even at the lowest default setting is says it is still too high
I'm considering buying this asset to support the development of my game. For that purpose, I need to understand something before...
In my game, I need to generate several worlds in runtime. So, it would be one terrain for one world. Then, we want to show evolution in the terrain during the game like change in the vegetation, add dryer zones, new wet zones, etc.... In this scope, do you think is feasible to:
1. Generate several terrains (worlds) in runtime,
2. Store them in runtime. They all shall become available during the game,
3. Change textures and place objects (like buildings) in runtime.
Thanks and congrats for your product!
Hello, so I'm currently running Unity 5 beta f3 and I'm getting some errors.
So when I import Terrain composer this api updater comes up.
the outcome on if I allow it to update or click not now is exactly the same.
after it finishes, I do not have terrain composer come up in the window tab.
I am also spammed with errors in the console.
Thanks for reading.
I had the same issue but after number of hours I finally fixed it. Here is how:
-delete TC from the project folder
-import the TC
-click No Thanks when API Update show up
-click again No Thanks
-run API update manually from the unity Menu.
After that you should get the TC back to your window menu
Flickering is almost always caused by z-fighting. This has to do with the camera depth buffer which is influenced by the near and far clipping you put. For less z-fighting have the near clip as high as possible. If that doesn't help you can use 2 camera's on top of each other. There's lot of information about z-fighting on internet:
Michael O has some good terrain textures, like in nature pack.
WC/TC terrains are standard Unity terrains. Here's information about that:
1). TerrainComposer can generate in runtime in the background, so yes this is possible.
2). How exactly need terrains to be stored? Can the player create a terrain?
3). Yes this is possible.
TerrainComposer works fine in Unity5. Make sure there's no double scripts in the folder TerrainComposer/Scripts, if there's a global_classes 1.js, delete it. This happens if you import WorldComposer as well as TC/WC share that file, but U5 clones it instead of replacing. I will have this issue fixed in the comming updates.
Also if you have any other errors in the console unrelated to TerrainComposer, you need to fix those before the compiler will compile TerrainComposer and it is show in the Unity Window menu.
Hi Nathaniel, thanks for your reply
regarding 2) ... well, the game generates planets, and then, it would be nice to generate one terrain for each planet. That terrain shall be available during all the game for changes. From your other feedback points, it seems feasible. Thanks.
And what about support and documentation for runtime changes ? Is there any consistent documentation regarding the methods used via panel in order to replicate them in a script ? Example: "Generate Terrains"... can I call something like: script.generate_terrains() ?
Hello! I have problem. I place objects on the map through the terrain composer. An imortant point is that i use prefabs, but terrain composer breaks the connection objects to prefab. You can make a saving connection objects to prefabs?
Ah, I just adjusted my camera and fixed it. Thank you so much for your help.
Really awesome plugin, pretty amazing the quality you can get with this. Unfortunately I still have a few questions.
First off, I'm using the First Person Controller from the standard assets package to plonk a quick test player on the map, after wandering around for a bit it will fall through the map, not sure if this is at specific points on the map or not. Any ideas?
Also I'm intending on randomly generating a map with a flat space that the player can build on, any ideas on how I can achieve this in runtime. I currently have various scenes which allow login, character creation and joining a multiplayer world using Photon Networking, so when they join for the first time it will randomly generate their world in runtime, this works fine but I need to edit it slightly to make the flat space mentioned above, and some sort of boundary around the outside - maybe by creating unclimbable mountains at every edge. Any help would be much appreciated, or just a pointer in the right direction so I can play about myself.
Two scenarios, first one: I am about to export an height map r16 4097x4097 from WM, and also FlowMap\ColorMap\Depo etc, but I am not sure about resolution for the maps (flow etc). Should I set them to 4097 or 4096? I am going to setup 4 terrain tiles in unity with TC.
Second one: 4 tiles from WM, what should be resolution for height map and color etc? Destination: 4 terrain tiles in unity.
Thanks and regards
Getting a error when trying to add an object.
MissingReferenceException: The variable Combine_Children of terraincomposer_save doesn't exist anymore.
Be aware that Unity terrains are flat, and they cannot be a round sphere. Yes that is possible, I have a runtime package with a help file and an example script for Unity script and one for C#.
Yes this is possible. You can place objects without breaking the prefab connection for each object you place. You can unfold each object in the object layer. Then in 'Settings' enable -> 'Prefab Link'.
As for the FPS controller, TerrainComposer generates standard Unity terrain and these have a terrain collider. It could be that you get an error in the console during runtime that make colliders stop working. Did you place many trees with colliders?
Yes this is possible. For the heightmap you can use an image mask for this (the image should be 16 bit raw grey scale). I made 2 tutorial video for this:
TerrainComposer tutorial about filters, masks and curves (New)
Help Video Heightmap and splat texturing mask (Use a 16 bit raw grey scale image, instead of 8 bit image, for more precision).
Heightmaps in Unity are ^2+1, so 33,65,129,257. And images are ^2, so 32,64,128,256,512 -> 4096 would be good. If you want the same heightmap resolution in Unity, you have 2x2 terrains, so everything should be divided by 2 to calculate resolutions for each tile. Heightmap 2049, images 2048.
It's missing in the latest TC version. If you import the package it should work fine. I will have this fixed in the coming update.
If you don't want to combine, you can unfold each object and disable combining in the settings. You can do this for 1 object in a layer and shift click >set all, to apply those settings to all objects in the layer.
Thanks for the reply.
I opened the asset store and clicked on import, but the only things that are new are the terrain textures.
Nevemind, I installed that script and it works fine now
I know I bought this thing like... a year ago lol. Just started using it. I have the latest TC installed.
Also, one more question.
Say I make 2x2 tiled terrain. Can I make another separate 2x2 terrain? I made a new height map in photoshop for the south side of my mountain but I don't want to use any layers from my first terrain.. I hope this makes sense lol. I am terrible at explaining things.. (so says my wife)
Got TC this week and it's fantastic.
I've got a 10m DEM from the USGS which covers an area 140 x 7km (which works out to be about 14k px on the long side). That's huge, I know. And not power-of-two.
Any suggestions on strategies for getting this into TC efficiently? I've made the heightmap artificially PoT by adding more to the canvas size in PS. Then applying this to a 7x7 tile terrain in TC with 2049 resolution for each tile. This does import the terrain, but munches it terribly. In some tiles I have sheer noise, in others virtually no detail at all and in others beautiful detail. I must be approaching this the wrong way, but I'm stuck.
Any advice would be appreciated. Thanks!