I don't see anything on a sqrt() in the arg fragment program? Is this correct? I also don't see anything for division? I am assuming this because divison is slower than multiplying? So what do you suggest I use in place of the divison? Basically this is what I am trying to do in my fragment program....
nx = 2*r-1;
ny = 2*g-1;
nz = 2*b-1
d = sqrt(nx*nx + ny*ny + nz*nz);
nx /=d;
ny /=d;
nz /=d;
r = (nx + 1)/2;
g = (ny + 1)/2;
b = (nz + 1)/2;
I am having to do a lot of explicit calls in my fragment program which seems stupid? In GLSlang the above code would be close to what I would do or not? due to its like C syntax?
This what I am doing currently in my fragment program and seems like there is a more effecient way to do it...
MUL nx, two, normalmap.r;
MUL ny, two, normalmap.g;
MUL nz, two, normalmap.b;
SUB nx, nx, 1;
SUB ny, ny, 1;
SUB nz, nz, 1;
#sqrt here?