Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Assets [RELEASED] CScape - advanced building generator

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

  1. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    212
    I'm using 2017.4.1f1 and it's working
     
    hopeful likes this.
  2. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    254
    @olix4242
    you did not see my questions... im sad
    will it generate a street/alley level rather than a city level?
    will it generate scifi assets i provide?
    how modular is needed for my assets to work with your plugin?
     
  3. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    438

    thank you for your response. and the only issue i am getting is the one above. using the asset really isn't that important for me at the moment i was just wanting to try it out but the streets are to small for me in the demo scene
     
  4. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    212
    olix4242 likes this.
  5. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    No, it can't be a shader issue. this is clearly a post processing issue. I had this errors also in other scenes and it is mostly apparent when you have reflections and reflection probes.
    Apparently, reflection probes that get reflected into reflection probe accumulates dynamic range values, that at the end over-saturate HDR buffer (and tis also, in some cases, for an unknown reason to me, can even corrupt this buffer).
    One of the trick that I use is to lower a resolution of reflection probes - this will somewhat scale reflection intesity (intensity of specular spots that are a main source of NaN bleeding).
    This is something that should be resolved on a level of PPS and can't really be resolved on material shader side (without compromising HDR workflow).
     
    hopeful likes this.
  6. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Sorry, I've missed this one somehow :(
    It's difficult to answer this question. I suggest you to look at instruction video that I have posted, and see how CScape works.
     
  7. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    43
    @olix4242

    This asset is great. Is there a way to make 4 lane roads?

    EDIT: I found it, in the random settings.
     
    Last edited: Apr 25, 2018
    olix4242 likes this.
  8. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Yes, you can give it any lane numbeer that you want.
     
  9. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    I bought this asset and while I think it's nice, it's not usable for me. I like how it generates a city block but I don't need anywhere near the amount of 'stuff' in the shader. The fake interiors, etc. Can you provide a shader or update that only does diffuse? Or allow an option to bake the generated textures? All I want is the procedural city with textures. I don't want to use your lighting, or interiors, or a lot of the other features in this asset. I feel that if it was stripped way back, it would be more versatile for developers who have their own workflow and style.

    Obviously, this asset does that in addition to a million other things and it's too dense for me to sort through to trim it out without breaking anything.
     
  10. sefsfes134da

    sefsfes134da

    Joined:
    Apr 23, 2018
    Posts:
    2
    Hi @olix4242
    Can I simply remove any parallax from your building shader? If that, how to do it?:rolleyes:
     
  11. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    I don't know. It doesn't use standard bitmaps that are photographic deffuse textures and making them work as such would be pretty impossible and un-performant. But if you show me style taht you want, I can maybee try to replicate it in some way.
     
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Why would you want to do this? (It's a question not a critic) ;)
    In city rendomizer you can find a checkbox for "Use Parallax mapping". Just turn it off.
    It will still use some displacemet. But if you don't want it, just set Depth Scale value (on building material) to 0.
    If it's about performance, I can send you a modified shader for your needs.
     
  13. sefsfes134da

    sefsfes134da

    Joined:
    Apr 23, 2018
    Posts:
    2
    It would be great! I think that if all the windows in the buildings were just a texture, it would reduce the load on the processor. Now "CPU: main" is between 14-25 ms, I would like to reduce this value because is too much for low-cost phones:oops:
     
  14. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    CPU load doesn't have anything to do with a shader performance.
    Also, this CPU load is due to a large number of objects in editor and it should be much lower in a final build.
     
  15. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    Well, I guess what I really want is the generator. The part that places the buildings and roads. I generated a city and was happy how it looked from a placement standpoint. Some questions:

    The city is set as 'static'. However this is a problem for games that use floating origin (the world moves under the player and not the player moves through the world - this is common in open world games.) I know static objects require less processing power but it's just not an option for me.

    The shader uses advanced shader features however, it could run on anything if there were some concessions - The texture arrays could instead be a texture atlas, the depth could be discrete geometry, and the parallax interiors could be non-existent.

    The city is flat. This makes it relatively easy to place and isn't a 'that' big of a deal, but this asset could be kicked up a few notches if the city could generate on top of an arbitrary mesh (but my god, don't force it to use the Unity Terrain exclusively.) I imagine you could raycast downward and place buildings on the mesh, or set into the terrain. The roads would be difficult but that's why I bought this asset and didn't make it myself! :)

    A lot of Asset developers get hung up on specific look. When they start mentioning "HDR" and "Bloom" its a red-flag that the asset was designed more for the way it looks than the way it performs. This is cool asset, but it could be much cooler!
     
  16. JuJuCoder

    JuJuCoder

    Joined:
    Dec 10, 2013
    Posts:
    24
    When are you planing to release the apocalyptic city version?
     
  17. MorpheusXI

    MorpheusXI

    Joined:
    Jan 18, 2018
    Posts:
    49
    Hi Oli

    Would be good if solution for placing objects on street facilitated none coders. I don't know if/how that could be achieved, maybe by using a wizard referencing a fbx item and drag drop the fbx to scene - maybe several times to give location variety - effectively training the tool how/where to place. I'm thinking of things like fire hydrants, phone boxes, cars in car parks, hot dog stands, newspaper dispensers etc.

    I own CScape, wish I had more time to use it, it's a great asset.
     
  18. MorpheusXI

    MorpheusXI

    Joined:
    Jan 18, 2018
    Posts:
    49
    Ah and also more roof bling for say, roof gardens, pools, terraces, helipads I'm sure this is in your thoughts anyway.
     
    olix4242 likes this.
  19. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Yes, it would be. But I didn't come yet to any good idea on how this should be done ;(
     
  20. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    I don't have yet any ETA for this. :( First one of additional packs will be a SC-Fi.
     
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    I must say that this isn't a good practice by any means (at least, not in unity and not for this type of massive levels). Moving origin can be used with success in some space simulations, or with simple flat 2d levels. When you go into a complexity of full city, you are killing all performance by having to move thousands of objects. Even if you have enough CPU performance, this approach breaks almost all Unity optimizations. You loose batching (and this results in thousands of drawcalls instead of 20-30). You loose occlusion baking. You loose light baking and GI. You loose possibility to use path finding. You break completely physics engine. There is no any reason to limit yourself by doing this.

    -Using texture atlases instead of Texture arrays would actually require far more complicated shaders - and this would slow down things.
    -Using Texture Atlases would introduce lower quality rendering and heavy anti-aliasing issues.

    This would make CScape be something else. Something that is completely opposite to a main idea behind CScape. Right now, a most simple building can have minimum of 10 triangles. Lets say we are taking a building that has 20 floors, and 10 windows in a row by each side. If you want a simple quad window in descrete geometry, you would need atleast 18 triangles for one window section. This means that for a single floor, you need 18 (triangles) x 10 (rows of windows) x 4(sides of building) = 720 triangles. For a 20 stories building this means that you have to use budget of 14.402 triangles. And thats on average 115 000 triangles for only one single city block. If you want to use curved shaped windows, this number grows.
    Right now, on average, a 10 X 10 city uses 400,000 triangles for buildings. But, wiith a descrete geometry, it would have to be 115,000 x 100 = 11,500,000. And this all if use only a simple quadratic window. But this number can grow even more with a complexity of a windows and features on building sides.
    Depth maps have it's shader performance impact, but it isn't even close to that of a discrete geometry.
    Also, a descrete geometry has it's own problems with aliasing, and also here, you would get a pretty bad aliasing issues.
    Parallax interiors are pretty simple (they use few simple math operations) and mostly doesn't impact performance at all. I even couldn't measure a difference in performance with or without them.
     
  22. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    212
    A very scifi or a more contemporary scifi ?
    Anyway, are there any tutorials on the texture/mesh stuff or are you still working on the workflow till v1.0 ?
     
  23. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    85
    Hi,

    Unity 2018.1 (out today) fails to compile the CSBuildingShader. Complaining about missing 'tex2DArray', and divide by zero.
    So all the buildings look pure black/lime/yellow/white.

    Cheers.
     
  24. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Please download this package and import it to your project (by overwriting original files).
    This should fix a issue with latest Unity 2018.1.
     

    Attached Files:

  25. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    85
    Appears to work! Thanks!

    (trust Unity to half/mostly upgrade stuff!)
     
  26. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    212
    Great to know that it works in 2018, still very wary to update my project to it, and I don't think that my project will take advantage of the hd pipeline (for now).
     
  27. SatuMen

    SatuMen

    Joined:
    May 11, 2017
    Posts:
    1
    Hi i have a problem in Unity 2018.1.0f2... in Shader CsBuildingShader (undeclared identifier 'tex2DArray') on line 178
    can you help me please.
     
  28. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    You can find a solution two posts above.;)
     
  29. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    I usually don't suggest to update to big versions.. at least for a a few months.
    For now, CScape doesn't support HD SRP (and I don't have any ETA HD SRP still isn't in it's final version) I will be posting here a LD SRP version patch here today or tomorrow.
    You could gain some performance from LD version - but I still didn't test it's performance.
     
  30. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    I have to dismiss this statement. Unfortunately, I was about to make final modifications on SRP LW support - I've started working on this few months ago - and while it mostly worked in beta versions of 2018, a final 2018.1 version broke completely everything. For now, it looks like I have to deal with a Unity bug - I'm investigating this issue, but if we have to deal with unity bug in SRP, it can't be solved until some of next releases of Unity.
     
  31. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Good question that I don't know how to answer :) What is your preference?

    Here you can see how to make mesh templates:

    And here, how to make textures for it:
    https://olivr.info/customizing-cscape-materials-with-cdk/
     
  32. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
  33. zevist

    zevist

    Joined:
    May 26, 2016
    Posts:
    5
    Hi,
    Congratulation, it's one of the best city generator!

    Is it possible to extract some building with texture to use under unity 2018 SRP HD?
    I just need some PBR buildings (with textures) to use with new lit shader.

    If it's not possible for me via unity, do you have the possibility to send me what i ask?
    Thank you.
     
  34. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Hi. Unfortunately, Unity implementation of HD SRP is in it's initial state of developement, with no documentation, and many features that still doesn't work, it has stability issues, and over all, it is constantly changing. This practically means that it's still impossible to create (or maintain) any custom shader with it. We will have to wait some further developement of HD SRP to make it work. This is normal for it's current state of developement - this tech is only in a 'preview' state.

    No, there is no way to do this. You can't just extract standard PBR textures from it. All CScape materials are procedurally generated inside shader, and Cscape requires it's own shaders for it to work properly. Without them, even if you could flatten those complex procedural textures, it would require gigabytes of space for it to work for a similar city complexity.
     
  35. zevist

    zevist

    Joined:
    May 26, 2016
    Posts:
    5
    Ok,
    Thank you for the answer. Have a good day!
     
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,108
    HD pipeline is projected to finish with 2018.3, due at the end of the year.
     
    olix4242 likes this.
  37. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Good news: I have finished in further optimizing Cscape shaders. For some mobile systems (as Oculus GO) it can go up to having 4 times better performance.
    Also, now Cscape has an ability to compress textures resulting in even better performance, less Vram usage and half of the build size.
     
  38. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Add on previous post. I have managed to add 3X performance boost for desktop platforms.
    Now it runs in full HD at 1100 fps for a default city (in night mode) where it run at 350 fps. Pretty impressive!
     
  39. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
  40. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    85
    ETA on shipping this excellent progress?
     
  41. DanielFF

    DanielFF

    Joined:
    Aug 29, 2012
    Posts:
    38
    Hi,
    in the case of a top down game where the player could select a building, how we would set highlight for that building?

    thank you!
     
  42. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    270
    at some point will the system be able to have custom textures generated on the buildings?
     
  43. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    I will be submitting this to assetstore next week.
     
    matteumayo likes this.
  44. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    It's pretty hard to answer without knowing what style of highlight do you need. Any examples?
     
  45. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    Sorry, what do you mean by custom textures? Can you describe more what do you need?
     
  46. Sempiternal

    Sempiternal

    Joined:
    Jun 18, 2014
    Posts:
    103
    Looks really cool I can definitely see some uses out of this for a project I have in mind but the only thing I'm worried about is that this asset will get boring after a few hours due to no pedestrians, vehicles, or interactive objects. Are there any plans to include indoors, parks, and anything else that might make the scene seem more "alive".

    Thanks!
     
  47. DanielFF

    DanielFF

    Joined:
    Aug 29, 2012
    Posts:
    38
    Any effect to highlight a building would be useful, glow and/or outline for example.
     
  48. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    270
    like for the buldings can we chant the texture of buildings wall textures ?
     
  49. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,635
    You can already do it.
    Unpack a unitypackage inside CDK folder. You will get al set of textures where you can modify them.
    After modification, run a CSmaterialTools script and compile those textures.
    You can find some more info here:
    https://olivr.info/customizing-cscape-materials-with-cdk/
     
    hopeful likes this.
  50. kailashvetal47

    kailashvetal47

    Joined:
    Oct 15, 2014
    Posts:
    5
    Hi,
    I am trying to make cscape demo with following settings.
    CScape version : 0.9.5.4 beta
    Unity Version : Unity2018.1.0f2
    Platform : WebGL
    Api : WebGl 2.0

    But it gives error while compiling CSBuildingShader, CSBuildingShaderMobile and NordLakeRiver shaders.
    - undeclared identifier 'tex2DArray'
    Any idea on this?
     
unityunity