Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    So,

    Of course post anything you feel is suitable here, but I've just started new RTP showcase thread. Posting your artwork there will benefit all of us. RTP users as they can share their tips about RTP workflow and show their skills. Me as RTP can gain more attention with some eyecandy screenshots posted on forum showcase section. This means - more new users and RTP can be held at constant development and customer service level.

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

    On RTP AssetStore thread here I could answer user questions while there you can share your RTP results. Such split will be good I guess as here when new users will be forced to roll over so many pages looking for the technical solution might be just tedious...

    Anyway - thank you very much sharing all your RTP work ! I care much about it, so don't hesitate. I think I can also reward active users there with some extra goodies like new fancy geom blend shaders or so... :)

    Kindest Regards, Tom
     
    Last edited: Nov 7, 2013
  2. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Btw is the great demo going to be shipping as part of RTP later on or separately downloadable? I'd love to see it in scene view (also would be really great if the world machine project file could ship too!)
     
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The problem with the project is that it uses many 3rd party assets (textures, models). That's why it can not be simply part of RTP package available to the users. However we'll release public players (not only showcase video) when demo is ready to show this in action.

    For WorldMachine project and any terrain modelling phase assets you should contact Peter (Becoming) as he made this.

    Tom
     
  4. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Wouldn't it be nice to change the texture that pose licensing problem? Makes for a nice tutorial on top of a demo if released as source.
     
  5. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    Hi Ronan,
    i can't unfortunately give the scene away, as i used Textures from cgtextures.com and they state clearly that they can't be redistributed... i tweaked the textures a lot but the wont make any exceptions...
    I intend to make some tutorials though, i just need to finish the demoscene and find some time... i am always short on time, so it might take a while. However, i am very interested to give tips and share workflows with anybody who is interested. I can't lay down the whole workflow as this would take quite some time to explain but if there are any specific questions, i am happy to help!! I am following this thread regularily as i am very curious what other people will do with RTP...

    edit: its not only the textures but models from paid assets... I plan to make minitutorials on some features and a bigger one which is generally explaining my workflow(which is not meant to be the best way, its just one of many possible ways that are possible with RTP), i hope the tutorials will compensate for the lack of a high class demoscene. The demoscene Tom made is not so bad either.


    All the best,
    Peter

    PS: Thanks Tom for making the showcase thread, i hope that many people will participate and it will lead to interesting discussions! If you agree i will post some of the Screens from the demo there too, i'll try to make new ones soon!
     
    Last edited: Nov 7, 2013
  6. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Hi Tomasz,

    I'm having some sort of issue with RTP 2. The extrusion of POM shaders isn't working. All other features seem to be working just fine, but there is clearly no extrusion, no self-shadowing, etc. I have recompiled the shaders a dozen times trying to find out why this is happening, but not sure.

    Compiling the shaders, I get errors:

    But I think this is just the typical error you get when some scripts are compiled in a different order.

    I also get:

    These lines are specifically dealing with the AFS 2.04 shaders, and TerrainEngine.cginc.
    Can I assume that RTP and AFS are not compatible? Or do I need to get RTP 3.0 for this to work?
     
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    David,

    Take RTP3 as soon as possible. The further you go with RTP2 the more work you will just waste as RTP3 is much more optimized, reliable and...better.

    We're using AFS 2.04 on our demo scene, so it's proven to work with RTP3. In fact I discuss a lot with AFS developer some coherent compatible solutions to not let one package "fights" each other, but behaves nice to the user :). Such cooperation/discussion is good for the reason sometimes 2-3 person can agree or figure out much better solutions togehter like in case of some technical improvements in newest AFS.

    Tom
     
  8. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Update: I have no shader compiling errors anymore, as I found the conflicting ATS script (there was one sneaky one left behind). But there still isn't any extrusion or POM shader features working.

    Edit: Okay, PMing you now with invoice number.
     
  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP3 is on AssetStore. Go and get it for free.

    Tom
     
  10. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Hi, I have a question about UV blend scale value for layers.
    I'm using 8 layers (2 passes). I can change UV blend scale values separatly for layers 0->3 but
    for layers 4->7 this value is shared for all layers. I'm in the doc, but I don't see the explanation there.
    (or I certainly misunderstand the layer router system)

    in LOD_manager, I'm using:

    Pass 1 :
    from 0->0
    from 1->3
    from 2->2
    from 3->3

    Pass 2 :
    from 0->0
    from 1->1
    from 2->3
    from 3->3

    Olivier.

    edit : second pass use triplanar mapping.
     
    Last edited: Nov 8, 2013
  11. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Thanks Tom, works like a charm ;-) I feel silly I didn't read that "long" section through.
     
  12. MadToLove

    MadToLove

    Joined:
    Jul 22, 2012
    Posts:
    70
    Thanks for the tips ill give it a shot! ahah like a zombie right now, been up till 5 am past three nights, messing with all this, its not only fun but its relaxing trying to make terrain.
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Olivier, you've just found a bug... Go to RTP_LODmanagerEditor.cs

    and look for this line:

    Code (csharp):
    1.  
    2. _target.UV_BLEND_ROUTE_NUM_FIRST[k]=EditorGUILayout.Popup(_target.UV_BLEND_ROUTE_NUM_FIRST[k], options);
    3.  
    you'll find it two times, second occurence replace with this:

    Code (csharp):
    1.  
    2. _target.UV_BLEND_ROUTE_NUM_ADD[k]=EditorGUILayout.Popup(_target.UV_BLEND_ROUTE_NUM_ADD[k], options);
    3.  
    The problem was that you couldn't set independent routing for add pass in lod manager (it just shared rounting layer indices from first pass)

    Sorry for the inconvinience, I'll add this fix in next update.

    Tom
     
  14. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Thanks !
     
  15. Deleted User

    Deleted User

    Guest

    Hey Becoming,

    how detailed is your sculpt in zBrush? Can you show some pictures? :)
     
  16. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    In spite of what the documentation is saying, the linear lighting works and has always been working in Unity Free.
     
  17. Deleted User

    Deleted User

    Guest

    Unfortunately in linear space, foliage (details) and alpha values are rendered incorrectly. I've already submitted a bug report earlier this year. I got an answer - it should be fixed in 4.x
     
  18. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    My terrain, mesh actually, doesn't appear to be effected by fog? Is this so? Is here a fix or workaround? Thanks.
     
  19. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Hi Tom,

    Thanks for you amazing feedback speed -loving RTP 3.0 and solved all my issues late last night (rated 5 stars) :)

    I have two new questions. Any advice?

    1. As others have mentioned, would really like to have unity's other fog type working (not just Exponential). Even though fog has caused me a lot of annoyance in other shaders, it still does "glue" the scene together in a certain way which I'd love to keep with RTP. It would be nice to have RTP shaders take a tick-box option to add unity's other fog options on shaders when rebuilding from LOD Manager.

    (EDIT: Just to clarify, I'm talking about other Unity fog types like Linear, which are useful for certain types of environments.)

    2. Walking on Air - Because the parallax setting height extrudes downward (for obvious reasons), it sometimes leaves objects looking like they are hovering above ground (the distance is equal to the extrusion height, like ~5 to 10 cm). My camera is close to the ground and has custom field of view settings, so the effect is quite obvious. Mesh blending with terrain covers it up nicely, but that solution can only be used for large geometry like rocks, and requires the special RTP shaders. Other objects can't use these shaders, like characters, mobs, physics-affected objects, chairs and tables, etc. What kinds of solutions can you recommend to reduce the "walking on air" effect?

    (EDIT: Solutions or simply level design/arrangement techniques that can minimize the visible effect)
     
    Last edited: Nov 9, 2013
  20. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    160
    There's no linear fog support in RTP3? This might be an issue for us though I need to check it out.
    It seems RTP2 don't has this issue (which we're using at this moment)

    Tom could you tell us more about why it's not supported and if you have a solution for that?
     
    Last edited: Nov 9, 2013
  21. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I couldn't get any of the fog types to work. I opened the project up this morning and it was foggy as heck. Turns out closing and reopening the project applies whatever fog settings you have set. But it;s a one time shot, you cannot adjust them.
     
  22. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi everybody,

    As all previous questions was fog related I'd like to clarify things.

    The reason RTP uses Exponential fog is that I was able to implement exactly the same formula as Unity uses. For linear/exp2 modes - I'll have to dig deeper and implement them, too as an option in RTP shaders. For SM3 shaders Unity implements fog by patching compiled shaders. The problem is that complex shaders (I think it's related to number of interpolators used) are just badly patched. It was dramaticaly bad in Unity3 when we just couldn't use fog for RTP in forward because results was completely messed up. In Unity4 things work better, but still there are problems when using more options like fog+shadows (which also uses some interpolator resources) - it basically works but I experienced problem of disapearing skybox then... At the end - was so frustrating that I've decided to get rid completely of Unity's fog implementation (setting Fog {Mode off} in shader code) and bake my own fog in the shader. The drawback is that it doesn't work "that globally".

    Now you can check fog in render settings and choose exponential then in RTP you have to refresh (in editor it's just changing anything) or via script (to adjust fog settings dynamically runtime) by calling Refresh() method of globalSettingsHolder (refer to manual). If it's not refreshed - you won't see any fog changes as refresh function set global shader variables that are used in RTP.
    If you use Exp2 in render settings fog on terrain will also appear, but will not fit rest of objects on the scene (that uses built-in Unity's fog solution).

    The custom fog implementation is placed in RTP_Base.cging and RTP_AddPass.cginc - anybody can just look for such part of code there:

    Code (csharp):
    1.  
    2. fixed3 _FColor;
    3. float _Fdensity;
    4. void customFog (Input IN, SurfaceOutput o, inout fixed4 color) {
    5.     float f=saturate(exp2(_Fdensity*IN._uv_Relief.w));
    6.     color.rgb=lerp(_FColor, color.rgb, f);
    7. }
    8.  
    where IN_uv_Relief.w is param taken from vertex that stores worldspace distance, _Fdensity is the density (like in unity's render settings) and _FColor is the color (like in RenderSettings). I wish I have access to these values automatically, but they are probably not exposed to custom shaders - that's why I have to get render settings params (desity/color) and inject them as global shader variables here.

    I also implemented this is some more advanced geom blend shaders that are part of RTP3 package.

    The only problem now is to make 3 functions - exponential (already implemented), exp2, linear to be chosen from LODmanager via some #define keywords (let's say #define RTP_FOG_LINEAR in shader code). I'll try to make it in near RTP update. If you'd like to implement yourself different fog - do it in this customFog function, but you'll probably have to define more variables (and set them globally so they follow render settings) for linear fog - start / end distances.

    I'll try to implement it ASAP and will get back here with complete solution.

    Kindest Regards, Tom
     
    Last edited: Nov 9, 2013
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Walking on air - the only solution for now is to set lower extrusion height in settings - less parallax means less "walking on air". When you've got areas where it's much obvious and nasty - use Settings/GlobalMaps/global color map painting tool and paint "Extrude Height" (not color). This will edit alpha channel of gloal colormap which is used by RTP to reduce parallax effects localy.

    Best solution would be writing into depth buffer so effect is corrected (object in extruded "holes" would be visible right "inside" volume, not above). I believe that problem with writing into depth buffer has been solved (it was broken for years in direct X). Problems that arise using this technique are:

    1. generally - worse performance (GPU will always run expensive pixel fragment w/o taking z-test scisors test).

    2. can not be used in surface shaders, only in compiled versions. So it would require using LOD manager to compile shaders with #pragma debug, then getting per-compiled shaders (transfomed from surface shaders into regular ones). Then adding depth writing code inside and compiling results for usage. As soon as I'll find a method to automate this process (or when surface shaders can do depth buffer writing) I'll use this in RTP. For now - it can be achieved but would be just customization of shaders. If you really care, we could negotiate such custom work just for your project (you give me shader produced by LODmanager and I customise this to resolve the issue).

    ATB, Tom
     
  24. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Hi Tom,

    I'm using deferred lighting and the Time Of Day asset so I added the ReliefShaders_applyLightForDeferred.cs to the sun object of TOD. However this error is popping up:

    Instantiating material due to calling renderer.material during edit mode. This will leak materials into the scene. You most likely want to use renderer.sharedMaterial instead.
    UnityEngine.Renderer:get_materials()
    ReliefShaders_applyLightForDeferred:Update() (at Assets/ReliefPack/Scripts/Common/ReliefShaders_applyLightForDeferred.cs:27)

    Maybe good to know the actual directional light object has a material attached to it to simulate a bright light source (using the shader Time Of Day/Sun).
    I updated the script and replaced the renderer.materials code to renderer.sharedMaterials and the error disappears maybe after reviewing you can update the package?
     
  25. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Thanks for clarifying about the fog. Maybe Unity will improve in later versions to make new things possible. We all know there are lots of legacy issues in certain Unity systems. :)

    Extrusion gaps:

    Okay, great, I will try painting the heightmap and see how it goes. I think it will require higher resolution to get accuracy, so will check the performance on that. Thanks in advance!


    Techniques for hiding the "Parallax Extrusion Gap"

    I'm not expert (just started using RTP last month) and would love it if others added advice here. I have a wilderness terrain, and I used the following technique to hide the "floating" effect when you observe mesh-terrain seams of objects that can't blend into parallax terrain.

    1. Occluding the seams by just blocking them from camera view. I used smaller foliage meshes (I used AFS 2.04 plants) around the edges of "hard" geometry. The animation of the foliage was also a distraction that drew my attention away from seams.
    2. I made one generic dirt terrain texture with a specifically whiter heightmap than the other terrain textures (so it's higher and closer to the terrain's original surface). Using this texture around the edges of hard geometry was effective, but meant I had to increase terrain resolution one step. I think it was worth it overall -I expect a high level of user graphical scrutiny.
    3. Ambient Occlusion and Ambient Obscurance scripts for high-end video cards are great for darkening the seams and not drawing the eye's attention. Probably, this will prevent most users noticing the effect.

    Terrain grass had the same floating on air effect and I obscured this nicely by the following:
    • Terrain grass obscures the extrusion gap better when used at higher strength -when there are only a few bits of grass then they also look like they are floating. But seriously, with the RTP shaders I don't need to use grass much anymore because I'm not trying to hide unity's default ugly terrain.
    • Use alpha to soften the base of your terrain grass textures so they fade-out/blend-into the terrain. This reduced the obviousness of the extrusion gap. Basically don't use flat-bottomed edge for grass textures.
    • Don't use grass on parts of the heightmaps that are darker (heightmaps of terrain layer textures). It's a dead giveaway if your extrusion is 0.05 or more and the target area is a black spot on the heightmap.
    • Also, grass textures with a narrower base or grass stem worked better. There was less of a solid ground-line to compare with the terrain level.
    Also, trying Toms idea for painting higher areas on the global colormap soon to see how it goes, although that is probably going to increase the terrain resolution needed in may case.

    Any other ideas are certainly welcome, thanks! :)
     
    Last edited: Nov 9, 2013
  26. MadToLove

    MadToLove

    Joined:
    Jul 22, 2012
    Posts:
    70
    Just wondering, probably something simple, but when NOT in DX11 mode everything renders fine. The terrain textures everything. When i go into DX11 mode though suddenly all my textures are very low res and just plain/simple/bad looking. Switch back out of DX11 mode and it looks fine. What causes this?

    *EDIT*DX11 mode not active in LOD manager, checked the box, recompiled and got all my detail back. Ahaha man I can be stupid somtimes but perhaps this might help another newb out there like me.
     
    Last edited: Nov 9, 2013
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Thank you for pointing this out. The problem is only editor problem (might be - not necesarilly must be) when you're in edit mode (not run mode). Correction script Update() method is fired using [ExecuteInEditMode] attribute. Runtime and in player it won't be a problem. I can, however detect player mode and use sharedMaterial instead of material call then to get rid of warning/error message.

    The script will be necessary only when you use POM with self-shadowing shader LOD in deferred.

    ATB, Tom
     
  28. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I'm having a problem where the textures look fine in the editor, but at runtime, they appear white. I need to 'render control maps' again to restore them. My project has 6 meshes. I ran some tests initially and it seemed like my setup would work, I could apply coverage maps to each individually. But my first test with the actual project produces these results. So I don't know if it has anything to do with having 6 meshed or not. Where can I begin to troubleshoot this? Are there any additional steps for setting up multiple meshes? Please advise, thanks.
     

    Attached Files:

  29. MadToLove

    MadToLove

    Joined:
    Jul 22, 2012
    Posts:
    70
    ok weird issue, when im loading in my textures by clicking edit texture add texture. Lets say the first texture I add is a grass texture, 2nd texture i load up is a cliff/rock texture. For some reason it keeps turning any textures i add after the first, INTO the first texture. $randomissue.jpg

    See how the first 4 are all the same texture? After selecting the grass texture as the first one, every single texture i added after that was a different one, rock sand etc, but they all turn into grass. Whats up with that?

    EDIT- Also deleted terrain pack, redownloaded and installed and restarted unity. Also noticed this error cropping up

    IndexOutOfRangeException: Array index is out of range.
    ReliefTerrainEditor.OnInspectorGUI () (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:381)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Inspector/InspectorWindow.cs:863)
    UnityEditor.DockArea:OnGUI()

    and this error

    Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
    UnityEditor.DockArea:OnGUI()

    The errors appear whenever in the Relief Terrain tools, i click the Layers button.
     
    Last edited: Nov 10, 2013
  30. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    If you use 6 textures, try to add 2 more textures. I solved this error by doing this.
     
  31. lmtm

    lmtm

    Joined:
    Sep 9, 2013
    Posts:
    32
    Transparency,

    Hi I'm wondering, if it is possible to make
    transparent hole with 20 cm diameter by rtp to terrain.
    Thanks, Milos.
     
  32. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Could you try saving your control textures before making build ? Could you specify more specs (platform PC/Mac, Unity version, RTP_LOD manager settings, player type - web/exe, target platform - dx9/dx11/opengl). Please, tell me your results so I can help you fixing the issue.

    Tom

    P.S. If saving produced control maps to files doesn't help try to find script "ClearAux" (by find asset window). Then inside put "return;" statement right after the beginning of the function. We can then check if this script (which is meant to clear unused textures when making build to hold it smaller) doesn't make us troubles here.
     
  33. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    @MadToLove - botumys has right - RTP3 is meant to use either 4 or 8 layers (or 12 when you set first pass to render 8 layers, but this is not advisable for worse performance - 8 layer can manage most of cases, eventually you can use geom blend painting feature to add some more terrain surface detail here and there). Please check this again using 8 layers and let me know.

    @lmtm - this is not available now, but is quite simple to achieve. The only problem is to define "transparency map" - texture that will be used to define hollow areas. RTP runs at the edge of texture samplers available now, but I'll try hard to increase them by in future releases. For now I could think about simplier solution - we could choose a layer to be hollow (it won't be rendered - you would cut holes in terrain by just drawing them). The drawback is that you make a layer unavailbale. Worse - for 4+4 mode (first pass+add pass) you'll have to disable 2 layers from regular usage (1 on first, one on 2nd pass). I'll think how to resolve it best - you could also advise what would be better for you and if loosing regular 1 or 2 layers availability wouldn't be that bad from your point.

    Tom
     
  34. Terrion01

    Terrion01

    Joined:
    May 25, 2013
    Posts:
    19
    Hi again I got your package now and im useing the Triplanar shader and it works great but I would like to change the dynamic snow to work all over the mesh and not jsut the Y axis iv looked in the shader code but to be honest I dont know what im looking for to edit.
     
  35. devinrayolsen

    devinrayolsen

    Joined:
    Mar 8, 2010
    Posts:
    98
    Hi There, I'm sorry if this has been asked already, but I was not able to find it on this thread.

    Where has the specular color control gone since 3.0? I'm able to play with each layer's specular scale and far distance, but we seem to be missing color intensity like 2 had, that or I'm just not seeing it.
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Could you explain in more details what do you want to achieve ? maybe a screenshot with a bit of explanation ?

    Specular color is set in Settings/Main next to "Ambient correction" and "Negative lighting power".

    Tom
     
    Last edited: Nov 11, 2013
  37. Terrion01

    Terrion01

    Joined:
    May 25, 2013
    Posts:
    19
    View attachment 74151

    I would like the snow to cover the whole mesh as at the moment it seems to cover meshes based on the Y axis im wondering how I would change this to cover the whole mesh.

    Thanks.
     

    Attached Files:

  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi,

    Refer to pdf docs for using RTP on terrain mesh first. It should work - specify height treshold below your whole mesh (I assume you're using shader on some voxel mesh) and reduce snow coverage by slope to minimum.

    Tom
     
  39. devinrayolsen

    devinrayolsen

    Joined:
    Mar 8, 2010
    Posts:
    98
    Hi tomaszk,

    I think I might be missing them options?
    $rtp3-specular-settings.png

    Is this option somehow inherently disabled via an RTP_LODManager option maybe? Also we are in deferred lighting, but I assume that would not remove all specular control, just Relx correct? In a fresh project I can get the options to appear on a new terrain, but just not under our existing project in deferred mode.
     
  40. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It looks odd. Could you tell me about possible console errors thrown from ReliefTerrainEditor.cs script ?

    In Unity 4 I can check if main camera is deferred mode or player settings are set to deferred then I'm enabling/disabling options. I believe editor script is borken somewhere over there (around line 1758 in ReliefTerrainEditor.cs), which rather look like this (not it's handled opposite way)

    Code (csharp):
    1.  
    2.                 #if !UNITY_3_5
    3.                     bool reflexDisabled = Camera.main.actualRenderingPath==RenderingPath.DeferredLighting || (Camera.main.actualRenderingPath==RenderingPath.UsePlayerSettings  PlayerSettings.renderingPath==RenderingPath.DeferredLighting);
    4.                     if (reflexDisabled) {
    5.                         EditorGUILayout.HelpBox("In deferred rendering reflex lighting settings below are unavailable.",MessageType.Warning, true);
    6.                     }
    7.                 #else
    8.                     bool reflexDisabled = false;
    9.                     EditorGUILayout.HelpBox("In deferred rendering reflex lighting settings below are unavailable.",MessageType.Info, true);
    10.                 #endif
    11.  
    you could replace this part of code in the script - then in deferred (not in forward) you'll see warning hintbox that will inform that options are unavailable. If this is OK for you (as you already know that complementary lighting works only in forward - in deferred you can just put more directional lights on the scene to get similar results) - you could set this bool reflaxDisabled variable to false always, but then you have to remember that playing with its settings will have no effect in deferred. I'll try to inspect what can be the reason in your case - I'd like to fix this issue ASAP for nearest update.

    Kindest Regards, Tom
     
  41. devinrayolsen

    devinrayolsen

    Joined:
    Mar 8, 2010
    Posts:
    98
    Wow, that was fast Tom!

    Ok, correct (guess I left out the important part) I do get a script error around that line number:



    Updating the snip to your supplied above snip results in the same error and no change to the main settings view.

    Thanks.
     
    Last edited: Nov 11, 2013
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    So, I'm back again, just took a shower :). And now I can tell that something in line 1759 throws null, but can't tell what exactly - most probably Camera.main is null. The question is - wht's your camera setup on the scene so that main camera isn't defined ? No camera on the scene, or multiple cameras ? What are their params then ?

    To quickly fix the issue replace problematic line:

    Code (csharp):
    1.  
    2. bool reflexDisabled = Camera.main.actualRenderingPath==RenderingPath.DeferredLighting || (Camera.main.actualRenderingPath==RenderingPath.UsePlayerSettings  PlayerSettings.renderingPath==RenderingPath.DeferredLighting);
    3.  
    with this:

    Code (csharp):
    1.  
    2. bool reflexDisabled = false;
    3.  
    but remember that in deferred reflex lights settings and negative lighting won't work.

    Tom
     
  43. devinrayolsen

    devinrayolsen

    Joined:
    Mar 8, 2010
    Posts:
    98
    Ah ha, indeed that worked.
    Regarding our camera, they are instantiated at players entering the photon room (both main camera for game main menu and first person camera), so I guess really at editor there is no camera to be found, only when we hit play to test our scene chagnes does the whole photon room setup, connect, spawn and camera instantiate takes place.

    This makes a lot more sense now, and honestly I don't think there is much you can do to resolve this issue, as indeed its not really an issue, just our project setup.

    Thanks a ton though on getting me my options for specular color!
     
    Last edited: Nov 11, 2013
  44. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Misunderstanding. I'm not building, I meant running from within the editor. And your returning from that with 'EditorApplication.isPlayingOrWillChangePlaymode'. But before getting there I tried saving the control map. no luck. I create a new project with only RTP3 and my meshes and textures and it worked fine. But I would like to fix this, restarting wouldn't be an option in most cases. Something to note, the materials aren't getting shared between meshes, they were in my test project. I read the section in the PDF about multiple tiles. Meshes aren't specifically mentioned, but it looked like I had everything in order. You did mention conflicting terrain shaders from some asset creators. I'm using frees from Michael O, but I believe I've stripped out any overriding shaders. How can I double check that.

    I'm working on a PC, Unity version 4.2.2f1, developing for standalone and webplayer, dx9

    Thank you.
     

    Attached Files:

  45. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Hi, I just grabbed RTP3 ... BUT my project has multiple assets already installed (around 50 or more)...


    I have this error after adding RTP3 to my project:
    any way I can fix this? ...I am not very good with C# yet..


    Code (csharp):
    1. private bool checkChange(ref ColorChannels val, ColorChannels nval) {
    Unity Version 4.2.2f1 if you need that info..
     
    Last edited: Nov 12, 2013
  46. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Not really no, means this type is defined in 2 assets you use so they're not compatible in both you'd have to change the type name everywhere.
    A consequence of unity not suppoting namespaces in uncompiled scripts.
     
  47. sskillz

    sskillz

    Joined:
    May 23, 2013
    Posts:
    12
    Hello,
    Is this pack working on opengl/dx10/dx11 modes, mac/windows/linux and relatively recent ati (4850+)/nvidia(8800GT)/intel(HD3000+) cards?
    If not, what is to be expected not to work (like if it still usable just lower performance)?
     
  48. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Hello,

    A little warning : don't try to update your project for unity 4.3.0f4. The new version of unity don't like RTP 3 (error messages and pink texture even after new shaders compilation).

    Material doesn't have a texture property '_Splat0'
    UnityEditor.DockArea:OnGUI()
    Material doesn't have a texture property '_MainTex'
    UnityEditor.DockArea:OnGUI()
     
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Ouch, breaking news indeed...

    Thanks for putting warning as I haven't installed U4.3 yet. I'll get back with diagnose ASAP.

    Kindest Regards, Tom
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Works on opengl/dx10/dx11 (however it doesn't use any dx10/11 specific features). Works on moderately quick GPUs. Tested on IntelHD3000 on my laptop - works fine (in dx9 and forced opengl mode). However - don't expect blazing fast rendering with many expensive features enabled. Just go and test webplayers at the first post in this thread on the machine you like. On HD3000 it works quite reasonable with PM, snow 8 layers (around 50-70fps @ 1366x768 fullscreen).

    ATB, Tom