Jump to content

GeNa Terrain extension not covering road surface


mroshaw
Go to solution Solved by Manny,

Recommended Posts

Hi!

 

I have a Road Spline across my game map. I'm using the GeNa Terrain Extension, "Texture", to apply a sandy track texture, with the intention of having a path for the player to follow.

 

When I go to apply the Terrain extension, I get a weird, very patchy preview of the impact of the operation:

 

image.thumb.png.4d3bec06808b809977cb4671ef71b800.png

 

And of course when I go to apply the texture, it's only effecting those blotchy areas.

 

How can I get the terrain texture to apply to the entire road surface?

 

I'm using Unity 2013.3.17f1 and GeNa 3.4.2.

 

Many thanks!

 

 

Link to comment
Share on other sites

I've updated to 3.4.4 and that's fixed the issue.

 

The effected area seems to be significantly offset from the actual spline, though:

 

image.thumb.png.57c29ab1bf4b687a7758748f3649357c.png

 

See how it's shifted / weighted towards the right hand side of the spline?

 

What can I do to get it in the middle?

 

Thanks!

Link to comment
Share on other sites

I've now completely broken it, somehow, and when I click on the Texture extension I get a load of errors in the console:

MissingReferenceException: The object of type 'RenderTexture' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
GeNa.Core.GeNaMultiTerrainOperation.Visualize (GeNa.Core.MultiTerrainOperationType opType, UnityEngine.RenderTexture previewTexture, System.Int32 pass) (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.TerrainTools.Visualize (GeNa.Core.TerrainEntity modification) (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.GeNaTerrainExtension.Visualize () (at Assets/Procedural Worlds/GeNa/Scripts/Runtime/Extensions/GeNaTerrainExtension.cs:128)
GeNa.Core.GeNaTerrainExtension.OnSceneGUI () (at Assets/Procedural Worlds/GeNa/Scripts/Runtime/Extensions/GeNaTerrainExtension.cs:90)
GeNa.Core.GeNaSplineExtension.SceneGUI () (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.GeNaSpline.OnSceneGUI () (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.SplineEditor.OnSceneGUI () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/SplineEditor.cs:157)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <75633565436c42f0a6426b33f0132ade>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <75633565436c42f0a6426b33f0132ade>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <75633565436c42f0a6426b33f0132ade>:0)
UnityEditor.SceneView.CallOnSceneGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEditor.SceneView.DoOnGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEditor.SceneView.OnSceneGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7f21349c9161407ba80a85ddaed7fabb>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

 

Link to comment
Share on other sites

7 hours ago, mroshaw said:

I've now completely broken it, somehow, and when I click on the Texture extension I get a load of errors in the console:

MissingReferenceException: The object of type 'RenderTexture' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
GeNa.Core.GeNaMultiTerrainOperation.Visualize (GeNa.Core.MultiTerrainOperationType opType, UnityEngine.RenderTexture previewTexture, System.Int32 pass) (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.TerrainTools.Visualize (GeNa.Core.TerrainEntity modification) (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.GeNaTerrainExtension.Visualize () (at Assets/Procedural Worlds/GeNa/Scripts/Runtime/Extensions/GeNaTerrainExtension.cs:128)
GeNa.Core.GeNaTerrainExtension.OnSceneGUI () (at Assets/Procedural Worlds/GeNa/Scripts/Runtime/Extensions/GeNaTerrainExtension.cs:90)
GeNa.Core.GeNaSplineExtension.SceneGUI () (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.GeNaSpline.OnSceneGUI () (at <d8b988bb8faf49d2833eb3204321e491>:0)
GeNa.Core.SplineEditor.OnSceneGUI () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/SplineEditor.cs:157)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <75633565436c42f0a6426b33f0132ade>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <75633565436c42f0a6426b33f0132ade>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <75633565436c42f0a6426b33f0132ade>:0)
UnityEditor.SceneView.CallOnSceneGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEditor.SceneView.DoOnGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEditor.SceneView.OnSceneGUI () (at <434908727417408abd02bbd1a0835ef8>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7f21349c9161407ba80a85ddaed7fabb>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

 

I was going to say about your prior responses that it is a known issue and it has been resolved in later versions. 

However, the fact that you are getting spline data that's offset and experiencing errors are a major cause for concern. I'll run a few tests today and get back to you.

Link to comment
Share on other sites

  • Solution

Okay @mroshaw,

 

After a deep investigation, it appears that you have found a really nice edge case. Internally, I was trying to determine the appropriate resolution of the terrain depending on which mode is selected. You'd notice this if you switch between modes in the TerrainExtension. I found a little while ago that I needed to apply an offset of 1 texel in order to account for Unity's weird scaling issue. However, I just noticed that this is not necessary when using 'alphamapResolution' hense why ONLY the Texture mode was producing incorrect results.

Happy to inform that I fixed this issue and it will be introduced in a new version (hopefully released by today).

image.png

Link to comment
Share on other sites

That's amazing Manny, thank you! 

 

I seem to be the master of the edge case! Maybe I should get a job in testing?! 

 

I'll download and test the new version over the weekend. Thank you again! 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...