Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007575opensim[REGION] Script Functionspublic2015-05-16 14:072015-05-23 05:20
Assigned Tonebadon 
PlatformIntel Core i7Operating SystemUbuntuOperating System Version14.04
Product Versionmaster (dev code) 
Target VersionFixed in Versionmaster (dev code) 
Summary0007575: llCastRay V3 performance improved by mesh caching
DescriptionllCastRay V3 use much time and resources meshing prims, sculpts and mesh assets. This load can be reduced by caching and re-using meshes, using the same mesh cache physics is using.
Additional InformationMono 3.12.1
TagsNo tags attached.
Git Revision or version number0.8.2 dev
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux32
Mono VersionOther
ViewerSingularity 1.8.6 OS X
Attached Filespatch file icon 0001-Use-cached-meshes-in-llCastRay-V3-dysfunctional.patch [^] (14,787 bytes) 2015-05-16 14:07 [Show Content]
patch file icon 0001-Use-own-mesh-cache-in-llCastRay-V3.patch [^] (12,770 bytes) 2015-05-18 22:56 [Show Content]
patch file icon 0001-Use-own-mesh-cache-in-llCastRay-V3-after-throttling.patch [^] (14,324 bytes) 2015-05-19 11:47 [Show Content]

- Relationships
related to 0007546closednebadon llCastRay only partly implemented 
related to 0007568closednebadon llCastRay V3 needs throttling 
related to 0007587closednebadon llCastRay V3 suffers mesh cache race condition 

-  Notes
Magnuz (reporter)
2015-05-16 14:08

DON'T APPLY THIS DYSFUNCTIONAL PATCH 0001-Use-cached-meshes-in-llCastRay-V3-dysfunctional.patch

Patch attempting to use cached meshes in llCastRay V3. Thanks to dahlia making the physics mesh cache available for this.

The first time a new shape, sculpt or mesh is encountered, the overhead of processing and caching it is 40-50% higher than without caching, on both a high-end server and an ordinary laptop in my performance tests. However, on renewed encounters, the caching saves about 55-60% call time on a high-end server and 60-70% on an ordinary laptop.

This first, dysfunctional version do prims right, but appears to get corrupt data when trying to mesh sculpts and meshes from assets. The error is probably at line 14176:
shape.SculptData = World.AssetService.GetData(shape.SculptTexture.ToString());
I'm lost at how to load and use the assets in a correct way though, so any suggestions are welcome. The other possibility is a bug in the mesher used, but I can't find anything obvious in the code so I find that less likely.
Magnuz (reporter)
2015-05-18 22:58

The new patch 0001-Use-own-mesh-cache-in-llCastRay-V3.patch is fully functional. It sets up an own mesh cache optimized for llCastRay V3 and uses libopenmetaverse mesher instead of Meshmerizer. It works fully with sculpts and meshes again, eliminates the 40-50% overhead on first encounter with a shape, sculpt or mesh, increases the time save when using cached geometries to about 65% on a high-end server and 75% on an ordinary laptop in my performance tests.

Since the physics mesh cache isn't populated by BulletSim and llCastRay V3 stores and uses geometries without scaling and rotation, it's really not much use to use the un-optimized physics mesh cache in particular for llCastRay V3.

This patch also includes a minor fix where calculation errors sometimes made hits fall outside triangle bounding boxes and be discarded, especially when triangle planes are parallel with the local XY, XZ or YZ plane. To deal with this, error tolerances were increased by a factor of 10. (Old tolerance 0.000001, actual calculation error 0.000003-0.000004, new tolerance 0.00001.)
Magnuz (reporter)
2015-05-19 10:58

The patch 0001-Use-own-mesh-cache-in-llCastRay-V3.patch won't apply after the patch 0001-Throttle-llCastRay-V3.patch from Mantis 7568.

The new patch 0001-Use-own-mesh-cache-in-llCastRay-V3-after-throttling.patch will apply after the patch 0001-Throttle-llCastRay-V3.patch from Mantis 7568. It also makes the caching optional by configuration, since the caching increases memory usage, which may be undesirable in some situations.
nebadon (administrator)
2015-05-21 22:49

patch applied : [^]
Magnuz (reporter)
2015-05-22 14:34

Verified code and function, so closing.

- Issue History
Date Modified Username Field Change
2015-05-16 14:07 Magnuz New Issue
2015-05-16 14:07 Magnuz File Added: 0001-Use-cached-meshes-in-llCastRay-V3-dysfunctional.patch
2015-05-16 14:08 Magnuz Note Added: 0028385
2015-05-16 14:08 Magnuz Status new => patch included
2015-05-16 14:09 Magnuz Relationship added related to 0007546
2015-05-16 14:09 Magnuz Relationship added related to 0007568
2015-05-18 22:56 Magnuz File Added: 0001-Use-own-mesh-cache-in-llCastRay-V3.patch
2015-05-18 22:58 Magnuz Note Added: 0028399
2015-05-19 10:53 Magnuz File Added: 0001-Use-own-mesh-cache-in-llCastRay-V3-after-throttling.patch
2015-05-19 10:58 Magnuz Note Added: 0028401
2015-05-19 11:47 Magnuz File Deleted: 0001-Use-own-mesh-cache-in-llCastRay-V3-after-throttling.patch
2015-05-19 11:47 Magnuz File Added: 0001-Use-own-mesh-cache-in-llCastRay-V3-after-throttling.patch
2015-05-21 22:49 nebadon Note Added: 0028422
2015-05-21 22:49 nebadon Status patch included => resolved
2015-05-21 22:49 nebadon Resolution open => fixed
2015-05-21 22:49 nebadon Assigned To => nebadon
2015-05-22 14:34 Magnuz Note Added: 0028435
2015-05-22 14:34 Magnuz Status resolved => closed
2015-05-22 14:34 Magnuz Fixed in Version => master (dev code)
2015-05-23 05:20 Magnuz Relationship added related to 0007587

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker