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

Fix, can't set material parameters on default material instance #854

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

bejado
Copy link
Member

@bejado bejado commented Feb 21, 2019

Setting material parameters on default material instances has no effect- i.e., the following:

MaterialInstance* instance = material->getDefaultInstance();
instance->setParameter("myParameter", RgbType::LINEAR, {1.0, 0.0, 0.0});

This happens with both float and sampler parameters. I'm a bit surprised this hasn't been discovered yet, so maybe I'm missing something.

Also, I think the UBO usage flag for the default material instance should match explicitly-created instances (DYNAMIC) unless we want the semantics that the default instance's parameters aren't meant to change...

@bejado bejado merged commit 803c922 into master Feb 21, 2019
@bejado bejado deleted the bjd/default-matinstance-fix branch February 21, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants