Multiple Normal Maps are not loading

Discussion and help for Easy Save 3
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Multiple Normal Maps are not loading

Post by Joel »

Hi there,

Because you're saving the entire texture by value, slowdown is expected as you're saving all of the pixel data for that texture. Saving the shared material will make no difference in this situation.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
xkinginthecastlex
Posts: 29
Joined: Thu Nov 08, 2018 6:07 pm

Re: Multiple Normal Maps are not loading

Post by xkinginthecastlex »

Hi Joel,

thank you very much for your support!

Regarding this issue..
When we do a development build and have Read/Write enabled on the textures (albedo and normal) and try to save a duplicated cube (each with runtime changed color) we are getting this error in the build:

UnloadTime: 0.633600 ms
System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_array_new_specific(intptr,int)
at System.IO.MemoryStream.set_Capacity (System.Int32 value) [0x00057] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.MemoryStream.EnsureCapacity (System.Int32 value) [0x00061] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000b3] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x0007e] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.StreamWriter.Write (System.Char value) [0x00014] in <9577ac7a62ef43179789031239ba8798>:0
at ES3Internal.ES3JSONReader.ReadOrSkipChar (System.IO.StreamWriter writer, System.Boolean skip) [0x00016] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3JSONReader.cs:309
at ES3Internal.ES3JSONReader.ReadString (System.IO.StreamWriter writer, System.Boolean skip) [0x00006] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3JSONReader.cs:205
at ES3Internal.ES3JSONReader.ReadElement (System.Boolean skip) [0x000e7] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3JSONReader.cs:273
at ES3Reader+ES3ReaderRawEnumerator+<GetEnumerator>d__2.MoveNext () [0x00064] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3Reader.cs:442
at ES3Writer.Merge (ES3Reader reader) [0x00060] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:462
at ES3Writer.Merge () [0x00018] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:452
at ES3Writer.Save (System.Boolean overwriteKeys) [0x00006] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:478
at ES3Writer.Save () [0x00001] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:470
at ES3.Save[T] (System.String key, T value, ES3Settings settings) [0x00035] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\ES3.cs:107
at ES3.Save[T] (System.String key, T value) [0x00001] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\ES3.cs:67
at ES3AutoSaveMgr.Save () [0x00256] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Auto Save\ES3AutoSaveMgr.cs:113
Uploading Crash Report
OutOfMemoryException: Out of memory
at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_array_new_specific(intptr,int)
at System.IO.MemoryStream.set_Capacity (System.Int32 value) [0x00057] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.MemoryStream.EnsureCapacity (System.Int32 value) [0x00061] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000b3] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x0007e] in <9577ac7a62ef43179789031239ba8798>:0
at System.IO.StreamWriter.Write (System.Char value) [0x00014] in <9577ac7a62ef43179789031239ba8798>:0
at ES3Internal.ES3JSONReader.ReadOrSkipChar (System.IO.StreamWriter writer, System.Boolean skip) [0x00016] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3JSONReader.cs:309
at ES3Internal.ES3JSONReader.ReadString (System.IO.StreamWriter writer, System.Boolean skip) [0x00006] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3JSONReader.cs:205
at ES3Internal.ES3JSONReader.ReadElement (System.Boolean skip) [0x000e7] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3JSONReader.cs:273
at ES3Reader+ES3ReaderRawEnumerator+<GetEnumerator>d__2.MoveNext () [0x00064] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Readers\ES3Reader.cs:442
at ES3Writer.Merge (ES3Reader reader) [0x00060] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:462
at ES3Writer.Merge () [0x00018] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:452
at ES3Writer.Save (System.Boolean overwriteKeys) [0x00006] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:478
at ES3Writer.Save () [0x00001] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Writers\ES3Writer.cs:470
at ES3.Save[T] (System.String key, T value, ES3Settings settings) [0x00035] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\ES3.cs:107
at ES3.Save[T] (System.String key, T value) [0x00001] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\ES3.cs:67
at ES3AutoSaveMgr.Save () [0x0028e] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\Easy Save 3\Scripts\Auto Save\ES3AutoSaveMgr.cs:120
at Crosstales.FB.Examples.SaveFile () [0x0005b] in F:\Unity-Projects\nt9\nt9\Assets\Plugins\crosstales\FileBrowser\Demo\Scripts\Examples.cs:139
at UnityEngine.Events.InvokableCall.Invoke () [0x00010] in <6dd3efba38804a24ab8b580750d44699>:0
at UnityEngine.Events.UnityEvent.Invoke () [0x00022] in <6dd3efba38804a24ab8b580750d44699>:0
at UnityEngine.UI.Button.Press () [0x00027] in F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Button.cs:68
at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00010] in F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Button.cs:110
at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00001] in F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:50
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x0006c] in F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:261
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:265)
UnityEngine.EventSystems.StandaloneInputModule:ReleaseMouse(PointerEventData, GameObject) (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:195)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData) (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:645)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32) (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:553)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent() (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:533)
UnityEngine.EventSystems.StandaloneInputModule:Process() (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:289)
UnityEngine.EventSystems.EventSystem:Update() (at F:\Unity-Versions\2019.4.18f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\EventSystem.cs:377)


The build completely freezes...
Do you know a way how to solve this issue?

I would very much appreciate if you could point us into the right direction what to do...

Many thanks
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Multiple Normal Maps are not loading

Post by Joel »

Hi there,

The error suggests that your application has exceeded it's allocated memory. Again, this is to be expected if you're trying to store particularly large Textures.

You might also want to consider using ES3.SaveImage and ES3.LoadImage instead, which will save the Textures in compressed format. However, be aware that in some cases the compression process will lead to slower performance.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
xkinginthecastlex
Posts: 29
Joined: Thu Nov 08, 2018 6:07 pm

Re: Multiple Normal Maps are not loading

Post by xkinginthecastlex »

Hi Joel,

the textures are 2048x2048 jpg´s ...
The performance is pretty much 0 currently as the build get´s frozen and we have to force-quit the build..

So is there an alternative solution which guarantees fast performance?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Multiple Normal Maps are not loading

Post by Joel »

Hi there,

As mentioned, ES3.SaveImage and ES3.LoadImage would be your only alternatives. If the bottleneck is the quantity of data being saved, this will be faster.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply