Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

Discussion in 'Assets and Asset Store' started by tomaszek, Oct 22, 2013.

  1. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    866
    For my path-finding system I need to find what splat texture is most visible at each path-finding node. You can get this info from TerrainData by comparing alpha channels. Is this possible with RTP? Could you for example find out if a node is snow covered?





    Thanks
     
  2. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I even thought about some postFX that could compute world position of pixel and then make some cloud shadow projection, but light cookies might be just easier (and work for indie). Good point.

    Tom
     
  3. Quen

    Quen

    Joined:
    Apr 6, 2010
    Posts:
    21
    Hi everyone,
    I got some really strange stuff going on with RTP3:
    - the terrain shading applies only within a certain range around the camera (in the editor, as well as ingame). in the far distance, the terrain is gery.
    - all the layers are extremely glossy!

    I am using 1 pass (8layers) with dx11, only superdetail and global tree map are enabled.
    Any ideas?

    Greetings,
    Quen

    $spec-and-range.jpg
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Possible but twisted a bit - you should then recompose shader code into its script equivalent to check exactly what you need. Comparing controlmaps (named alpha in your post) is fine as far as heightblend doesn't mess up too much with results. Snow coverage - you could try to use special #define in shader code so its taken from water mask. Then you can get local snow coverage inspecting this mask (its a texture color channel). To be precise on this - analyse of shader code where snow_val variable is calculated will be required. It's not that big part of code, but depends on a few factors (slope, perlin normal, etc.)

    Tom
     
  5. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    .
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    In addition to taking a look into troubleshooting section of documentation where gloss issue is described you could also check if you weren't played with "far gloss correction" param per layer. When set to higher value - makes terrain glossy at far distance even if you use dull detail textures (with black alpha channel defining layer detail texture glossiness).

    Tom
     
  7. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    Doh, yes better idea, indeed! :)
    The only thing is that the directional light cookies disable the shadows in forward mode but in the Docs is written that it is still possible with custom shaders, would be interesting if that would be adressing the light or the receiving surfaces...

    By the way, have you seen botumys's question regarding the grass shading on the normalmapped terrain? I would like to know if AFS would help here, or if you could share your thoughts about this.

    Here is what i mean:
    @Tom, i just saw that you are still ranking up on the editor extensions on the asset store, if that trend continues you'd probably be the first in a long time that made it to the frontpage without any featuring or sale. I hope you can make it, would be very well deserved :)
     
  8. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Another test about directional lightmap vs normal maps (global+perlin) :

    $lmTest.gif

    After light backing:

    -Perlin normal map stay active, but is less present.
    -Global normal map react but not as expected (big dark areas, no more details..)
     
  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    As we don't have full control over what Beast is doing here together with lighting part of Unity surface shaders, I believe that handling it in RTP shader will be best. Emissive global map to get indirect lighting info + something like complementary lights to hold bumped details at unlit areas (it's still open question how I'll implement this). Baked shadows can be stored in alphamap of this texture so we can hold close distance for RT shadows. I guess you guys will come up with some decent workflow solution for other users (about how to get maps required).

    In your screenshots I'd suggest to damp negative ligting. We see too strong completely black parts. It's, of course, to your taste, but I'd turn them down a little bit. Anyway - they will probably work a bit different in RTP3.1 so you'll adjust them later.

    Tom
     
  10. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
  11. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    If I have a terrain with only 4 textures each with normal and height maps how do I get to be able to tile each texture in there own settings. I only see global settings that control all textures to tile at once. This is great but a rock texture compared to a grass texture tile different so how do I tile each texture individually?
     
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Simply you can not...

    If your rocks texture should use larger tiling (because patterns are visible at distance) you have to remove tiling using available techniques. In RTP3.1 you'll have anoth er technique - replacement at far distance, so - at close distance there is no way to make independent tiling, but at far distance you can achieve this.

    Tom
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    View attachment 75863

    Can't make it NOT working like in your case, but I changed a bit texture routing code in RTP3.1, maybe that's the reason. Anyway - this moment it just works for me (4POM+4PM triplanar) and I'll give you RTP3.1 beta for testing when the release is ready.

    layers 1-4 (no heightblend):


    layers 5-8 (heightblend):


    view from the top:


    As we can see layers 5-8 are in triplanar mode:


    Changing heightmap combined and controlmap used in geom blend shader we can also achieve heightblend with layers 1-4 (and classical alpha blend with layers 5-8 ).

    Tom
     
    Last edited: Nov 26, 2013
  14. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Thanks Tom!
    I'll test again with 3.1 when it's done.
     
  15. Rcalt

    Rcalt

    Joined:
    Aug 5, 2013
    Posts:
    3
    Tom, stop posting screen shots, you are making our designers world builders drool and IT is having to clean it up. Seriously though looking good, can't wait for 3.1! Amazing work as always.
     
  16. Quen

    Quen

    Joined:
    Apr 6, 2010
    Posts:
    21
    Thanks for your answer! Of course your documentation did help me with the gloss issue, I really feel dumb about this :|
    But concerning the terrain being grey in the far distance, I did not find a solution yet. Like written in your document, I looked for the "No detail color at far distance" option (which is unchecked), and there is a global color map defined. Am I missing something again?

    Greetings,
    Quen
     
  17. unity3dcoder

    unity3dcoder

    Joined:
    Apr 15, 2013
    Posts:
    8
    This is my concern too...I have cobblestones and rocky cliff textures which typically require vastly different tile sizes. Are you confident that RTP has the tools to handle tiling of the cliff at a tile size of 1 or 2 ? I've read your pdf and looked at the promo photos, but I have not bought RTP so please keep this in mind when responding :)

    Thanks.
     
  18. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Hey tomaszek ...are you still going to try to make RTP3 so it doesn't conflict with other assets? ...you said you would earlier in this thread..

    Im still getting this error
    Yet when I search my project I get no other "ColorChannels" ...so there is no way for me to rename anything to get RTP3 to work...the error doesn't make sense to me if there are no other "ColorChannels" in my project when I search..

    I have a lot of assets installed ..and little programming skill...
     
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Rather I'm somebody missing ideas what could be wrong on your side... Are you sure you recompiled scripts ? But in case you've got global colormap it should appear. You could try to backup your scene (if it's important) saving as different scene and trying to return to default settings. Maybe you went too far with all these knobs and sliders :). If still nothing - give me an info on PM with skype ID so we could try to resolve this via screenshare session.

    Tom
     
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I renamed this in RTP3.1. So - this should be resolved when you update to new version (still working on this release).

    Tom
     
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Cobblestones are typicaly used as small tiles so they don't look "too big". However, if your rocks cliff texture looks bad with same small tiling you could try to rebuild your cobblestone texture to be for example 2x2. That's waste of resolution though, but works. I assure you that RTP3 has 4 methods of hiding tiling. RTP3.1 have additional technique which will allow you to setup different tiling at far distance (at close distance everything nee to have the same tiling). I'll also look into this wonk tiling method mentioned a few posts above from scrawk blog. If it's applicable I'll try to implement this so we might have yet another tile reduction feature (but that's not sure this moment).

    In case of cobblestones - I guess you'd like to introduce kind of pavement. So - it's best to use geom blend for this (you'll draw additional geometry that will be sticked to terrain - your "medieval path" which also can be heightblended with underlying terrain - nobody can tell if this is terrain or separate object - they will be melted one with each other perfectly). Look at example scene in the first post - this part with water near starting place is geom blend sticked to terrain, but looks like additional terrain layer.

    So - you've got quite a many options here. Also - look at previous page - I put there geom blend example (pavement sphere blended with terrain - although not strictly sticked this object is also well integrated with all terrain layers). Or - ask other users for advice, because my opinion might be considered "biased" (as every assetstore developer would say his product is the best :D ).

    ATB, Tom
     
    Last edited: Nov 26, 2013
  22. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    he proper way would really be to use a separate namespace, i think this should be enforced by the asset store, its really useful.

    Regarding the tiling issue, just tile and rescale your textures so the match in scale, should be easy enough?
     
  23. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    So I tried to get some nice splats from WM, and after some stupid errors fixed and facepalming done (I had to turn the splats upside down :) ), I got it to work. I'm not 100% happy with it but its a good start.

    Mixing slope and Convexity with some noise did the trick for my rubble texture splat map... its not perfect yet, but its good enough.

    But now I face a bigger problem a can't seem to be able to fix. Most probably my own fault, but for some reason the perlin normals do not show up anymore. They are visible as soon as I activate the global normal map in the LOD Manager. But as soon as I turn this off (as I have no global normals and I don't plan to use it), the perlin normals are not visible anymore again. The perlin map is there in the inspector, I did not turn down the perlin value of the layers to 0, its just that the perlin normals are not visible in the 3D Viewport or the game view.

    What might cause this?
     
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Gian-reto alig,

    It's better to flip heightmap and leave alone splats - that's simplier (the WM issue of flipped heightmap is described in docs, but who reads :) ).

    You 2nd problem. If I get you right - turning on (+recompile scripts) global normalmap and then turning it off (+recompile) makes perlin normal broken (invisible) ? Will try to check this.

    Tom
     
  25. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi Tom

    Im not 100% sure when I this started happening, because some weeks ago the perlin normal function was still working correct. Somewhen I recompiled the shader with the global normal map, and after I found out that this basically switches of normal lighting, I recompiled it again without the global normal map. Somewhen around that time the perlin normal stopped being visible without global normal being turned on, but I am not 100% Sure that this is linked.

    Would be great to get a solution for this, and tell me if you need more information.


    Cheers

    Gian-Reto
     
  26. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    Hey Gian-Reto,

    have you checked if the perlin normal map is still assigned in RTP... should be on the perlin normal tab, if the slot is emtpy there this would be the issue... it should automatically connect itself though. Or, maybe something is wrong with the view distances, you should check that too...

    When nothing helps you should use the reset to defaults button on the main tab(probably good idea to save the scene under a new name before doing that). When i was learning RTP(and i am still learning because there are countless possible configurations and combinations of features) i used the reset many times ;)

    Also it might be that there is something about your scene that makes problems... check for example if there are many lights affecting the terrain and you are in forward, if you have "no forward add" enabled it could be that there is a light somewhere that gets rendered but your directional light only uses spherical harmonics... try to enable only 1 directional light to make sure this is not the problem.

    Oh, and is normal mapping working on other Gameobjects?
     
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Another idea - check in combined textures tab - special subtab - there is actual texture used by shader (it's made from your perlin normal texture when you go to perlin settings tab).

    Tom
     
  28. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    I checked the tab, and the normal maps shown in there are actually empty.... even though the perlin normal map is there under its own tab. They stay empty when I activate global normal.

    when I moved the perlin normal texture (most probably a bad idea from the start) in both slots, it completly broke the terrain bump maps. And I could not restore it.


    So in the end I decided to drop the Relief_Terrain Script from the Terrain and add it again. Of course I had to tweak all the settings again, but the perlin normal now works again.


    Any Idea what could have broken the script so I can somehow avoid that in the future?

    thanks for the Help all

    Gian-Reto
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I hope we're talking about the same texture - in combined textures/special. It should be automaticaly made when you first go to settings/perlin normal and perlin texture is placed there. You can try to reassign it there - assign another texture and back perlin normal texture (making it empty should result in reassigning default perlin normal texture).

    Hard to say what happened. Anyway I'll check this setting with global normalmap.

    In RTP3.1 you can save preset as asset file. This could be useful in such case when you reset your terrain component. Then preset can be loaded so you can restore your settings and this should work (unless preset data has something to do with broken functionality).

    Tom
     
  30. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Tom, can you add a "refresh" button next to textures slot in layers ? (or a global refresh)
    When I tweak terrain textures and go back in unity, I have currently 2 options to refresh: swap the texture in the slot and swap again to force
    RTP to use modified map, or press play and stop.
    Thx!
     
  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Nice idea. I'll add some small button next to every layer texture slot. This will do the same as you would reassign them. Will speed up a bit your workflow in case you're using external software for image editing.

    Tom
     
    Last edited: Nov 28, 2013
  32. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Thanks !
     
  33. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Great idea, will speed things up for sure : )
     
  34. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    I don't know why, but these were missing before I fixed it with re-assigning the whole component and resetting all the values. Now all works fine, but I can't think of anything that I could have done to make these texture slots get empty.

    The only thing that might be is that this happened during activation of the global normal function and the subsequent deactivation of it as I realized that I cannot use it that easely (as I do get my terrain from WM, but I edit it in the Unity Editor, so either I build everything with Pixel error set to the minimum, export a heightmap, and then set the pixel error higher, or I just leave it be for now).

    It must be somewhere during that time that I first noticed the perlin normal map not being visible anymore.

    I could check if I can reproduce the problem. I will let you know if that works.


    Cheers

    gian-Reto
     
  35. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,782
    I am not sure if same issue... the last normal retexture wont set properly... so then i deleted a texture out of the terrain script, and it nulled out the normal texture of the new last texture...

    $2013-11-30_0923_normals.png
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Adam, upgrade to RTP3 (free) before you proceed. I discontinued resolving any issues in RTP2.1b.

    ATB, Tom
     
  37. sixto1972

    sixto1972

    Joined:
    May 16, 2013
    Posts:
    30
    here is a quick test i did with RTP and mostly free assets except some trees from forst. I know its not breath taking but for just a little fiddling its looking good i think.

    $terrain_screenshot.jpg
     
  38. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    I think it looks quite nice :) of course RTP can do very realistic looks but also stylized stuff is possible. What i don't like is the skybox though, its way to overbright. I would be interested to see more of your work as you progress. I look forward to see you in the RTP showcase thread ;)
     
  39. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Right getting the hang of this now, ive been using wm for a while but thanks hugely to Becoming for the lil example a few pages back, the idea of colour visualisation hadnt occured to me and it helps a lot!
     
  40. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Also I read the documentation fervently last night, it was very helpful, but if you could clear a few things up - in the alpha channel of the diffuse textures you put a greyscale for their 'glossiness' right? Is this what a lot of people might refer to as a specular map because the textures I use supply both specular and gloss maps and the gloss map looks a little diff, its very bright and ive used it for discerning roughness in a material before. The specular maps are very dark, so im assuming thats what you want in there
     
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi, alpha channel in diffuse textures is named gloss map following Unity's shader param convention. Gloss - mean - power/brightness of specular "reflections" over surface. Shininess - (named specularity in RTP per layer settings) means - how wide the "reflection" will be. Higher specularity means narrow shiny light spot giving a surface looks "harder". Note that specularity isn't adjustable in deferred (because in prepass shader bakes world normal and glossiness in offscreen buffer), only glossiness.

    Tom
     
  42. lmtm

    lmtm

    Joined:
    Sep 9, 2013
    Posts:
    32
    Hi Tom,

    I made nice terrain with TC + RTP3. Then I made asset bundle, which I would like to Load to another program.
    Everything is working - I can load and see terrain all textures ...
    But shaders are not started.

    Because to start them, I added little script to Your ReliefTerrain.cs

    Like this :

    void LateUpdate()
    {
    if (global._refresh_RT)
    { Awake ();
    global._refresh_RT=false;
    }
    }

    So I call Your Awake function after loading asset bundle to my program.

    However shaders are not starting.

    Can You tell me which functions I need to call to start Your shaders ?

    Thanks,

    Milos.
     
    Last edited: Dec 2, 2013
  43. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Cheers! I got so involved in rtp that i didnt sleep overnight, and didt even get near making a global colormap/normalmap. Do want to do it justice though so i'll post a pic when it's looking the business
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    After you load your terrain object with it's setup and script, make sure all textures are there (I'm not sure if texture references that are used by RTP shader, even when saved to disk, are restored when loading from bundle).

    Anyway - to setup params (i.e. feeding shaders with RTP params) you call RefreshAll() function on globalSettingsHolder object reference. Check in pdf docs how to take this object via script (you get any terrain and its ReliefTerrain script component and globalSettingsHolder is a variable of this - you can then call RefreshAll()).

    Tom
     
  45. lmtm

    lmtm

    Joined:
    Sep 9, 2013
    Posts:
    32
    Thank You for Your answer.
    I have no problem with textures. it is working fine.
    Only with shaders.

    Can You be so kind to show call RefreshAll() function on little example ?

    FYI : Your Water1LayerPM is working fine from bundle.
     
    Last edited: Dec 2, 2013
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Let's say you have go variable which stores game ovject of your terrain loaded from asset bundle. This game object should have terrain component and ReliefTerrain script component (RTP engine) attached. So:

    Code (csharp):
    1.  
    2. // let's get ReliefTerrain script component instance (rt)
    3. ReliefTerrain rt=go.GetComponent(typeof(ReliefTerrain)) as ReliefTerrain;
    4. // each ReliefTerrain component has reference to an object that stores global shader settings
    5. // Let's call this global object's RefreshAll function which will setup params for shader.
    6. rt.globalSettingsHolder.RefreshAll();
    7.  
    It's like this.

    ATB, Tom
     
  47. lmtm

    lmtm

    Joined:
    Sep 9, 2013
    Posts:
    32
    Hi Tom,

    thank You very much. I added it to my program. I traced RefreshAll function in debbuger to be sure that RefreshAll function passed.
    It was, but shaders are not working.
    Do You have some idea?
    Thank You, Milos.
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I would need more informations about not working shaders.

    If you loaded assetbundle terrain with all scripts there and no texture is missing yould be able to see the results. I know other users resolved using RTP dynamically. You can eventually check if you've got material with RTP shader is attached to terrain (materialTemplate variable for Unity terrain), so try this with materials (set it in RTP LOD manager). Make sure shaders are available at the moment you load and setup your terrain.

    Tom
     
  49. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'll probs post these in a few places because I'm doing them to promote good assets i've been enjoying using, and I think i'll make a little videogame out of it all too eventually

    But in this thread's case, ive had a go with rtp3 properly finally, its absolutely excellent (reflex lighting is a fps godsend) and so many features the mind boggles. I still have a lot to to do to turn it into an actual gaming environment but i have a few coastline shots of a Dear Esther style hebridean island for you to enjoy. The island and water shader (a frankensteinian mix of scrawks whitecap shader and suimono) were thrown together in 2 nights.




    I hope this serves as publicity for ease of use

    One very annoying thing happened though which was all my splats and masks got lost from the composition area and it took a while to remember where they all went again. That was pretty annoying! And it does some strange things needing a play/stop or reassigning textures but these are really tiny niggles and im really, really, looking forwards to continuing to work with your shader. Going to do some streams and stuff soon, that's going to be brill, and may decide to add a sprinkling of snow
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Screenshots are simply amazing. I lurked at my thread in the middle of my RTp3.1 job, and THIS IS BRILLIANT.
    This is also proof of concept that complementary lights do their job quite nice. With a little bit more of perlin normalmaps rocks could look more organic, but maybe you made it looking like this intentionally.

    To post it in "a few places" I suggest to put it also here:

    http://forum.unity3d.com/threads/209328-Relief-Terrain-Pack-showcase-for-developers/page2

    where artists are meant to share their workflow.

    I'm sorry about missing texture references in composition area... :oops: I'm not quite sure about what's is caused by, but storing masks as files in your project should be the solution.

    BTW - talking about lighting. I'm back working reconstructing world normal issue (and world view dir) in fragment program of shader. Wasn't that bad, because for terrains we actually don't have tangents but derive them from normal. Thus my solution works for terrains. For meshes could also work if they are top planar mapped like terrain.

    So - it works, but costs some calculations - a few crosses, normalization + additional arithmetic ops. Now I'd assume some user will be probably more than satisfied (if this is only possible :)... ) because I can introduce IBL. This is hype, because terrain is too large object to follow well cubemap with IBL data, but I'll introduce this just for ... marketing reasons. Anyway - more physics based view dependent fresnel specularity will be also introduced in 3.1 release (with IBL specular cubeMap used or not).

    Better solution for lighting what I already made is ambient emissive texture which is global map of baked (IBL) where precise static (indirect) lighting can be stored. Such map alone doesn't take normals into account and w/o complementary lighting we loose normalmapping details in unlit areas, so I approximate normal vector in tangent space data and it works fine - application of ambient emissive map is dependent on Z component of normal in tangent space - bumpy steep parts will be darker then so we actually see variation in lighting for unlit areas (for small bumps it acts a bit like dynamic ambient occlusion). I'll try to make it also heightmap dependent to get most of it.

    Will put some screenshots as they are done.

    ATB, Tom
     
    Last edited: Dec 3, 2013