Search Unity

TC2 Node Painter - The TC2 extension for painting the world!

Discussion in 'Assets and Asset Store' started by Seneral, Feb 5, 2017.

  1. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey @silentneedle, thanks for the note:)
    It's indeed a bug, it fetches the canvas from the saved cache again on entering playmode when it should instead use the serialized version. I'll fix it and make a new version as soon as I can - I'm currently on a trip so I'm unsure as to whether I'm able to submit it...
    Seneral
     
    silentneedle likes this.
  2. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Great. :)

    I have another one, when painting with a small brush size, node painter seems to generate a line over the whole terrain:

    http://i.imgur.com/Q04mrdw.jpg
     
  3. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    If you mean the blue texture stripes and not the big one on the terrain, I fixed it, it was caused by a wrong texture import setting:)

    Regarding the first error of the canvas resetting when switching playmode, after checking on my tablet pc I can't seem to be able to reproduce it on 5.4.2 (Only version I currently have access to). Which unity version are you using?
    I'll try to reproduce after installing 5.6 next:)

    Thanks for your reports:)
     
  4. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Nope, I mean the big one on the terrain, this was generated over the whole terrain after a single click.

    I'm on 5.4.4p3.
     
  5. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Alright, got it - thanks:) Due to the small size the UV precision for the texture brushes seems to get so low that they somehow exceed the texture boundaries...
    Will send a patch as soon as I get home:)
     
    silentneedle likes this.
  6. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey guys,
    I'm back from my 10-day-tour, which means I can finally focus on TC2 Node Painter again!
    I have to apologize for the bad timing - I didn't imagine the release to be delayed so much, partially by me and partially by the submission process, that it would be released while I'm away:/

    Anyway, I've already prepared and submitted an update today, adressing all of the problems and adding some new features. The full changelog can be found on my website:
    http://www.levingaeher.com/downloads/NodePainter/Full_Changelog.txt

    The video, which I planned to have online by release, will be delayed another few days. Please bear with me trying to find music for the video through my throttled mobile connection:)

    Thanks everyone for you patience,
    Seneral
     
    silentneedle likes this.
  7. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hello everyone,

    Version 1.1.1 has been released on the asset store, fixing all problems that came up so far and adding a few features:)
    Asset Store - Changelog

    One important note on upgrading:
    I renamed the folder 'Resources' to 'EditorResources' so the contents don't automatically get included in your build. This requires you to change/reset the settings to account for the path change - I could only update the defaults but for those already using the tool the old paths are still set in the user preferences, so you manually need to update these.

    I also introduced a proper documentation versioning system on my webpage, so you can always access the most up-to-date documentation here:)

    Best regards,
    Seneral
     
    Last edited: Apr 27, 2017
    silentneedle likes this.
  8. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    Heads up the Changelog is a bad link here's the correct one. Nice updates!
     
  9. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Thanks doq - fixed it:)
     
  10. Aggror89

    Aggror89

    Joined:
    Sep 16, 2014
    Posts:
    5
    Hi Seneral, Just saw your product video on youtube and I was sold right away.

    I am running in to an import issue though. Already restarted Unity just in case. I have imported the pckage in to Unity 5.5.0f3 and I am getting a compiler errors.
    The method expects a possible bool, but the Finalize method returns a Rect.
    Code (CSharp):
    1. TC.AutoGenerate (FinalizeGenerateRect ())
     
  11. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi Aggror,
    well the video only showcases an early beta version... That's why I don't feature it more prominently, instead I'm currently working on proper videos that represent the current state better:) Glad you liked them!

    Please make sure you have at least TC2.32 installed, think the latest on the AS is 2.4 :)
    With TC2.32 the partial generation feature was introduced which makes TC2 only generate the area that is actually needed under the brush. This makes painting alot faster - don't think it was ready yet at the time of the last video;)
     
    Aggror89 likes this.
  12. Aggror89

    Aggror89

    Joined:
    Sep 16, 2014
    Posts:
    5
    Thanks for the reply. I will be patiently awaiting. If you need help with those videos let me know.
     
    Seneral likes this.
  13. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey,
    Just submitted another update, V1.1.2, which contains all the fixes from the past two weeks:)
    If anyone needs it fast, you can contact me and I can send it to you before it's accepted to the AS.

    EDIT: Update 1.1.2 has been released!

    Changelog Version 1.1.2:

    Not having as much time as I would have hoped to, so trailer is still not done. It's not too long anymore though:)
    Part of the reason it takes so long is because I merged two camera path utilities to fit my needs - a free one with absolutely brilliant UI but lacking features, and a paid one with great features but clunky UI. That is out of the way now, so it's really just a matter of tweaking and editing now:)
    Seneral
     
    Last edited: May 16, 2017
  14. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    Looks great, just been playing around with it!

    Would it be possible to paint during run time? and if so how would I go about accessing the Node painter features?
     
  15. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey Darren!
    Interesting question. It is indeed possible but within limits.
    For TC2 to work the target system needs to support compute shaders (for now only DX11+), so it would only work on Windows and XBox afaik.
    The core of Node Painter itself does work at runtime, the editor part would have to be converted but mainly should work, too.

    First step would be to rename EditorResources folder to Resources as it was in previous versions.
    Then copy the GUI code of PaintingEditor and it's wrapper NodePainterEditor into NodePainters OnGUI function and try to convert it - or rewrite your own. Can help you with that part if you want, no problem:) I got a RTEditorControls utility on my github gist to replace most editor-only controls which you could use.

    Hope that gives you an idea:)
    Seneral
     
  16. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    Hey Seneral,
    Thanks for the reply. Unfortunately that sounds beyond my coding capabilities. I really just need access to the basic brush functionality, I tend to stick with Playmaker for UI and other stuff. I'm an artist that has done some basic coding in the distant past but nothing recently.
    However if there's not any other options I might give it a go.

    Edit: I can do my own interface/GUI with Playmaker quite easily. If I can just access/change the brush control variables on the nodes. Turn painting on and off, switch brushes, sizes and intensity. Is that possible? or is that what you're describing? (yep I am a code idiot)
     
    Last edited: May 19, 2017
  17. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey,
    Don't know of the capabilities of Playmaker and how it presents all the methods and members so it might get a bit tricky.
    Basically, NodePainter references the Painting class which handles everything related to painting. So if you just need painting decoupled from TC2, then Painting.cs and PaintingEditor.cs is all you need:)
    Probably worth looking into the code of PaintingEditor for implementation help of the GUI in playmaker;)
    Seneral
     
  18. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    I'll have a look into that then. Its good to at least have a starting point to go from. Cheers!
     
  19. Andreadbx

    Andreadbx

    Joined:
    Jun 29, 2015
    Posts:
    5
    Hello! we just bought this extension for tc2 and can't get it to work, there are some errors:
    DrawGUITexture: texture is null
    UnityEngine.Graphics:DrawTexture(Rect, Texture, Material)
    TerrainComposer2.NodePainter.PaintingEditor:DoPainterGUI(String&) (at Assets/Node Painter/Scripts/Editor/PaintingEditor.cs:354)
    TerrainComposer2.NodePainter.NodePainterEditor:OnInspectorGUI() (at Assets/Node Painter/Scripts/Editor/NodePainterEditor.cs:148)
    UnityEditor.DockArea:OnGUI()

    and two IndexOutOfRangeException: Array index is out of range.
     
  20. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey,
    Seems like the resource path is off, which can happen if you used version 1.0 on your system previously and then upgraded to 1.1.x.
    To fix that, please reset the settings in the settings window or change it manually to point to the folder called 'EditorResources':)
    Already the second time I received this error in the last two days so maybe there's more to it. I'll check once I get home in an hour:)
    Seneral
     
  21. Andreadbx

    Andreadbx

    Joined:
    Jun 29, 2015
    Posts:
    5
    It works fine now! thank you!
    for your information, we didn't use version 1.0 at all, as i said we just got this addon today ;)
     
  22. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hm, that's weird and a serious problem.
    Normally the default path that is set in the settings points to 'EditorResources', so it should work nornally.
    But in previous versions that folder was called 'Resources' and ontop of that this path was stored in the EditorPrefs. This has since been changed, but the default value is still read out of the EditorPrefs if existant and thus, when upgrading from 1.0, the paths mismatched.
    But when you just got it then that's a different problem...
    Thanks for reporting!
    Seneral
     
  23. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Alright, submitted a fix, 1.1.3, that adresses this wrong default resource path.
    I was not aware that this happened for every new user, so sorry for any inconveniences!
    Seneral
     
  24. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    as a long time TC1 and TC2 user, I suggest if you own TC2, I suggest to buy this as well.! Major benefits, it has helped with blending, biomes and much more
     
  25. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey, thanks @recon0303, good to hear it serves you well:)
    Will share a trailer soon that shows a variety of use cases!
     
    recon0303 likes this.
  26. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hello everyone,
    I just published an update adressing some rare cache instability that could cause data loss.
    It also adds a new IO format, a custom (native) byte format that is way less hassle-free compared to the others because for multi-format canvases all textures are now embedded in one file, all canvas metadata is saved with it and it is lossless 16-Bit raw - it basically combines the benefit of both RAW and PNG export and much more, but of course it cannot be opened in external image editors.
    Due to it being a .bytes, it is considered a TextAsset by Unity, which allows to reference the asset properly. Taking advantage of that you can now reference the same cache file from multiple painters to synchronize them between scenes (please do not try to set the same cache file on two painters in the same scene, won't work)...

    Here's the full changelog:

    Also, I've started looking into integrating with VegetationStudio (Both with node painter and TC2) so that you can 1. paint and mask vegetation as with the default Unity terrain tools and 2. use TC2 or even the Painter alone to blend the vegetation based on biomes.

    Finally, an update on the trailer. My focus has been a bit off for a while because of the high ambitions (realtime editing while having cinematic visuals and performance). Both could not be achieved together previously, but with Vegetation Studio I do have hope to be able to finish it. Also might switch to MegaSplats for faster rendering, although I did already set up RTP...
    All that will take a while. So I'll first do some basic setup videos - I know I'm already long behind on doing this, and I'm sorry for that. Will publish them in the next two-three weeks:)
    Seneral
     
    LennartJohansen and silentneedle like this.
  27. RobinNvizzio

    RobinNvizzio

    Joined:
    Sep 29, 2016
    Posts:
    9
    Hi,

    I have a urgent fix, It's blocking my artists..

    when you paint, save the scene and unload the scene, the painting is saved automaticly right ?

    Because sometime when I reload the scene, I loose everything.
    The node painter is reset, and need to start again.

    I'm using Unity 5.6.2p2.

    Note: I also saw in your code that you save the active scene, don't assume it's necessarily the active scene that contains the NodePainter: you should do:
    Line 144 NodePainter:
    Code (CSharp):
    1. UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty (gameObject.scene);
    Thanks
     
    Last edited: Jul 13, 2017
  28. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi Robin,
    Yes, it is automatically saved whenever the scene is saved...
    Seeing you use the latest version, it strikes me you experience data loss... I'm very sorry about that. But in the latest version, no way of the cache to get completely lost, at worst you loose reference to the cache file or your work since the last scene save (although both should not happen).
    So try to re-assign the correct cache file for each canvas from 'Node Painter/Cache' to the cache field above the create box or when clicking the 'E' button when a canvas is loaded.

    Thanks for pointing out that error. Can't quite think of how this could create your problems though. The referenced line is only relevant for when the cache reference is lost in the first place (or when upgrading to the newest 1.1.4 version).

    I'll take a closer look at it tomorrow and send you a fix:)
    Seneral
     
  29. OpenWalnut

    OpenWalnut

    Joined:
    Nov 11, 2014
    Posts:
    2
    Hi,
    I've spotted a weird behavior of a standard Gaussian brush. Basically it works as I expected in Add mode on value canvas (height map). But with holding shift mode (lowering) it's produced annoying noise on painting areas. Is it a bug or I'm doing something wrong, any ideas guys ??
     

    Attached Files:

    Last edited: Jul 14, 2017
  30. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi, thanks for the heads up.
    This is a precision issue... Internally the canvas is a 16-Bit texture, which is usually enough, but when the terrain is very high (value approaches 1), some precision is always lost. You can reduce that general effect by increasing the canvas to a 32-Bit format. This has one big downside though, double as large cache files and memory usage. So I do not recommend this, even more as it will not fix the core issue:
    Because the painter paints at a high interval in small steps, the added brush value to a certain pixel at one time step can get extremely small. This is were even floating points loose precision and it will sometimes produce circular stripes around the brush. This fault can be fixed by using the smooth brush afterwards if you need absolutely perfect terrain.
    The same happens with all other brushes, be it texture or the function brush, and all other blend modes aswell.
    I agree it is annoying, and see if there is indeed some way around it, but I can't give any promises...
    Seneral
     
  31. RobinNvizzio

    RobinNvizzio

    Joined:
    Sep 29, 2016
    Posts:
    9
    I can see a cache file created, and sometime deleted...
    That's why I loose my work.
    I don't know when will be the case where this cache is actually deleted from the project.

    It's either during opening or closing a scene in editor I think
     
  32. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hm, but you do use the latest version 1.1.4p1, just to be sure?
    I've definitely removed every case of deleting the cache file there. Previously it was deleted if the painter was deleted and the scene saved (although that obviously can easily create problems, hence I removed it).
    It is only created, loaded, that it's it...
     
  33. RobinNvizzio

    RobinNvizzio

    Joined:
    Sep 29, 2016
    Posts:
    9
    Yep last version on asset store
     
  34. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Alright, found the error (I hope).
    Will update and try to submit today still:)
    Seneral
     
  35. RobinNvizzio

    RobinNvizzio

    Joined:
    Sep 29, 2016
    Posts:
    9
    Thx, what was it ? for curiosity
     
  36. RobinNvizzio

    RobinNvizzio

    Joined:
    Sep 29, 2016
    Posts:
    9
    If you're able to send me the fix via PM it would be nice, production is lock right now because of that... :s
     
  37. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Complicated to describe. When saving along the scene (in OnBeforeSerialize), I could not call AssetDatabase.Refresh, which is why the cache asset could not be properly referenced. So upon creating a new painter, it was not possible to actually reference the cache asset unless the cache was saved outside of OnBeforeSerialize (when clicking the save cache button, f.E.). Very vague how that could break the cache system, but I hope it works for you.
    It would explain atleast why I did not experience that cache loss (I've been working with the painter the past days alot).
    Sure, will PM it to you when it's ready:)
    Also, so you can work on it, try to export the canvas in the native format from time to time manually, so you have a backup. And double check the cache files are really deleted, still can't explain that:(
     
  38. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Ok so the cache problem was actually way more deeply rooted and hard to fix.
    I'm confident I identified the problem now once and for all, but it might be more complicated than this.
    For 5.5+ there is a definite fix now due to added callbacks for Scene saving, but pre 5.5 there might be some limitations (but it will be stable, too).
    The core problem is that I use OnBeforeSerialize to save the cache file. Not on each painter game object (because it is called every frame when it is selected, not only when it is saved alongside the scene), but on one central hidden object in the scene. This creates the main problem which caused the save reference to be lost sometimes. There are two cases: The central object is serialized before the painter, in which case the updated cache information is saved with the painter, or afterwards, in which case the painter was already serialized with the outdated cache information. So sometimes, when the cache information changed, it was not updated with the scene properly.
    Seneral

    EDIT: Nevermind, found a good and solid way to solve that on every version. Will send out the patch in a moment @RobinNvizzio
     
    Last edited: Jul 17, 2017
  39. RobinNvizzio

    RobinNvizzio

    Joined:
    Sep 29, 2016
    Posts:
    9
    Awesome thank you
     
  40. OpenWalnut

    OpenWalnut

    Joined:
    Nov 11, 2014
    Posts:
    2
    Hi, thanks for clarifying about brushes, but now after updating to 1.1.4p2 I have got other problem. I'm working on 5.5.4f1 and every time I'm entering to a node with painter was attached on, it starts something like "infinite loop of updateting" causing cursor is flickering all time. 1.1.4p1 was stable for me, is it any chance to get it from somewhere ??

    EDIT: Found an older version (not sure what a number) in trash bin and after patch on 1.1.4p2 it temporary fix my issue :) but definitely is something wrong with the newest.
     
    Last edited: Jul 20, 2017
  41. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi,
    sorry for the problems. I send you a PM, hope we can resolve that:)
    Seneral
     
  42. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Hi Seneral,

    Is there a possibility to upload a small video demo of the tool ? I own TC2 but haven't had much success with the tool because I need more control over spawning and painting and I think your tool will exactly help me get there. But I need to understand how easy it is to work with, so if you don't mind and you have the time, would really appreciate a video :)

    Regards,
    evilangel89
     
  43. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi evilangle89,
    sure, can do that. Currently working on some tutorials, will have them ready hopefully in the next few days.
    There is one demonstration video from the beta that shows how it works but it's old and quickly made so I do not promote it:)
    Seneral
     
    evilangel89 likes this.
  44. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Thanks the video does look good. But I'll wait for your tutorials. Because I have a feeling there's more to it than the old video gives away. it already looks very good to me though.
     
  45. br20o0ly

    br20o0ly

    Joined:
    Aug 9, 2015
    Posts:
    18
    i'm already edited my terrain manually can i use this tool for save my changes or i have to start again?
     
  46. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Generally, yes, but currently there is a small manual process involved...
    First, you need to export the modified terrain heightmap from the terrain inspector manually, and make sure you have a backup. Then, you can let TC2 generate and overwrite the terrain, reverting your changes (if the setup is the same since when you disabled TC2) - export the resulting base terrain, too.
    You can then create a difference from these two raw images in an external image editor that can read raw files such as Photoshop, and load that into a simple height overlay painter.
    If for some reason in any step of the process you want to revert you can always disable TC2 again and re-import the exported raw images into the terrain again.
    For multiple terrain tiles this can be a real hassle, so I'll likely do some kind of small utility for that in the future:)
    Seneral
     
  47. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Hi @Seneral I have purchased this asset and loved it. It's amazing to see objects, grass, trees and splats automatically take shape as we paint the terrain. I do have a couple of requests:
    1. Can you emulate unity's painting function to plateau at a predefined height. This will be useful to create paths and placeholders for buildings
    2. Have undo function using ctrl-z
     
  48. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hey, thanks:)
    I already have a functionality for that, for brushes such as replace and lerp. Basically, when in either of these blend modes, you can sample the canvas height under your brush and set it as the target value by pressing control and clicking the left mouse button - But it only really works for your purpose when it is the ONLY height node at that area, because it only picks up the canvas data itself and not the terrain. If you think about it, it would be completely impossible, due to blend modes and such:( Hope that makes sense!

    Regarding the undo functionality, I built a completely separate undo system under the hood and manage the stack myself for each painter, because the default undo system is technically incapable of recording textures so I basically had no other choice. I could work around that and use my UndoPro system (my open source command based undo integration) to kind of hack into the default system and get my custom one to integrate with it, though:) It will internally still be a completely independant stack and you still have the benefit of the separate buttons, but also be able to quickly press Ctrl-Z while painting...

    Hope that answers your questions:) Have been really busy the past weeks in RL, so tutorials didn't advance really, but I'm nearly finished with three of them...
    Seneral
     
  49. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Thanks for the response Seneral.
    1. Can I key in a value for a height I want to saturate/plateau to?
    2. Alright so there's an undo system already. I think I rushed it and didn't realize, I'll try again thanks.
    I find your asset so important and magical as well. I remember as I watch this asset called LAM which automatically place grass and rocks as you paint. With TC2 and your asset, I am able to do so, but with any shader and assets that I want.

    It's quite magical to see everything pop out automatically as I paint using the brush. I was quite stoked about that.
     
  50. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Sorry for the late reply. Yep, it's the extra value 'target' when in either Lerp or Replace brush mode:) But as I said, it lerps the canvas to that value, not the terrain itself. So in practice, depending on the blend mode of your node or the other nodes that compose the final terrain, you might not be able to paint plateas as easily as you imagined, sorry:( If however your height channel is completely represented by that painter (no other procedural nodes), then yes it will work:) I recommend to just test it out, as I said Ctrl-Left Click to sample the value under the mouse.
    Sure, some already wondered and somehow missed the undo system. Seems it's not very obvious, any idea how to improve it? As I said I might be able to figure out a way to integrate it, but in the end that is only a hack and it is not designed to work like this (not exactly my fault either lol).
    Also, thanks for your kind words! Yes, it is indeed fun to play around with, although I do have to say it's mainly due to TC2 itself that we get what we actually do. But I agree, painting it and getting direct response of other terrain elements is really fun:)
    Seneral
     
    coverpage likes this.