MCPcopy Create free account
hub / github.com/RenderKit/embree / normal

Function normal

kernels/subdiv/gregory_patch.h:533–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531 }
532
533 static __forceinline Vertex normal(const Vertex matrix[4][4], const Vertex f_m[2][2], const float uu, const float vv) // FIXME: why not using basis functions
534 {
535 /* interpolate inner vertices */
536 Vertex_t matrix_11, matrix_12, matrix_22, matrix_21;
537 computeInnerVertices(matrix,f_m,uu,vv,matrix_11, matrix_12, matrix_22, matrix_21);
538
539 /* tangentU */
540 const Vertex_t col0 = deCasteljau(vv, (Vertex_t)matrix[0][0], (Vertex_t)matrix[1][0], (Vertex_t)matrix[2][0], (Vertex_t)matrix[3][0]);
541 const Vertex_t col1 = deCasteljau(vv, (Vertex_t)matrix[0][1], (Vertex_t)matrix_11 , (Vertex_t)matrix_21 , (Vertex_t)matrix[3][1]);
542 const Vertex_t col2 = deCasteljau(vv, (Vertex_t)matrix[0][2], (Vertex_t)matrix_12 , (Vertex_t)matrix_22 , (Vertex_t)matrix[3][2]);
543 const Vertex_t col3 = deCasteljau(vv, (Vertex_t)matrix[0][3], (Vertex_t)matrix[1][3], (Vertex_t)matrix[2][3], (Vertex_t)matrix[3][3]);
544
545 const Vertex_t tangentU = deCasteljau_tangent(uu, col0, col1, col2, col3);
546
547 /* tangentV */
548 const Vertex_t row0 = deCasteljau(uu, (Vertex_t)matrix[0][0], (Vertex_t)matrix[0][1], (Vertex_t)matrix[0][2], (Vertex_t)matrix[0][3]);
549 const Vertex_t row1 = deCasteljau(uu, (Vertex_t)matrix[1][0], (Vertex_t)matrix_11 , (Vertex_t)matrix_12 , (Vertex_t)matrix[1][3]);
550 const Vertex_t row2 = deCasteljau(uu, (Vertex_t)matrix[2][0], (Vertex_t)matrix_21 , (Vertex_t)matrix_22 , (Vertex_t)matrix[2][3]);
551 const Vertex_t row3 = deCasteljau(uu, (Vertex_t)matrix[3][0], (Vertex_t)matrix[3][1], (Vertex_t)matrix[3][2], (Vertex_t)matrix[3][3]);
552
553 const Vertex_t tangentV = deCasteljau_tangent(vv, row0, row1, row2, row3);
554
555 /* normal = tangentU x tangentV */
556 const Vertex_t n = cross(tangentU,tangentV);
557
558 return n;
559 }
560
561 __forceinline Vertex normal( const float uu, const float vv) const {
562 return normal(v,f,uu,vv);

Callers

nothing calls this directly

Calls 5

computeInnerVerticesFunction · 0.85
deCasteljauFunction · 0.85
deCasteljau_tangentFunction · 0.85
normal_tFunction · 0.85
crossFunction · 0.50

Tested by

no test coverage detected