一段时间以来,我一直在编写 GLSL 光线跟踪,并且做了一些改进,但是自从查看天以来,我认为光线跟踪曲面而不是许多三角形会快得多,所以我遇到了 NURBS。如果我写下方程式(扩展 --> 仅 +、-、*、/、sqrt 和平方),我看不到任何方法来获得与射线的交点。
你们中有人知道如何对 2 级 NURBS 进行光线追踪吗?
This is my equation (no real NURBS equation):
given :
(A to I are 3d vectors)
A
B
C
D
E
F
G
H
I
a = 2(B-A)
b = 2B-A-C
c = 2(E-D)
d = 2E-D-F
e = 2(H-G)
f = 2H-G-I
(a to f are defined to have the equation a bit shorter later)
o
r
(o and r are 3d vectors again)
searched :
u, v (, t)
to solve :
(A+au-bu²) + ((D+cu-du²)-(A+au+bu²))2v - (2(D+cu-bu²)-(A+au-bu²)-(G+eu-fu²))v² = o+rt
(NURB) = (LINE)