Skip to content

Primitive 3d custom tangents #17691

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hukasu
Copy link
Contributor

@hukasu hukasu commented Feb 5, 2025

Objective

Anisotropy requires tangents, and the current method of building tangents depends on UVs, which causes seams on most of the primitive shapes. But most of the primitive shapes have simple methods of calculating tangents that do not require the UVs.

Solution

Create custom calculation of the tangent for some of the 3d primitives.

Testing

Add custom primitives to the anisotropy example.

Showcase

Sphere with custom tangent calculation in the anisotropy example
Screencast_20250205_110935.webm

Migration Guide

This PR requires #17690

@alice-i-cecile alice-i-cecile added S-Blocked This cannot move forward until something else changes C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Math Fundamental domain-agnostic mathematical operations labels Feb 5, 2025
@hukasu
Copy link
Contributor Author

hukasu commented Feb 5, 2025

The calculation that i'm doing is incredibly naive, it is just doing the cross product between the normal and an axis, but doing the cross product between 2 colinear vectors results in zero, what would be the best solution for this?

Sphere
Screenshot_20250205_202947

Capsule
Screenshot_20250205_202721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Blocked This cannot move forward until something else changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants