I’m still interested in the jacobian matrix route though. That way, I can precompute the matrix coefficients beforehand, which should speed things up quite a bit, since I’ll just be running the parametric formula once, then applying a matrix multiply to create the new normal. I may have to seek advice from a mathematical genius on how to actually work out the coefficients though…
Yeah, I think, jacobian matrices are the only robust solution. This is not that hard, I mean for your purpose.
The GPU Gems link I gave before is very clear IMO, read it carefully, especially examples, a come back with questions about what you don’t understand.
Thanks for the advice guys. I will look into the jacobian matrix route then.
Actually, I think this document
contains both the parametric formulae and the partial derivatives for some of the surfaces I’ve been working with.
So, to get the coefficients I’d take a value of 1.0 for U and V and work out the result of each derivative formula to give the coefficients for a 3x2 matrix that can be applied to every vertex? And, just to recap, I can use the same matrix for every vertex, so I can calculate the coefficients outside the shade?
Sorry for being a bit dense…
The matrix needs to be evaluated at each vertex, so it will necessarily not be the same. You will basically end up with a huge buffer of per-vertex matrices, which is not very efficient.
I think you would be better off using the analytical derivatives in the shader itself, or just completing the process and computing the actual normals on the CPU and just passing those to the shader.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.