Displacement mesh capture wish.

I am using blend materials with multiple displacements materials and many of those displacement maps are using tri planer projections.
What I need is a way to capture an optimized version of that render time displacement mesh so I can scatter particles on that displaced surface or use that surface for other simulations.

Andy

There is a .write_vrmesh property in the displacement modifier that acceps a proxy path out (f.e. “d:/myDisplacedPlane.vrmesh”).
Then you need to start a render, and the visible displaced geo with the property filled will be written to disk as proxy.

However, i am currently having issues with the output: it only writes an empty, if valid, proxy.
I’ve asked the devs and will be sure to report back as either a procedural mistake from my part or a bug will be found.

Eh? In Max there’s no write option…is this a Maya only thing then?
That would have been an immense boon to me on an ongoing thing…
I remember FinalRender having this option years ago so it must be possible I guess.

The option is UI-less (notice how i wrote it.), but as i mentioned it’s currently broken for me.
I’ll make sure to reshare the script to automate this as i find out why it’s not working.

Don’t think I understand that I’m afraid.
Do you maybe mean that whilst it’s not a visible option in the modifier, it works as a script?
I don’t delve into scripting so an explanation of how you get it to work (when it is working ofc) would be great please :slight_smile:

Actually I just found the relevant doc page.
Wouldn’t work for me sadly, as I’m using 2d displacement.

If the goal is to export the displacement, you can surely change the displacement mode to suit what’s needed.
In the end you’d get a proxy for rendering purposes (so no issue with building time or RAM usage), that you can convert (even only for the viewports, via modifiers) to an editable mesh.

Yeah I thought to change it to 3d just to get this to work, but the very same map which works perfectly in 2d will not displace using 3d…or rather it displaces upwards but remain flat though with the land clearly visible but obviously wrong. What could be wrong do you think?
It’s a terrain map, 32bit exr.

Send it over and I’ll check it out.

Texture is 2gb so a bit big to upload but the result is as attached.
If I stick it on a sphere it works just fine so it’s weird…


Here’s a small piece of the map Dropbox - Error - Simplify your life

The issue comes from the map being in raw format, with the max value at about 1800.0 float.
This has to be put into the right place in the modifier (Texmap Max, grayed out in 2d mode), and then a suitable scaled value for the displacement Amount (f.e. 0.05.).
Notice this is awkward as the min doesn’t change and so the offset values stay unscaled (f.e. -75.0).
On the right, i rescaled the map in the 0-1 range, saved it as “normalised” and re-plugged it.
This time “texmap max” stays at the default of 1.0, and displacement Amountn and Offset work as expected (100 and -80 respectively.).
The slightly different detail is due to a non-exact match of the total displacement height (lazy to do the maths. :slight_smile: It should match with an Amount of 90.9678589).

Brilliant @_Lele I knew you’d figure this out and thanks for doing so…you’re really adding to your ‘beers in’ tally for sure :slight_smile:

How are you normalising the values and maintaining detail?, as option b seems like the most sane approach.

I used nuke: i read the highest value (with a curvetool), and plugged it into the white level in a grade node.
It ought to be doable anywhere so long as you can read the max value in the image, and then divide the image channels by it.

Hmm…don’t have Nuke. What would be the process in PS e.g.?

In PS you’d likely have to (java)script it, i’d think.
I don’t know of any command able to retrieve the max value in an image.
Once that was done, you’d need to add a layer with that value of white (1800 or so in your case) and then set it to divide the image below.
I am unsure the ops would work in 32pobc, though, it’s really the wrong app for this stuff.
Maybe give Fusion a try?

I’ll get a trial of Nuke and see if I can figure it out…might be back here in a while when my brain begins to
react from an overexposure to maths :stuck_out_tongue:

Although of course the whole exercise may be moot unless there is a fix for the vrmesh output.

Luckily I do have the terrain all set up for the project using the 2d approach with the raw file, which also works perfectly well in World Machine, plus your info was still extremely useful in
clarifying a few things that will be of use.

Ahah, it’s a lot harder to describe, and read, than it is to perform.
It’s a scaling operation, think of it this way.

So far I got this input but on rendering get an error, which is unintelligible to me, so could relate to an error in how I set it up or some trial limitation.
How do the settings look to you?