Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ComputeTangentFrameEx

Aperta
#1 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

Inizia esaminando il comportamento esistente di ComputeNormals e ComputeTangentFrame, quindi confronta l’API e le soglie richieste con D3DXComputeTangentFrameEx. L’algoritmo per i gruppi di singolarità e l’ambito moderno sono ancora da decidere in questa issue; il completamento fornirebbe almeno una variante con suddivisione dei vertici che gestisca le giunzioni speculari.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

proposal

The basic ComputeNormals and ComputeTangentFrame do not perform any vertex splits, so artifacts can be found on large angle changes.

An alternative version is needed which would be able to duplicate vertices to resolve these problems.

enum CTF_FLAGS
{
   CTF_DEFAULT = 0x0,
       // Default is to compute normals using weight-by-angle

    CTF_WEIGHT_BY_AREA = 0x1,
        // Computes normals using weight-by-area

    CTF_WEIGHT_EQUAL = 0x2,
        // Compute normals with equal weights

    CTF_WIND_CW = 0x4,
        // Vertices are clock-wise (defaults to CCW)

    CTF_DONT_ORTHOGONALIZE = 0x10,
    CTF_ORTHOGONALIZE_FROM_U = 0x20,
    CTF_ORTHOGONALIZE_FROM_V = 0x40,

    CTF_DONT_NORMALIZE_PARTIALS = 0x80,

    CTF_WRAP_U = 0x100,
    CTF_WRAP_V = 0x200,
    CTF_WRAP_UV = 0x300,
};

struct CTFVertex
{
    uint32_t vertex; // index of the 'original' vertex
    XMFLOAT3 normal;
    XMFLOAT4 tangent; // .w is handedness
    XMFLOAT3 bitangent;
};

HRESULT ComputeTangentFrameEx(
   _In_reads_(nFaces*3) const uint16_t* indices, _In_ size_t nFaces,
   _In_reads_(nVerts) const XMFLOAT3* positions,
   _In_reads_(nVerts) const XMFLOAT2* txtcoords, _In_ size_t nVerts, 
   _In_reads_(nFaces*3) const uint32_t* adjacency,
   _In_ DWORD flags,
   _In_ float partialEdgeThreshold,
   _In_ float singularPointThreshold,
   _In_ float normalEdgeThreshold,
   _Inout_ std::vector<CTFVertex>& frames, _Out_ size_t& nDupVerts );

HRESULT ComputeTangentFrameEx(
   _In_reads_(nFaces*3) const uint32_t* indices, _In_ size_t nFaces,
   _In_reads_(nVerts) const XMFLOAT3* positions,
   _In_reads_(nVerts) const XMFLOAT2* txtcoords, _In_ size_t nVerts, 
   _In_reads_(nFaces*3) const uint32_t* adjacency,
   _In_ DWORD flags,
   _In_ float partialEdgeThreshold,
   _In_ float singularPointThreshold,
   _In_ float normalEdgeThreshold,
   _Inout_ std::vector<CTFVertex>& frames, _Out_ size_t& nDupVerts );

The D3DXComputeTangentFrameEx function supported vertex splitting based on various thresholds.

The real question is if anyone needs the full original D3DX9 algorithm with all it's complex 'singularity group' handling, or if the current functionality is sufficient for modern needs.

At a minimum, there needs to be a duplicate vertices version to handle mirrored seams...

Lingua principale
C++
Stelle
859
Fork
169
Merge medio
1g 9h
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/DirectXMesh

Tutte le issue di microsoft/DirectXMesh

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.