-
Notifications
You must be signed in to change notification settings - Fork 203
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
EMSUSD-121 - Use display color when texture mode is disabled #3272
EMSUSD-121 - Use display color when texture mode is disabled #3272
Conversation
if (!_GetMaterialPrimvars(renderIndex, materialId, requiredPrimvars)) { | ||
// Only load textures when texture mode is selected | ||
if (!_GetMaterialPrimvars(renderIndex, materialId, requiredPrimvars) | ||
|| !(reprToken == HdReprTokens->smoothHull)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong. If your intention here is to choose sFallbackShaderPrimvars for untextured mode then you need to have something like: || (reprToken == HdReprTokens->smoothHullUntextured)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in case where hasColor is true below, we don't use fallback shader. So I guess this logic should be consistent
|| parameters.indexOf("diffuseColor") != -1 | ||
|| parameters.indexOf("color") != -1; | ||
// if not, use the fallback shader, which will use the display color | ||
if (!hasColor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we supposed to do if hasColor is true? Now we do nothing, but probably we should proceed into the normal material case.
@@ -21,6 +21,7 @@ | |||
#include "meshViewportCompute.h" | |||
#include "primvarInfo.h" | |||
|
|||
#include <mayaUsd/base/tokens.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this include can be in cpp file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good now. One tiny thing left: please move the "tokens.h" include into cpp. In general, the less includes we have in header files, the faster the compilation.
ogs -reset
. This command will be added to the user pref call as well, so the user can see the difference when toggle the optionVar