Search Unity

World Building [RELEASED] CScape - advanced building generator

Discussion in 'Tools In Progress' started by olix4242, Mar 11, 2017.

  1. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    They will be shipped as adittional packs but they will require CScape. I hope that that there will also be some packs from third developers. I'm allowing all developers to create and eventually sell their own packs or addons for Cscape without any licencing limits - as long as it requires CScape I'm Ok with that.
    It's hard to answer. Medieval requirements are somewhat different than modern/futuristic city. Unfortunately, It's something for what I don't have any passion or knowledge - and I don't have any idea how it should be approached. Sorry to say that, but my approach on anything that I do and make, is mostly based on a simple idea, that I should do things that I can do with passion and that I can do best. So, from this standpoint of view, you can be sure that I won't be adopting this plugin for this type of task. But this doesn't mean that somebody else won't be doing this. but mostly, medieval things are so different that I don't think that CScape can meet their requirements without rewriting it from scratch for this purpose. For example, CScape shaders are made to work well with materials as concrete, shiny metal, glossy windows, repeating structures, while medieval things have need for rock, probably no glass, rusted metals, grass, used rock or muddy roads, fire lighting and probably also different concentric circle city layouts. Frankly, I think it's not a kind of task where CScape shines or could shine in a future.
    Tricky question: Yes, you can save city prefabs for later use in editor. This means that you end up with a prefab that can be loaded with all settings. But, once imported into a new scene, you have to 'rebuild' a prefab with a click of a button. Cscape won't save any mesh with prefab, but only it's procedural and layout settings.
    What you can't do: you can't load your prefab into your scene in runtime. CScape uses some Editor only functionality that isn't available outside of editor. This could be avoided in future by using some custom made scripts for same tasks, but without native functionality, it would have to be quite slow (as recalculating tangent space for all objects, recalculating all meshes, reinitializing physics). And anyway, you would loose any optimization functionality without possibility to bake occlusion or shadows (and a list goes on and on). Any type of dynamic loading would simply be less efficient as CScape is heavily optimized for Unity (and I can assure that this is done in a most efficient way) and dynamic loading would simply break those optimizations.
     
    BackwoodsGaming likes this.
  2. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Here is a small script that can be a good starting point:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using CScape;
    5.  
    6. [ExecuteInEditMode]
    7. public class PlaceObjectOnRoad : MonoBehaviour {
    8.     public GameObject streetsHolder;
    9.     public GameObject objectToPlace;
    10.     public int laneCountOnX;
    11.     public int laneCountOnZ;
    12.     public int placeOnLaneXNumber;
    13.     public int placeOnLaneZNumber;
    14.     // Use this for initialization
    15.     void Start () {
    16.        
    17.     }
    18.  
    19.     // Update is called once per frame
    20.     void Update()
    21.     {
    22.         StreetModifier streetMod = gameObject.GetComponent(typeof(StreetModifier)) as StreetModifier;
    23.         if (streetMod != null)
    24.         {
    25.      //how to get number of lanes for a road
    26.             laneCountOnX = streetMod.blockWidth - streetMod.sectionWidth;
    27.             laneCountOnZ = streetMod.blockDepth - streetMod.sectionDepth;
    28.      //place on lane 1 for first, 2 for second and so on.. this sets object on a crossroad, can be changed to place it anywhere with a similar approach
    29.             objectToPlace.transform.position = new Vector3(gameObject.transform.position.x + streetMod.blockWidth * 3f  - (placeOnLaneXNumber * 3 - 1.5f), gameObject.transform.position.y, gameObject.transform.position.z + streetMod.blockDepth * 3 - (placeOnLaneZNumber * 3 - 1.5f));
    30.    
    31.         }
    32.     }
    33. }
    34.  
     
    coverpage and Alverik like this.
  3. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Good information! Thanks for the openness and honest opinions about CScape working with medieval towns. I think I still have a good use for it for modern/futuristic post apoc genre. I'll check out all the videos this weekend while on a fast internet connection and if all looks as I think it will, I'll pick it up whenever Unity pays us this month. If I get the brainpower to dig into scripts/api I may still attempt adapting for fantasy genre and see if I am able to find/build shaders which can be used that are appropriate for that genre.

    Thanks again for all the info!
     
  4. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Thank you appreciate it
     
  5. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No,. you can't simply "find" any shaders for this. Cscape approaches things in a different way (and this makes it so powerfull and optimized). For example: all CScape buildings in a city use only one single shader and all buildings share a single material. This is a material that uses procedural shader capable of 'containing' thousands of different variations of materials and faccade shapes. It is also extremely complex shader.
    But using a single shader/material gives an advantage in performance that can't be acheived with other tech. Why? Because using a single material means that unity will have easy time in doing static or dynamic batching. Modern hardware (even mobile) is pretty capable of rendering milions of polygons wothout any hicckup. What slows down rendering with large scenes is that a typical scene uses many meshes, many shaders, and many materials. If you for example have a scene with 100 houses, each house will probably use atleast other 5 materials (if not more). Each mesh with different material requires another rendering pass - and can be batched only with another mesh with a same material. So if all buildings haave different materials, those buildings won't batch properly, and will require CPU to work all the time to upload and unload used and non used meshes/materials. This sows down a whole process.
    With CScape you don't have this problem, because it renders in few passes. Right now Unity has a limit od 65,534 vertices per mesh (that, when you add UV drops down to half, with lighting to quarter and to on).
    A good news is that CScape, starting from Unity 2017.3 should have a great increase in performance by dropping drawcalls even more. Actually, Unity is introducing 32 bit mesh index buffers, and this is a great thing for CScape.
    From 2017.3 beta release info:
    Graphics: Support for 32 bit Mesh index buffers:
    • By default meshes larger than 65k vertices will get imported with a 32 bit index buffer; smaller meshes still use 16 bit indices.
    • Added "Index Format" setting to mesh importer to override this behavior.
    • Added Mesh.indexFormat to scripting API for meshes created at runtime.
     
    tapawafo and Alverik like this.
  6. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Still not sure how far can I go with this but here is a little test. Actually, I've started making this sky shader just to do some renderings. But for now it' seems that it works pretty well, and I was thinking that I could probably include also this one in CScape. I will have to see if I can make it how I want it to be.
     
  7. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
  8. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    What is your unity version?
     
  9. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    After thinking a little bit, it is quite probable that you have some other plugin or script in your project that messes thing up. Could you please open Cscape in an empty project and see if it works?
    Most probably you have some class that redefines unity's own built in Gradient, and this breaks up things.. you should find an intruder somewhere in your project.
     
    Last edited: Oct 7, 2017
    Alverik likes this.
  10. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    I guess that's it - I remember downloading a gradient for Unity UI.

    I've already tested it in a new 2017.1 project (the error is in my 5.6.3 project) and it works there, so I guess I just need to rename/delete the gradient thing.

    EDIT: Got it to work!
     
    Last edited: Oct 7, 2017
    olix4242 and hopeful like this.
  11. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    159
    Hello, I bought this asset today after waiting a few months and watching all the videos... It looks awesome!

    I don't know yet if it will work for my needs, so I have some simple questions...

    1 - Building placement in blocks in existing scenes

    I am making a driving simulator. My desire is to be able to use CScape to create square blocks of buildings and put them on my actual scenes. Is that possible? (I hope so hehe).

    I need a mix of building placement, some blocks with this tool and others manually (my own models on not straight roads). For example:
    https://imgur.com/a/UsP6s
    Let's say that I want an automated block on the "x" marks and my manual custom buildings on "M", with my custom roads between the blocks.

    Is that possible, or if it is not, will that be possible in an update?

    2 - Does it work with Realtime GI? Update: Yes, I tested and it is beautiful!
    I don't use any backed lightmap due to a realtime day-night cycle and other problems that I had in the past (build sizes, time to generate etc).

    3 - May the meshes be exported some day, in a future update? I read this here on forum, but to make sure or upvote as a feature request... It should be perfect if we can create a design in editor and then export the buildings for later use in Unity or even in other 3D modelling software.

    That's it for now, I'll download and try your tool. It is something rare to see with such quality.

    Update:

    I tested it now. Amazing! Of course there are some problems that I cannot fix now, but I'll watch the development process until a point where I can use it for production. In a few months this tool would be so great!

    For what I saw I can put my custom objects on the roads or sidewalks, since the position will be the same using the same seed and settings.

    I saw some blinking textures on buildings and one place with a build on the street. Not common, but it happened in a large block.

    Scene loading take a bit longer, are the buildings recreated in runtime?
     
    Last edited: Oct 7, 2017
  12. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Oh well... another small thing.

    upload_2017-10-7_23-18-49.png

    A few buildings have heavy z-fighting on top.
     
    Marcos-Elias likes this.
  13. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    159
    I recorded a video driving a bus in the city, I'm in love already with this asset <3



    In this video we can see a few small bugs, like the z-fighting in some buildings and also some buildings placed over the street. I can't wait to see the stable version! It has a huge potential and an amazing quality. I'll prepare a playable prototype with AI traffic and more life in a few weeks.

    Ah the day-night cycle and sky are from Enviro (another asset).
     
  14. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Is this screenshot from game view or from scene view?
    I don't like it. I had this issue sometimes in Scene view in unity, but never in Game View or build. And it disappeared after restarting unity. Can you confirm that this is issue happens in build or in Game View? Is this happening to some buildings far away from a world center (0.0.0)?
    Actually, this isn't a Z fighting issue, I think that this comes from floating point loosing it's precision and shader going nuts by switching from zero to one where it should actually use zero or one. You should be able to correct it manually by making your building one floor taller or shorter. But I think that I have a solution for this issue. Let me put my hands on this shader, and I can send it to you, so that you can test it.
     
    Alverik likes this.
  15. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Of course. You can use as many CScape City generators as you wish, and place them (move and rotate) treathing them as city districts.

    Yes. And it works quite well with realtime lighting because of optimizations and low count of draw calls. If you aren0t targetting mobile platform, it should be a best way to get a nice lit dynamic environment.

    For a way CScape shaders work, it is impossible to export those meshes for rendering inside other programs. 3D modelling software doesn't have access to shader language and Array textures, so it would be extremely hard to do this type of shading inside some other 3d editor/rendering software that doesn't have any native way to read or render this type of functionality. I personally would like too to be able to export whole models. As you can immagine, being able to render this city from other software would be a breaktrough, but for now, it simply isn't possible.
    What you can do? You can easily export only mesh for usage in 3d modelling software, and use this mesh as a reference for adding other models. It's enough to download a free Scene OBJ exporter and export your scene.. https://www.assetstore.unity3d.com/en/#!/content/22250

    Yes, I have a few bugs with some buildings. A city generation scripts tries to check if a building can fit a tile without overlapping other buildings, but for some reason, sometimes this test doesn't work. Not sure if this is related to some templates or to a script itself. But, anyway, I will be rewriting this code to work in a different way (right now City Randomizer manages all generation, but I want that you can be anle to manage buildings generation from a street object level so that City Rendomizer generates street layout, and then all streets generate their buildings with seeds that can be modified from a street level.
    For now, you can avoid those overlapping buiuldings by manually adjusting them - resize, move and delete them around.
    No, they shouldn't be recreated, but it's possible that there are some elements that are updated (probably lighting pole LOD's) when using it in editor (in a build it doesn't happen). But, mostly, it's unity that has to do a static batching for a large number of objects, and this is a cost that you have to pay (as it helps your optimization).
     
    Alverik likes this.
  16. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Nice demo! :)
    One TIP: I can see that you aren't using CScape integrated night-day functionality that would animate all building lights and illumination (so that you don't have lights on at day, and lighten up a city at day/night transition. This should be pretty easy to do. I don't own Enviro, so I'm not sure how it manages, but most probably, it has a main Direct light that it uses as a sun. Go to a CScape City, find a script called CSLights Control, and set your sun and sunlight objects to a direct light that enviro uses. Then set my script not to use Control Sun (this field says if my script should animate sun light or no). This script actually takes rotation of a sun light, and animates CScape lights based on an angle from that object.
     
    tapawafo, Marcos-Elias and Alverik like this.
  17. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    @olix4242 could you look at adding support for the open source world manager asset? That would give us one place to control things like the time of day and sun position, etc. Enviro already has this as do several other assets and it is controllable via unity's timeline. You only need add support for those parts you think would be useful to expose and then you would have timeline support too.
    https://forum.unity.com/threads/world-manager-generic-world-management-system.484239/
     
    JBR-games and olix4242 like this.
  18. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    I am considering buying this.
    Does it built roads as well??
    Hows the performance. I wana use it on webgl. Will it run sommethly with a medium sized city??
     
  19. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    159
    Perfect, thanks for all your replies!

    I have exported an obj and was thinking about this before. But If we change the building position in the scene it still works, I think. So for use inside Unity It seems ok (reorganizing all buildings manually after they were generated). Exporting a building as a prefab will be possible? If we do this today it loses its mesh data.

    That video was recorded after a few minutes playing with the options. I'll change the sun referente to allow that, thanks for the tip :D
     
  20. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    WebGL isn't supported. Actually, It can't be supported because it doesn't have neccesary functionality (WebGL dosn't suport Texture Arrays).
    EDIT: looks like 2017.2 introduces support for WebGL 2.0 so it might be possible to integrate it.. I will look into this.
     
    Last edited: Oct 8, 2017
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, but it keeps all neccesary information to be re-built in editor. It's just a click on "Refresh City" button (or calling
    Code (CSharp):
    1. CityRandomizer.Refresh();
    on your object from code.
    Actually, a support for exporting prefabs can be made, but this will fill your HD with thousands of meshes and you would loose editing possibility. I can't see cases where this could be desiderable without making things more complicated and less performant .. Correct me if I'm wrong.
     
    Marcos-Elias likes this.
  22. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Looks like a nice idea. I will look into it.
     
    JBR-games likes this.
  23. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    why isnt webgl supported. I mean i can build a city with pc build and change it to webgl platform and it should work right??
    wat if i use my own building prefabs will it work??
     
  24. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    Think the issue is that cscape uses texture arrays in its shader code which aren't supported in webgl but hopefully olix can make it work in webgl 2.0. It is the shader code that makes cscape what it is.
     
    olix4242 likes this.
  25. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    That's right. Without it's procedural shaders, it simply can't work.
     
  26. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,372
    I would like to use this to place buildings along road vector data such as that from open street maps. It has to be able to do this at runtime, distributing workload over several frames to prevent stutter. Is this feasible?
     
  27. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    For now, it' isn't possible. Building generation is available only in editor, as it uses some functionality that is available only in Unity editor. Some of that functionality could probably be re-written for runtime uasege but it would be somewhat slower as it woudn't use unity native functionality. Also, you would never get a great rendering quality as you couln't use lightmaping. Also, a performance would suffer as there are some optimization tricks that can be used only from editor (like baking occlusion) and using static batching.
    At some point of developement, I might also implement runtime support, but for now, it isn't on priority list for reasons mentioned above.
     
  28. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Right now I'm uploading a 45 minutes video tutorial/Vlog on basic usage of CScape and some tips and tricks.
     
    Alverik, Marcos-Elias and hopeful like this.
  29. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    OK, here it is.. forgive my bad english and slow explaining.. this is a first youtube tutorial that I'm making.
     
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Hey there, @olix4242! :)

    I'm using the latest CScape on Windows 10, ATI HD5750, Unity 2017.1.0p4, linear/DX11. When I run the demo scene, I get an error that is repeated for about every building (hundreds of errors). I also have a blank script on the camera. Not sure what that is supposed to be (bloom?).

    My performance is about 22fps according to Unity's stats (45ms, set pass 65) when I run the demo on full screen, so I'm trying to see what's going on and how I can fix it so there are no errors and the performance is optimized.

    Here are my warnings and errors:

    Shader warning in 'CScape/CSBuildingShaderMobile': floating point division by zero at line 143 (on d3d11)

    (It isn't reported on console, but there's the same error on CSBuildingShader at 214, and InteriorSCape at 54.)

    Assets/CScape/Scripts/CityRandomizer.cs(762,17): warning CS0219: The variable `initAdv' is assigned but its value is never used

    Assets/CScape/Editor/BuildingModifierEditor.cs(405,19): warning CS0219: The variable `size' is assigned but its value is never used

    NullReferenceException: Object reference not set to an instance of an object
    CScape.BuildingModifier.OnDestroy () (at Assets/CScape/Scripts/BuildingModifier.cs:446)
    UnityEditor.HostView:OnGUI()
     
    Last edited: Oct 11, 2017
  31. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Hi,
    Empty script: you have to download Poost Processing Stack (image effects) from Assetstore. It is mentioned in documentation as requirement for demo scene, with a link to that free asset.
    Those errors should be harmless as they happen only the first frame (in editor, it won't appear in build). This is a hack in my script that let's you delete objects that are connected to a building - that probably isn't a best way to do it, but untill now I didn't find any other solution. You can freely delete line 446 in Assets/CScape/Scripts/BuildingModifier.cs
    Maybee a spam error has some influence on performance on old systems.
    What does Profiler say? You should look into Profiler and see your GPU and CPU times. Also, what level of detail are you using? Do you generate lights? Do you generate trees? Without knowing this it' hard to tell what causes slowdown.
    You are running this on pretty old hardware (I don't know what is your CPU). ATI HD5750 is a 8 year old hardware and it has it's limits - probbly doesn't have a good fillrate. Some things that are simple for modern hardware (even mobile) can be difficult for this old tecnology. You can check what is your bottleneck with few tests:
    -zoom out your scene, so that city covers only one small portion of a screen. If a framerate goes significanlty up, then you probably have a bad fillrate. And there isn't much you can do about this.
    -Try to turn off realtime shadows and see if performance goes up.
    -Turn off Precomputed Realtime GI in lighting settings - this should free up some CPU.
    -If you are using trees, turn them off. SpeedTrees can be pretty heavy for old hardware.
     
    Alverik likes this.
  32. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Okay. Not going to worry about the script on the camera as it is just post FX. :)

    I commented out line 446 in the BuildingModifier script, and it does indeed eliminate the error message without appearing to impair function.

    I'm just doing the plain vanilla "Generate City," and no other functions. If I place the camera at roughly the 0,0,0 corner (lifted up a bit and tilted downward a bit to give a good city view) I get about 16 fps. Turning off shadows makes no significant difference, and I'm not using GI. I'm going for a minimal usage, but the demo scene is evidently too much for my machine.

    I'm not that savvy with the Profiler yet, but the top line item is Gfx.WaitForPresent, which is like 80-90% and 20ms. The scan shows significant up and down spikes.

    Some people think there is a bug related to this with Unity on DX11, but maybe there is no bug. (I turned Quality > vsync to don't sync, and it made zero difference. Turned shadows off on the single Directional Light. Video drivers are up to date, and vsync is also off in the driver settings. Some think it may be due to thermal throttling, but my GPU fan is not running hard.)

    I can gain a couple of frames by turning GPU Skinning on.

    I gain a couple of frames by turning Graphics Jobs (Experimental) on. But turning both GPU Skinning and Graphics Jobs on does not produce an additive gain, only the same amount as either one would produce on their own. With GPU Skinning and Graphics Jobs turned on, on fullscreen I can get up to nearly 19 fps.

    If I move the camera back from 0 z to -100 z, I get 23 fps. At -200 z, I get 30 fps. At -300 z, I get 40 fps. At -400 z, I get about 52 fps. Strangely, at -500 z the reading is unstable for a still scene, going in a range of 52-64 fps. At -600 z, the readings are just slightly higher than at -500 z.

    If I go back to 0 z on the camera and change Quality > Anisotropic Textures from Force On to Per Texture, suddenly my frame rate jumps to 66 fps. If I turn soft shadows back on, the frame rate drops to 58 fps. If I enable a realtime reflection probe (on awake), it makes no change in the fps, but the scene looks a lot nicer. ;)

    Generating all the other parts of the city, including trees, makes little difference. I get 54 fps on full screen having made the change to Per Texture.

    I don't know what that means, but there you go. :)
     
  33. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    Could it be possible to make it where say the window texture is, it adds a mesh. Hope I make sense. I was thinking like a bool where if true add mesh. So you would use that unless you need to to improve the quality
     
  34. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Then set aniso to Per Texture. It's probably that aniso settings influence performance. Aniso requires slightly more VRAM for textures, and if you are hitting your VRAM availability then you can have a extreme framerate drop once it reaches and goes over available VRAM of your hardware. Aniso filtering should be pretty non intensive on modern graphics hardware, but on mobile, it could impact performance severely. Aniso filtering is almost free, but I remember that 15 years ago it could impact really hard - andin mobile tecnhology we are 15 years behind.. so yes, this is probably a reason why you have a performance drop. I think that you are pretty save to turn off any Anisotropic filtering, or to set it to . A gain in quality that Aniso gives can't be seen that much on a small mobile screen with a large pixel density.
     
    Alverik likes this.
  35. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Sorry, I don't think I've got it. Could you explain more? ;)
     
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Yup, Per Texture sounds like a winner right now. As for VRAM ... the card has 1G.

    I'm developing with desktop as a target, but if possible I want to be able to accommodate integrated or other very low end graphics. So far I can do a lot with this GPU. Before I found the aniso trick, CScape was the only thing I was looking at that crushed my frame rate.

    I'll have to see how that Per Texture setting influences other situations ... but early research suggests it should be positive all around.
     
    Last edited: Oct 12, 2017
    Alverik likes this.
  37. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    I finally had the time to test Cscape and wow :) really beautiful! Great art and shader work! (all things I'm not great at by the way, lol). The speedtrees don't make it justice though, wish Unity would replace that system already (not only are they slow and cost money, but most of the cheap or free trees are ugly... and you can't make your own, unless you pay for the speedtree tree creator...). Anyway, I'll be taking a look at the video tutorial (I really want to know how to use custom made buildings and setup custom images for the interiors). Totally a game changer tool for city scenes. Can't wait to use it in a project. I have a particular project in mind, but I'll need some scifi looking buildings with a slightly post apocalyptic feel, lol (for an abandoned scifi city feel, lol), since it's scifi I can probably get away with a lot of shiny surfaces and stuff, maybe can even keep some of the building almost as is.

    I did notice the poster issue someone mentioned before, I think. A few signs pop into view when far away and disappear when close up for some reason.

    Also, is there a way to add more dirtiness? like papers, leaves or other dirt on the streets? (and some stuff on the walls). Sometimes it just feels a little too clean. Though, I've never been in a big city like that, so I'm not the best judge I guess.

    Anyway, the feeling of wandering the streets, or specially flying over the city watching the rooftops was awesome!
     
    Last edited: Oct 14, 2017
  38. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515

    your plugin is amazing but what im needing is say i want to be able to blow out part of building with an explosion or allow someone to break in through a window.

    so i was thinking we could keep it like this but if dame is done to the window we replace the window with the mesh and the need other mesh(interior, etc)
     
    olix4242 likes this.
  39. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Nice idea, but I'm not sure if it can be done easily. I will have to think about this.
     
  40. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515

    I hope so it will be tough for me to use this in my game without that and I really want to use this in it
     
  41. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    After some thinking, I can say that this can be done by creating some decalls with a different material - a version of building material, but with broken windows and lights turned off. This would be good to simluate breking of windows when shooting or exploding something.
    But, If you want to replace a mesh - I'm afraid that shis would be too complex as you would have to cur some holes in a mesh. Cutting holes in a mesh means that CScape would have to rebuild whole meshes of a buildings and this has some serious drawbacks:
    -Breaking batching (that would reduce performance)
    -breaking lightmaps or realtime GI. (you won't be able to use any of them)
    -reducing performance, as you have to rebuild a whole building mesh with holes in it, and building new physics collider. This is also pretty tricky to do. But a perfromance is a main reason why this wouldn't work well. CPU power is finite, and there is no magic that can be done.
    So this solution simply can't work.
    Another way would be to use some masking textures that would cut some holes. But this also has some drawbacks:
    -Every building would have to use a separate masking texture.
    -there should be need to implement some intelligent scripting for entering those buildings because of physics.
    Probably, the best way, and only performace wise way would be, to use decall textures with broken glass, and then if your player comes near, you can make a transition to a new scene of being inside building. This is the only way that comes in mind, without impacting greatly performance.
     
  42. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515

    So what about creating the inner part of the building. Maybe only when needed? Say 6th floor is exposed so a mesh is generated at the height of the 6th floor?
     
  43. C3P

    C3P

    Joined:
    Oct 26, 2014
    Posts:
    46
    the asset doesnt seem to be working on mobile, i tested on a samsung S7 and other devices but the shader gives only black output, any ideas on how to get it working on mobile?
     
  44. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It works and it was tested on s7.
    Did you run script for setting devices on first start of Cscape?
     
  45. C3P

    C3P

    Joined:
    Oct 26, 2014
    Posts:
    46
    i guess i missed that one, i used the demo scene and set the graphics api to opengles3, which script are you referring to?
     
  46. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962

    You can see it here.
     
    Alverik likes this.
  47. C3P

    C3P

    Joined:
    Oct 26, 2014
    Posts:
    46
    thanks for the info! everything is working, very nice tool you made!
     
    olix4242 and hopeful like this.
  48. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Good news: I'm almost done with a new update and I can say that it ROCKS!
    It introduces DRASTICAL improvement in rendering quality of building material. When I've made a last version, I was almost sure that a building shader was more or less what it can be done with unity, and that there wasn't much space for some huge improvements. I was starting to hit limits of todays tech, and that any solution would result in significant drop of a performance.
    But fortunately, I was completely wrong. I had to rewrite some things inside shader, and rethink some coding and functionality by optimizing this more - and this gave me some more space for some new shader instructions and textures. I must say that I'm really happy with this update!
     
    JBR-games, tredpro, coverpage and 3 others like this.
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    @olix4242 - If it's not much trouble, and if it makes sense with how CScape works, could you add a utility script that is like a cut-down version of the current main script, creating only a single building at that location, instead of a group of buildings? Probably keep some of the same setup, with a random seed and list of buildings to draw from, but just make one building, with the lighting options and other logical features, like building dimensions.

    I'm thinking something like that would probably be extremely helpful for anyone implementing CScape in conjunction with another city building plugin, like Dungeon Architect (in city mode) or Map-ity.
     
    olix4242 and tapawafo like this.
  50. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515

    Looks amazing!!
     
    olix4242 likes this.