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

Mix material with a luminous material inside. #548

Open
g-step opened this issue Dec 22, 2022 · 4 comments
Open

Mix material with a luminous material inside. #548

g-step opened this issue Dec 22, 2022 · 4 comments

Comments

@g-step
Copy link

g-step commented Dec 22, 2022

Hi,

I am trying to build a mix material by combining two luminous materials. The mix material works flawlessly when I use standard materials, I can see them being mixed based on the texture assigned to "map_factor"  parameter. However, when I plug a luminous material into the mix the renderer throws an access violation exception.

Here is a sample:

ospray::cpp::Material lum1("pathtracer", "luminous");
lum1.setParam("intensity", 1.0f);
lum1.setParam("color", vec3f(0.0f, 1.0f, 0.0f));
lum1.commit();
ospray::cpp::Material lum2("pathtracer", "luminous");
lum2.setParam("intensity", 0.0f);
lum2.setParam("color", vec3f(0.0f, 0.0f, 1.0f));
lum2.commit();

ospray::cpp::Material mix("pathtracer", "mix");
mix.setParam("factor", 0.5f);
//mix.setParam("map_factor", mask_texture);
mix.setParam("material1", lum1);
mix.setParam("material2", lum2);
mix.commit();

Any ideas on how to make a partially luminous material?

@johguenther
Copy link
Contributor

Unfortunately support for Luminous in the MixMaterial is currently buggy. Actually, the whole MixMaterial is an unofficial feature (no documentation and also no testing).

It looks like you are mainly interested in texturing the emission. This will be slow with Mix in any case, we rather like to extend Lumious (and Principled) to directly support a texture for emission; a prototype exists, but finishing this will still take some time.

@johguenther
Copy link
Contributor

Texture support for Luminous comes with the next release.

@g-step
Copy link
Author

g-step commented Jan 9, 2024

Great news, thanks!

@johguenther
Copy link
Contributor

96e96d3 added texture support for Luminous and 9c3aa5e improved the Mix material regarding textured emission (though still not perfect).

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

No branches or pull requests

2 participants