Skip to content

Conversation

@xoxor4d
Copy link
Contributor

@xoxor4d xoxor4d commented Oct 28, 2024

This small change allows the usage of the albedo texture to define the rayportal shape when creating a rayportal material via the remixApi.

Background:
The shape of the portal gets estimated if MaskTexture2 is unset.
This results in a perfect circle but that might not always be the desired shape.
In case of portal 2, I actually need square portals for room/area connecting portals that are placed within sliding doors or similar.
Using a blank white texture results in just that. Not setting an albedo means that the portal shape will be estimated just like before.

Note:
I think it might be beneficial to expose that setting to usd/toolkit. From what I can tell it's already hooked up in code .. just unused:

#define LIST_PORTAL_MATERIAL_TEXTURES(X) \
  /*Parameter Name, USD Token String,       Type,       UNUSED...   Default Value */ \
  X(MaskTexture,    emissive_mask_texture,  TextureRef, void, void, {}) \
  X(MaskTexture2,   unused_in_usd_so_dont,  TextureRef, void, void, {})

trackTexture(ctx, rayPortalMaterialData.getMaskTexture2(), maskTextureIndex2, hasTexcoords, false);

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

Successfully merging this pull request may close these issues.

1 participant