Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    My terrain turns black at runtime after adding a skyshop Sky to my scene. I have the option to use the sky checked in the LODmanager. When I disable the Sky, it works fine. How can I fix this? Thanks.

    Windows 7
    DX9
    For standalone

    black_02.png black_01.png
     
  2. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hmmm, which version of Unity do you use ? This is present here for a few years since Unity 3. Somebody asked about this already here:

    http://answers.unity3d.com/questions/198496/questions-about-toolscurrent.html

    I'd suspect that some of your class used in project redefines Unity's Tools class.

    I can't reproduce this on my side. However I installed newest SkyShop and I see some differences which makes it not %100 synchronised to current RTP. Apparently new SkyShop doesn't access diffuse cubemaps anymore but use spherical harmonics. So - when you check "sync to skyshop" in LOD manager diffuse IBL won't work. In case you need diffuse IBL you can't use sync to skyshop option, but specify sky cubemaps manually (RTP's Settings / Main). Things should work exactly the same as far as you don't need to rotate skybox via skyshop.

    You need to give me you exact setup so I can try to reproduce your issue. I mean - realtime lights in your scene, is it forward or deferred. Exact LOD manager options and number of layers used on the terrain.

    Tom
     
    Last edited: Aug 28, 2014
  3. Ebolinux

    Ebolinux

    Joined:
    Jan 23, 2014
    Posts:
    117
    Have a question for you. I am trying out RTP for the fist time. I already had a bunch of terrains created with all the maps done. When I add in RTP it seems to be replacing what I already had.
    I have 16 terrains. The terrains all have a Terrain Material (Nature/Terrain/Bumped Specualar) added to them. They have all terrain textures & splats done. Basically the are all fully created terrains.
    Is it possible to take RTP and use it instead of the current Terrain Material with OUT losing all of the splats???? When I add RTP to terrain1 it turns pink or black.
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Sure it is possible. RTP doesn't change it. You'll only need to apply normal maps and missing height maps manually after adding Relief Terrain script. Remember that every terrain will use the same splat detail textures unless you group them in separate parents. Refer to my pdf docs. After adding RTP component you need to recompile shaders in LOD manager. It's presented in my first steps video.

    Tom
     
  5. Ebolinux

    Ebolinux

    Joined:
    Jan 23, 2014
    Posts:
    117
    Thanks for the info.

    I found my first set of problems was having conflicting terrain shades. I enough and removed the other shades. The next thing I had to do was fix the "cannot find include" errors in both RTP_Base.cginc & RTP_AddBase.cginc. Also had to add the deferred lighting script.

    Then it started showing up. But I am getting select black spots, and I think UniStorm is giving large blue blue & gray blobs depending on where the clouds are, and some of the textures are no longer smooth and are really squares. You can see most of it in this screen shot. You can Not see the blue blobs unless you click play.
     

    Attached Files:

  6. Ebolinux

    Ebolinux

    Joined:
    Jan 23, 2014
    Posts:
    117
    Here are more screen shots of what its doing.
     

    Attached Files:

  7. rcober

    rcober

    Joined:
    Jan 26, 2013
    Posts:
    52
    Tomas - Quick question - Does RTP work in the latest mobile hardware? Like Android Tegra K1 or iPad Air?
     
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Include errors are present in the version that is NOT recent one (look for RTP3.1d version available on AssetStore). Black artifacts are made by 10 layers used and shader not configured probably in LOD manager. There is possibility to render 12 layers, but it's strictly advised to not render more than 8. Exactly you should use either 4 or 8 layers. Refer to my documentation. Blue holes are caused by terrain piercing feature turned on by default in LOD manager. It's described in docs (your global colormap has black parts in alpha channel) - of course I assume buish areas is skybox visible thru terrain, but I could be wrong here.

    Personally I could get it roking on my Mali400 GPU on my tablet and I can't tell because I don't have hardware to check this. The only thing is somebody used this on iPad3. I remember a user posting info about it a few pages before on this thread. Theoretically this might work because it gets compiled for GLES on my side. But this is only theory - before I can see results on real hardware this assumption is kind of "optimisitc possibility estimation"... :)

    Tom
     
  9. Reigner

    Reigner

    Joined:
    Sep 24, 2013
    Posts:
    3
    Hello,

    I'm trying to figure out the right combination of RTP 3.1 settings for the TerrainScene example so that I can eliminate the seam between the cave entrance and the terrain. I'm using the free version of Unity 4.6.0b17 with forward rendering/hard and soft shadows.

    Here's the cave entrance mesh:

    Currently, the cave entrance has the Plane_GeometryBlend_PM script attached to it and I haven't made any changes to its settings. My RTP_LODmanager settings are as follows:

    LOD level=POM
    RTP_SHADOWS
    RTP_SOFT_SHADOWS
    RTP on terrain - first pass
    RTP on terrain - add pass
    RTP on terrain - mesh blending
    RTP on mesh
    RTP on mesh - mesh blending
    openGL (Mac)
    No forward add
    No lightmaps
    Enable holes cut
    Fog type=Exp 2
    Complementary ambience lighting
    PBL fresnel term
    Basic PBL fit for deferred

    (First pass settings)
    MaxLOD=POM_Soft Shadows
    UV blend
    Global color blend multiplicative
    Advanced color map blending
    Sharpen heightblend edges
    Heightblend fake AO

    (Add pass settings)
    Crosspass heightblend
    MaxLOD=POM_Soft Shadows
    UV blend
    Global color blend multiplicative
    Sharpen heightblend edges
    Sharpen them even more
    Heightblend fake AO
    AddPass for geometry blend base
    Additional features in classic fallback

    Any insights would be greatly appreciated. This is a great plugin and I've been having a lot of fun using it in conjunction with Terrain Composer.

    Best Regards,

    Eric
     
    Last edited: Sep 1, 2014
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    No matter LOD manager first pass/add pass settings you need to enable "RTP on terrain - mesh blending" and recompile shaders. Then try to click rebuild on cave and use painting brush to remove seams. This worked for me. (indeed after importing RTP example scene cave has seams). Refresh All button in RTP Settings/Main can also help. Make sure ReliefTerrainGeometryBlendBase.shader got recompiled (it sometimes hangs on Unity side, in newer version I take care about it to force recompile shader) - simply right click and reimport this shader after handling everything in LOD manager.

    Tom
     
  11. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    575
    Hello. Can a person paint a mesh just like a terrain with RTP
     
  12. Reigner

    Reigner

    Joined:
    Sep 24, 2013
    Posts:
    3
    Clicking "Rebuild mesh" on the cave entrance and then re-painting the seams worked:



    Thank you!

    Eric
     
    Last edited: Sep 1, 2014
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Nope, RTP is basically a shader system, not mesh construction system.

    Tom
     
  14. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    575
    hmmm soo how does a person apply RTP to a mesh for a terrain is a satisfactory manner i wonder
     
  15. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    RTP is incredible! Thanks for your hard work on this Tom. You can get a heck of a lot of detail with just RTP and no models!




    I hope its OK to post these!
     
    Last edited: Sep 2, 2014
    John-G likes this.
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If I understand well your concerns. RTP can be used on any mesh, not only Unity's terrain. When using this with Unity terrain you can benefit dynamic terrain mesh creation out of heightmaps (Unity terrain does not have its own, static mesh) and coverage tools (splat textures, details, trees). RTP can be, however applied to any mesh that is top planar mapped. Example isincluded in the package. I exported a mesh from World Machine, then optimized in Blender and used RTP shaders on this. Also - RTP can be used on ANY mesh that has as small definition as normals only. For example you can have voxel created mesh and apply RTP shaders on this. Detail coverage can be then defined by vertex colors or by world normals (different textures at cliffs and so on).

    You're welcome and screenshots are pretty convincing, too ! Thanks for posting (there is never enough for RTP awarness in the community I'd say).


    ATB, Tom
     
  17. Ebolinux

    Ebolinux

    Joined:
    Jan 23, 2014
    Posts:
    117
    Hey tomaszek,

    Thanks for the info! It ended up being having to many layers. Once I took it down to 8 layers everything started working great!

    Has anyone used this with SUIMONO water system? I noticed that when you go Under the water that it no longer is see through. Eveything turns a solid blue and you cant see anything. Before you could see the ground and light coming through the water and everything.

    Can RTP fog be turned off? See image below for what it looks like.
     

    Attached Files:

    • fog.jpg
      fog.jpg
      File size:
      53.7 KB
      Views:
      845
    Last edited: Sep 2, 2014
  18. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    I believe if you remove the RTP_FogUpdate script from _RTP_LOD_Manager it will stop updating the unity fog system. Then you can set the fog system, import the settings to RTP and then allow your other systems to control fog without effecting the terrain.

    Forgive me if I'm wrong, Im a noob
     
  19. freeger

    freeger

    Joined:
    Jul 5, 2014
    Posts:
    162
    Hello Tomaszek, when are you planning make RTP for unity 5?
     
  20. freeger

    freeger

    Joined:
    Jul 5, 2014
    Posts:
    162
    Also can i use RTP with any mesh object, not only with terrain?
     
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP shader turns off Unity's fog handling and processes it on its own. The reason I needed to do it this way is RTP works at the edge of resources available. By resources I mean texture interpolators number available for shader. You can turn off fog for RTP in LOD manager, but it means you won't have fog at all on the terrain. To fit Unity's fog model to fog used in RTP you need to select it before compiling shaders. LOD manager allows you to use any available now fog model - Exp, Exp2, linear. Script mentioned by TemplarGFX is meant to update RTP's fog state to changing global Unity's fog. For example UniyStorm changes fog settings realtime and RTP needs to adjust fog settings accordingly. My fog script attached to LOD manager does it every frame, but you control it your way - look what's done in my script.

    For Suimono - this might be fog related I believe - underwater fog density might be so strong that you can't see anything. The problem might be that underwater and overwater fog needs to be the same model, because RTP can't "switch" fog model realtime like Unity does. Check this.

    I took a quick look on RTP with U5 - you've got it on previous page http://forum.unity3d.com/threads/re...-v3-on-assetstore.206516/page-34#post-1743448

    You can use RTP shaders on any mesh, but global maps work only when you've got it properly top planar uv mapped like Unity terrain dynamic mesh is.

    Tom
     
  22. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541

    Very nice, how did you do those, would you mind sharing the method you used?
     
  23. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    633
    It looks so reall :O
     
  24. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    Of course! There are several things that made those images look so good
    The first is good high quality 4000x4000 texture images, that have been processed with CrazyBump to create smooth, defined DEEP heightmaps. These were then imported into unity at 1024x1024 to give sharp crisp texturing.

    To get the ground looking that way first I applied textures (using TerrainEdge) to the terrain but with dirt textures in my grass layers, rock textures in my dirt layers and darker rock textures in my rock layers. I then use these colours to create my Global Map. After this I switched my textures back to their correct ones for each layer but did not rebuild the global map. This gives a surprisingly good amount of toning to your ground and helps to get everything blending into each other.

    Finally I spent a very long time tweaking the RTP settings for every layer. in particular the parallax offset reduction and gloss/highlights. The difference between great looking parallax and ok parallax can be as little as 0.01 on the reduction offset!

    Definitely though, its the textures that make the most difference. Comparing to the results I got with the included examples.
     
  25. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    Hey @tomaszek ,

    Any plans to upgrade RTP or release a new version for Unity 5 that will work with Enlighten, other lighting features and Unity's PBR pipeline maybe? Maybe things like reflections with an input from reflection probes/main reflection (in scene render settings)?

    Do you plan to change the RTP shaders to the same workflow as Unity standard PBR shader? So it will require albedo, specular, normal, ao etc. maps?

    Can you tell us anything about that at this moment?


    I wasn't checking this thread lately so maybe there are already some updates/features that will work with new Unity features :)

    EDIT: Just checked updates and it looks like there are some IBL/PBR/ etc. features in RTP already. Can you tell what are the plans for Unity 5 anyway? Will they work out of the box with GI and other stuff?
     
    Last edited: Sep 4, 2014
  26. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    How do I access Snow amount via script? I can do it for water, but there is no mention of dynamically controlling snow via script in the manual, and I cannot find any variable to change.

    nevermind its just named differently RTPscript.GlobalSettingsHolder._snow_strength
     
    Last edited: Sep 4, 2014
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP has already PBR/IBL that's of the same class as new U5 standard shader. As for GI/Enlighten and reflection probes. This moment I don 't have enough documentation how to incorporate these into my rendering pipeline. I only checked roughly U5 beta with RTP. At this stage Unity needs to fix some things for RTP to fully work like in U4. I hope they will fix what I sent to them (not working 8 layers mode and Unity's lightmaps while you still have use RTP's one)

    Tom
     
  28. bhads44

    bhads44

    Joined:
    Feb 19, 2013
    Posts:
    37
    Hello Tom,

    Can you add a modifier to render control maps from source splats so that it applies to all terrains in the scene?

    Thanks
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Do you mean making control maps for more terrains at once ? That would need setup of all source splats for all terrains. As RTP doesn't do it (it's work for TC for example) the only automation here would be applying existing source splats to all terrain objects at once. I guess it's not worth doing as you can manage multiple terrains more effectively by other 3rd party solutions. My controlmaps from splat textures functionality is rather meant to be used on a few terrain objects, not a matrix of 16x16 :).

    Tom
     
  30. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    Thought you might like to see RTP linked up with Environment Gator. Script is available on the EG thread

     
  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Weather condition is quite nice as it presents dynamic features on RTP. If I could suggest a few points that might make it even more impressive. Colorizing a tiny bit water will make it more obivious when it covers the terrain - now we can only see this by refraction. Reflections would also help beause water expose its physical specularity. You could play with water level and water flow speed. When the temperature goes down under zero we could freeze movement (flow speed 0) and colorise a bit - would resemble ice. I'm not sure why your snow is a bit yellowish, but it's probably due to specific scene lighting.

    Anyway - good job as you integrated two systems together.

    Tom
     
  32. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    Thanks heaps for your input Tom! I was having problems with specular not showing up, but then I realised I forgot to actually apply the defferred script to the sun directional prefab!
    I had coloured the water brown, figuring the dirt environ would colour it that way, but after reading your post I tried a dark blue and low intensity and it looks much better. The specular on the water as it builds up is gorgeous! I am just tweaking the control script a little to take more advantage of the wet and flowing stages of rain, and tie wetness to terrain saturation so that lots of rain will keep the ground dark for longer.

    I have yet to look into changing the water settings on a per-layer basis, but I definately want to expand it so that freezing temperatures will freeze the water effect, rather than converting it to snow which I have right now. soon!

    edit

    Now that is some great blending!
     
    Last edited: Sep 5, 2014
    nasos_333, tomaszek and John-G like this.
  33. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Wow, please explain more about this, did you do two layers of parallex to get the bush to stand out like that or use that 3rd party app?
     
  34. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    This is 2 seperate layers using height blending on RTP. I create my heightmaps in CrazyBump, and then import them into GIMP to run a color level filter on it.

    When creating heightmaps (you should always create your own customs heightmaps for your project, or filter the prefab at the least) you should split them into at least 2 groups :

    Full Range and High Range. Full Range has the lowest point as black (0,0,0) and highest white (255,255,255). High Range has the lowest at a dark grey (around 100,100,100) and highest white. (I usually go with low full and high)

    In the above image, the rocks are full range and the undergrowth is high range. this gives it the fantastic blending.

    Using the Color Filter in GIMP or Photoshop you have this :


    First thing that we do is adjust the ends in somewhat. The highest details will be provided by the normal map and the darkest are impossible to tell apart. so pulling them in increases our height field range

    This is a filter for a Full Range map (I'll talk about the middle point in a moment)


    High Range Map filter (notice output levels)

    The Middle point on the input level decides how profound the lower or upper portion of your height map is. If you want to emphasize the high areas of the texture move it to the right and low to the left. Most textures will benefit from giving some preference to the lower area (as in the above image)

    Finally, when creating heightmaps for all your textures, you should decide on a parallax distance you want to simulate. For example decide black on your heightmaps is 5cm deep. Use the Output levels to scale the final heightmap to match the amount of depth you think is appropriate for the texture you are working on and keep this scaling across all your maps. This will keep the parallax constant and easy to manage as global changes will scale across all your layers properly without throwing things out of whack.

    Here the clovers are full range and the dirt is low range, allowing me to use the Extrude Reduction of RTP to raise or lower the height of the dirt in relation to the clovers (as you would expect)
     
    Last edited: Sep 5, 2014
  35. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541

    Very nice info, do we need this CrazyBump tool to make this or is there a free alternative?
     
  36. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    There are several free alternatives to CrazyBump of varying awesomeness such as [url=http://blenderartists.org/forum/sho...ne-Bump-Free-alternative-to-crazy-bump]Insane Bump for Gimp[/url] But they are harder to use and setup. Crazybump can produce a high quality heightmap from a single photo in under 30 seconds.
     
  37. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Cool thanks, hope to try this in RTP/Unity, there is a version 2.0 http://blenderartists.org/forum/sho...ne-Bump-2-0-overhauled-Crazy-bump-alternative
     
  38. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    To be honest, CrazyBump is worth the money if you plan of using specialised shaders in your game thanks to its production of Diffuse, Normal, Height, Spec, and AO. Or you plan on creating your own entire texture set (rather than gathering them prefab style). If you just want to take your RTP textures and pimp them out, InsaneBump is fantastic.

    I finished implementing a surface temperature system alongside saturation and temperature for the link to Environment Gator. Firstly however I spent some time on better looking terrain and really honing down the water/snow settings. I found if you really spend your time making tiny adjustments to the global and layer settings for the water you can get fanstastic effects with specular. For instance the dry dirt infront of the camera becomes a dark mud when its soaked, and the water flows around the rocks.

    I noticed however that I cannot get specular to work in Deferred rendering. The following video is Forward, but if I switch all the specular goes away. Im new to unity so any tips would be great!


    (8x normal speed)

    You will notice at the end the water turns to snow. This is temporary until I figure out how to change the layer water properties. What happened was that the surface temperature was -9 (after all that snow), the ground was saturated from all the rain, and the water froze.
     
    tomaszek likes this.
  39. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    in deferred mode avoid two passes (4+4), because only the first pass will have fully controlable specularity. To increase specular dynamic range install Lux (it's free PBR framework available in AssetStore). You might need to adjust specularity glossiness values in deferred as they won't match forward by default.

    Tom
     
  40. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    I will try reconfiguring to use 1 pass with 8 instead of 2 with 4 each. is there anything special that is needed to be done when installing lux for use with RTP (like copying/deleting/editing shaders)

    Thanks for ther reply!
     
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP vs Lux interference - I'm not aware abou any, but Lux redefines hidden deferred pass (so it might interfere with other PRB solutions like Skyshop, Jove, Alloy).
     
  42. unity3dcoder

    unity3dcoder

    Joined:
    Apr 15, 2013
    Posts:
    8
    @TemplarGFX : thank you for sharing your insight into optimizing the texture blending. Can I ask your thoughts on whether you can achieve good effects just within crazybump's displacement and normal tabs, or is the additional photoshop/gimp step required to really maximize the effects in RTP ?
     
  43. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    You can get great looking terrain with just the stuff CrazyBump exports. The reason for the second step inside a photo manipulator is to equalize your heightmaps across all your textures. This is so that on one texture you don't have depth in the texture that should be say, 10cm where all the rest max out at 2cm.
    Finally splitting your maps into 2 or three groups (low range, full range and high range) allows you to get the most out of the blending and special effects available with RTP. They work fine without these tweaks to the heightmaps, but they look ALOT better when you tailor your maps to RTP.
     
  44. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    Hopefully you can help me out here Tom,

    I am getting a nullreferenceexception in my script when I try and record the current layers water settings :
    **removed a heap of code**

    Nevermind, it turns out I was applying LUA coding practice to C#. you cant have a dynamically sized array it seems. Declaring my array sizes fixed the issue.
     
    Last edited: Sep 9, 2014
  45. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Hello Thomas!
    This must be asked 100 times and yet, I cannot get this scenario get to work:
    how do I add multiply Managers to a scene? I prefer to have two terrains in one scene and tweak them completely independent from each other. I want to use this to load either a lowres version or a highres version during runtime. E.g. the lowres terrain needs to have different settings in order to increase performance. (ps; that group trick doesn't seem to work. I still has got one manager and they have effect on both terrains, even with complete different parents)

    What is the workflow on this?
    Regards! Tom
     
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    place your terrains in separate parents then add RTP - they will work on independent ReliefTerrainGlobalSettingsHolder objects. Thus - you need to use materials to benefit from grouping.

    Tom
     
  47. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    and what if I have already added a terrain with RTP in the scene and want to add a second one? Is that stil possible? Btw, I also noticed that I can mess up my terrain A in Scene A when I try to create a new terain (B) in scene B. It feels like, RTP is using global settings...
    RT
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If you've got one terrain in scene, you can put the other in idfferent parent (firt one does not need to be parented). Then these two terrains will act independently.

    When you don't use materials then shader setup is global per project (like default terrain shaders - they are global). If you use materials, you can overcome this, but with some effort. You can compile shaders in one scene, then copy compiled versions to another files (depending on what you use - first-pass addpass, far-only, blending shaders in Internal subfolder) and use them in terrain material. Then these compiled shaders are independent, but still - ReliefTerain relies on LOD manager state, and Lod manager relies on shader state (keywords in shaders, layercount tags and defines used in RTP_Base.cginc / RTP_AddBase.cginc), so you'll need to cheat sometimes LOD manager/ReliefTerrain object.

    Tom
     
  49. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Hm, not sure if I understand...i can also copy the compiled shader in the shader folder, rename it (also in shader file) and then use that as a final shader? Then i can compile new shaders but leave the renamed ones ontouched? Would that work? I am ok with having on LOD manager controlling shaders as log as I dont screw the finishes ones ;-)
    Regards! T
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The reason I introuced LOD manager in RTP2 was necessity to configure shader features. As I added new ones number of possible shader permutations increased drastically. I can't use multi compile options we need to choose which features are needed and compile shaders with them. In RTP1 you needed to enable/disable #define keywords in shader code, but I realised this might be too complex for many users and introduced LOD manager. It handle enabling/disabling #define kaeywords in shaders and recompiles them, So - after LOD manager recompile you can use compiled versions (open them using Unity shader inspector). Remember that some shaders are dependent (at the vey end of first pass shader there are 2 dependeicies introduced - reference to AddPass shader name and baseMap - FarOnly" version - you need to tweak it in shader code after you preapre your compiled "first" / "add" / "far only" versions as needed).

    Additional thing is ReliefTerrain relies on LOD manager state (that's why RTP object inspector knows which features are enabled/disabled while LOD manager knows it by analysing current ReliefTerrain-FirstPass.shader, RTP_Base.cginc and so on).

    So - what you try to achieve is doable, but needs some awarness how things work and a bit of patience when managing shaders manually.

    Tom