Itoo Software Forum

Author Topic: Ram issue with VrayProxy and ForestPack  (Read 1645 times)

TB4709

  • Newbie
  • *
  • Posts: 3
Ram issue with VrayProxy and ForestPack
« on: April 17, 2023, 12:45:47 PM »
Hi,

We noticed an issue in the interaction between Forest Pack and Vrayproxies.

In a simple scene with trees scattered on a big plane with a basic noise we noticed a significant RAM increase when switching the Geometries to vrayproxies. More than 50gigs of RAM difference.

Here are two screens showing the issue, first one being with simple meshes and the second one being with vrayproxies.

we can also provide a scene file if needed. We're currently working on 3DS Max 2023, Vray 6 hotfix 2 et FP 7.4.3
« Last Edit: April 17, 2023, 12:50:13 PM by TB4709 »

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2447
Re: Ram issue with VrayProxy and ForestPack
« Reply #1 on: April 18, 2023, 12:10:22 PM »
Hi,

First let me mention, that generally, we suggest using poly or mesh models. Internally Forest converts all items to native instances of the render engine, so it's as efficient as using proxies. You can find a detailed technical explanation here. Also, using XRefs would be recommendable in many situations. Please feel free to check this "Best Workflow for a very large scene with Forest!" thread, where you can find some more tips for dealing with heavy objects/scenes. I hope you'll find it interesting.

I’ve done some quick tests with the latest Forest Pack 8.2.0 & V-Ray 6 Update 1.1, but I can‘t see such a big difference here. Please feel free to send us your scene (ideally simplified and containing just this problematic object(s)) to check it here. Ideally, if you'll be able to reproduce it on a minimal scene, which you can send us, it would be great. Thanks in advance.

Best regards,

TB4709

  • Newbie
  • *
  • Posts: 3
Re: Ram issue with VrayProxy and ForestPack
« Reply #2 on: April 18, 2023, 05:32:10 PM »
Hi,

thank you for the link but it doesn't help. We don't use Vrayproxies primarily for instances, but for not having to have every source as a mesh in the scene. Otherwise the max file can very quickly become very heavy. And if I'm not mistaken, xrefs wouldn't help in that case. Because even if the initial scene file becomes lighter, 3dsmax still has to load the scene when opening.

We tried with the latest version of FP and noticed exactly the same behaviour. If Forest Pack internaly converts meshes into instances, then I really think there is an issue with how it deals with vrayproxies.

We sent you a very simple scene on your mail, it's just a simple plane with some deformation and trees scattered on it. You can switch the Geometry sources between the Mesh layer and the Proxy layer. The difference is very obvious into the ram. Additionaly, after a render it freezes for a really long time.

Thanks

DBowker3D

  • Newbie
  • *
  • Posts: 11
Re: Ram issue with VrayProxy and ForestPack
« Reply #3 on: May 02, 2023, 05:03:49 PM »
I can confirm similar issues as well, and it took me awhile to realize that in terms of FP Pro, you just can't use VRAY Proxies as source objects without getting into trouble. For me it was that it crashed Max once I hit Render. Was it a RAM issue? Not sure; I have 128 GB of RAM but maybe that's what it was. Bottom line for me from now on is to not use VRay Proxies with FP.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Ram issue with VrayProxy and ForestPack
« Reply #4 on: May 03, 2023, 09:06:32 AM »
Hi,

We contacted with ChaosGroup regarding this issue. There are very technical details involved, but i will try to explain it:

The problem is the number of intersectable primitives generated in the scene. These primitives take memory and may slow the rendering process.
Basically the number of prmitives created in a scene is: number of instances * number of voxels of the geometry.
A voxel is a subdivision of the geometry, created to optimize the raytracing process.

When using meshes in Forest, it creates a single voxel per instance. Instead, for proxies the number of voxels is defined in the .vrmesh file, and cannot be changed.

In this scene, each proxy has 182 voxels. With about 360k items in the scene, that generates a lot of intersectable primitives, which causes the memory peaks.

As said in our previous posts, we suggest to use meshes with Forest. But if you want to use proxies, the workaround is to reduce the number of voxels in the proxy file.
It can be done using the following command:

ply2vrmesh.exe <source proxy> <target proxy> -mergeVoxels -facesPerVoxel 300000

You can find the ply2vrmesh.exe tool at C:\Program Files\Chaos Group\V-Ray\3ds Max 20NN\bin.

Doing that, the number of voxels in the .vrmesh is reduced from 182 voxels down to 14.
You should adjust the latest parameter (facesPerVoxel), depending of the number of faces in the geometry.

I did some tests:

- Forest using original proxy: 45 Gbytes RAM.
- ChaosScatter using original proxy: 45 Gbytes.
- Forest using reduced proxy: 7 Gbytes.

I've not tried ChaosScatter with the reduced proxy, but i guess the result will be similar to Forest.

Please note i don't know what is the method of V-Ray to define the number of voxels when creating a proxy, and what is the best workflow to optimize that.
Same for technical details regarding the rendering process. You should ask directly to ChaosGroup to get more information.

I hope that helps.

Update: this issue is solved checking 'Optimize for instancing', when you generate the proxy, as shown in the attached image.
If your proxies were not generated using this option, the only way is to reduce the number of voxels, using 'ply2vrmesh' as described above.
« Last Edit: June 28, 2023, 09:31:54 AM by iToo »
Carlos Quintero
iToo Software