Spherical Harmonics compute optimization #419
Labels
low priority
Low priority issue
performance
Performance-related features
Rendering
Rendering related functions
Milestone
Our Spherical Harmonics compute in Shader can optimization.
We can check this :http://www.fractalforums.com/programming/shader-function-or-instruction-cost-(performance)/
How to say: many engine get irradiance use the func like this:
mediump vec3 shEvalLinearL0L1(mediump vec4 normal)
{
mediump vec3 x;
// Linear (L1) + constant (L0) polynomial terms
x.r = dot(u_AmbientSHAr, normal);
x.g = dot(u_AmbientSHAg, normal);
x.b = dot(u_AmbientSHAb, normal);
return x;
}
Because dot cost only 3 cycles in GPU, so is faster, If you do this you must do some modifies before Incoming shader.
The text was updated successfully, but these errors were encountered: