Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- [❔ other question] How to fill a volume grid with sigma_t values corresponding to a certain material #498

Open
vucenovic opened this issue Sep 18, 2021 · 1 comment

Comments

@vucenovic
Copy link

Hello,

In your paper you showed a volume optimization using smoke. I was wondering if there is any code available showing how you setup the scene, especially the .vol file's data to correspond to the material of smoke. I am trying to recreate a similar setup, and have spectral data of my material available, which can be loaded into my scene with the tag like this: <spectrum name="sigma_t" filename="$matobj"/>, where $matobj is my filename. I would like to port this data to my volume grid.

@merlinND
Copy link
Member

Hello @vucenovic,

The smoke plume reference data comes from OpenVDB's sample volumes: https://www.openvdb.org/download/
It was then converted to Mitsuba's simple binary format using @dvicini's converter: https://github.com/mitsuba-renderer/mitsuba2-vdb-converter

If you are trying to supply 3D spectral data and rendering it in a volume, I believe you will need to extend the Grid3d plugin to support it. Currently, it can handle either 1 or 3 channels:

switch (m_metadata.channel_count) {
case 1:
result = m_raw ? (Object *) new Impl<1, true>(m_props, m_metadata, m_data, m_filter_type, m_wrap_mode)
: (Object *) new Impl<1, false>(m_props, m_metadata, m_data, m_filter_type, m_wrap_mode);
break;
case 3:
result = m_raw ? (Object *) new Impl<3, true>(m_props, m_metadata, m_data, m_filter_type, m_wrap_mode)
: (Object *) new Impl<3, false>(m_props, m_metadata, m_data, m_filter_type, m_wrap_mode);
break;
default:
Throw("Unsupported channel count: %d (expected 1 or 3)", m_metadata.channel_count);
}

You will probably need to achieve something like the regular or irregular spectrum plugins, depending on your spectral data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants