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

MAYA-111691 cards draw mode #1463

Merged
merged 6 commits into from
Jun 11, 2021
Merged

Conversation

williamkrick
Copy link
Contributor

Add support to Vp2RenderDelegate for the "cards" drawing mode.

Issue #1382.

I'll add a test using either the file from the issue or I'll create some programmer art.

stReader.parameters[_tokens->varname] = _tokens->cardsUv;
outNet.nodes.push_back(stReader);
stPrimvarReader = &outNet.nodes.back();
outNet.primvars.push_back(_tokens->cardsUv);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only correct for the cards draw mode shader. I will have to think of a way to make this safe.

if (bufferData) {
const VtIntArray& primvarData = value.UncheckedGet<VtIntArray>();

VtFloatArray convertedPrimvarData;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this because we can't properly create vertex buffers for integer types.

@kxl-adsk kxl-adsk linked an issue Jun 4, 2021 that may be closed by this pull request
@williamkrick williamkrick added the vp2renderdelegate Related to VP2RenderDelegate label Jun 4, 2021
(UsdPrimvarReader_color)
(UsdPrimvarReader_vector)
);
// clang-format on

TfToken _DrawModeCards
= TfToken("drawMode.glslfx"); //!< can't make a token the normal way because it has a '.' in it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a syntax for that in the tokens. You need to use:

    ((drawMode, "drawMode.glslfx"))

// To use it:
_tokens->drawMode

@@ -837,6 +863,15 @@ void HdVP2Material::_ApplyVP2Fixes(HdMaterialNetwork& outNet, const HdMaterialNe
tmpNet.nodes.reserve(numNodes);
tmpNet.relationships.reserve(numRelationships);

// Some material networks require us to nodes and connections to the base
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a verb missing in that sentence.

@williamkrick
Copy link
Contributor Author

This should be ready to merge tomorrow once the preflight issues get resolved.

@williamkrick williamkrick added the ready-for-merge Development process is finished, PR is ready for merge label Jun 11, 2021
@kxl-adsk kxl-adsk merged commit c53d3ed into dev Jun 11, 2021
@kxl-adsk kxl-adsk deleted the krickw/MAYA-111691/cards_draw_mode branch June 11, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MAYA-111691] Support for card drawMode with textures in Viewport2.0
4 participants