Trig Functions

Started by WAS, February 25, 2020, 01:42:15 PM

Previous topic - Next topic

WAS

Are the functions like tan/sin/cos true functions in this sense or are they approximated? If not, I was wondering if an approximate mode would help certain things speed up that done need exacting maths.

Matt

They call the math functions in the C runtime library. I have not experimented with faster approximations. I suspect that there is enough overhead in the use of blue nodes in general that it wouldn't really save you much time, but I'm not sure.  You could try using an image map shader and see if that's faster (but that also adds overhead so I doubt it will be).
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Alright. I was wondering cause I'm doing some experimenting in C++ and I came across a article in google scholar doc for C/C++ from a stack overflow topic reply advising someone to optimize their trig Functions in their ray tracer with approximations where appropriate. I'm not at home now and can't find the article searching Google scholar but I'll link it when I get home.

WAS

Didn't realize my Firefox is set to clear temp and history when I close it. But I found other references and it's basically saying for more primitive functions to use lookup tables where possible and approximation. Also found this while trying to find the same article

http://www.ue.eti.pg.gda.pl/~wrona/lab_dsp/cw04/fun_aprox.pdf