2012-12-15 10:18:42 +00:00
|
|
|
/*
|
|
|
|
|
* Adapted from Open Shading Language with this license:
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al.
|
|
|
|
|
* All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Modifications Copyright 2011, Blender Foundation.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
|
* met:
|
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
|
* * Neither the name of Sony Pictures Imageworks nor the names of its
|
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
#pragma once
|
2012-12-15 10:18:42 +00:00
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
2014-05-05 02:19:08 +10:00
|
|
|
ccl_device float fresnel_dielectric(float eta,
|
|
|
|
|
const float3 N,
|
|
|
|
|
const float3 I,
|
Cycles: Kernel address space changes for MSL
This is the first of a sequence of changes to support compiling Cycles kernels as MSL (Metal Shading Language) in preparation for a Metal GPU device implementation.
MSL requires that all pointer types be declared with explicit address space attributes (device, thread, etc...). There is already precedent for this with Cycles' address space macros (ccl_global, ccl_private, etc...), therefore the first step of MSL-enablement is to apply these consistently. Line-for-line this represents the largest change required to enable MSL. Applying this change first will simplify future patches as well as offering the emergent benefit of enhanced descriptiveness.
The vast majority of deltas in this patch fall into one of two cases:
- Ensuring ccl_private is specified for thread-local pointer types
- Ensuring ccl_global is specified for device-wide pointer types
Additionally, the ccl_addr_space qualifier can be removed. Prior to Cycles X, ccl_addr_space was used as a context-dependent address space qualifier, but now it is either redundant (e.g. in struct typedefs), or can be replaced by ccl_global in the case of pointer types. Associated function variants (e.g. lcg_step_float_addrspace) are also redundant.
In cases where address space qualifiers are chained with "const", this patch places the address space qualifier first. The rationale for this is that the choice of address space is likely to have the greater impact on runtime performance and overall architecture.
The final part of this patch is the addition of a metal/compat.h header. This is partially complete and will be extended in future patches, paving the way for the full Metal implementation.
Ref T92212
Reviewed By: brecht
Maniphest Tasks: T92212
Differential Revision: https://developer.blender.org/D12864
2021-10-14 13:53:40 +01:00
|
|
|
ccl_private float3 *R,
|
|
|
|
|
ccl_private float3 *T,
|
2012-12-15 10:18:42 +00:00
|
|
|
#ifdef __RAY_DIFFERENTIALS__
|
2014-05-05 02:19:08 +10:00
|
|
|
const float3 dIdx,
|
|
|
|
|
const float3 dIdy,
|
Cycles: Kernel address space changes for MSL
This is the first of a sequence of changes to support compiling Cycles kernels as MSL (Metal Shading Language) in preparation for a Metal GPU device implementation.
MSL requires that all pointer types be declared with explicit address space attributes (device, thread, etc...). There is already precedent for this with Cycles' address space macros (ccl_global, ccl_private, etc...), therefore the first step of MSL-enablement is to apply these consistently. Line-for-line this represents the largest change required to enable MSL. Applying this change first will simplify future patches as well as offering the emergent benefit of enhanced descriptiveness.
The vast majority of deltas in this patch fall into one of two cases:
- Ensuring ccl_private is specified for thread-local pointer types
- Ensuring ccl_global is specified for device-wide pointer types
Additionally, the ccl_addr_space qualifier can be removed. Prior to Cycles X, ccl_addr_space was used as a context-dependent address space qualifier, but now it is either redundant (e.g. in struct typedefs), or can be replaced by ccl_global in the case of pointer types. Associated function variants (e.g. lcg_step_float_addrspace) are also redundant.
In cases where address space qualifiers are chained with "const", this patch places the address space qualifier first. The rationale for this is that the choice of address space is likely to have the greater impact on runtime performance and overall architecture.
The final part of this patch is the addition of a metal/compat.h header. This is partially complete and will be extended in future patches, paving the way for the full Metal implementation.
Ref T92212
Reviewed By: brecht
Maniphest Tasks: T92212
Differential Revision: https://developer.blender.org/D12864
2021-10-14 13:53:40 +01:00
|
|
|
ccl_private float3 *dRdx,
|
|
|
|
|
ccl_private float3 *dRdy,
|
|
|
|
|
ccl_private float3 *dTdx,
|
|
|
|
|
ccl_private float3 *dTdy,
|
2012-12-15 10:18:42 +00:00
|
|
|
#endif
|
Cycles: Kernel address space changes for MSL
This is the first of a sequence of changes to support compiling Cycles kernels as MSL (Metal Shading Language) in preparation for a Metal GPU device implementation.
MSL requires that all pointer types be declared with explicit address space attributes (device, thread, etc...). There is already precedent for this with Cycles' address space macros (ccl_global, ccl_private, etc...), therefore the first step of MSL-enablement is to apply these consistently. Line-for-line this represents the largest change required to enable MSL. Applying this change first will simplify future patches as well as offering the emergent benefit of enhanced descriptiveness.
The vast majority of deltas in this patch fall into one of two cases:
- Ensuring ccl_private is specified for thread-local pointer types
- Ensuring ccl_global is specified for device-wide pointer types
Additionally, the ccl_addr_space qualifier can be removed. Prior to Cycles X, ccl_addr_space was used as a context-dependent address space qualifier, but now it is either redundant (e.g. in struct typedefs), or can be replaced by ccl_global in the case of pointer types. Associated function variants (e.g. lcg_step_float_addrspace) are also redundant.
In cases where address space qualifiers are chained with "const", this patch places the address space qualifier first. The rationale for this is that the choice of address space is likely to have the greater impact on runtime performance and overall architecture.
The final part of this patch is the addition of a metal/compat.h header. This is partially complete and will be extended in future patches, paving the way for the full Metal implementation.
Ref T92212
Reviewed By: brecht
Maniphest Tasks: T92212
Differential Revision: https://developer.blender.org/D12864
2021-10-14 13:53:40 +01:00
|
|
|
ccl_private bool *is_inside)
|
2012-12-15 10:18:42 +00:00
|
|
|
{
|
|
|
|
|
float cos = dot(N, I), neta;
|
|
|
|
|
float3 Nn;
|
2013-05-26 22:34:45 +00:00
|
|
|
|
2012-12-15 10:18:42 +00:00
|
|
|
// check which side of the surface we are on
|
|
|
|
|
if (cos > 0) {
|
|
|
|
|
// we are on the outside of the surface, going in
|
|
|
|
|
neta = 1 / eta;
|
|
|
|
|
Nn = N;
|
|
|
|
|
*is_inside = false;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2013-05-26 22:34:45 +00:00
|
|
|
// we are inside the surface
|
2012-12-15 10:18:42 +00:00
|
|
|
cos = -cos;
|
|
|
|
|
neta = eta;
|
|
|
|
|
Nn = -N;
|
|
|
|
|
*is_inside = true;
|
|
|
|
|
}
|
2018-07-06 10:17:58 +02:00
|
|
|
|
2013-05-26 22:34:45 +00:00
|
|
|
// compute reflection
|
2012-12-15 10:18:42 +00:00
|
|
|
*R = (2 * cos) * Nn - I;
|
2013-05-26 22:34:45 +00:00
|
|
|
#ifdef __RAY_DIFFERENTIALS__
|
|
|
|
|
*dRdx = (2 * dot(Nn, dIdx)) * Nn - dIdx;
|
|
|
|
|
*dRdy = (2 * dot(Nn, dIdy)) * Nn - dIdy;
|
|
|
|
|
#endif
|
2018-07-06 10:17:58 +02:00
|
|
|
|
2012-12-15 10:18:42 +00:00
|
|
|
float arg = 1 - (neta * neta * (1 - (cos * cos)));
|
|
|
|
|
if (arg < 0) {
|
|
|
|
|
*T = make_float3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
#ifdef __RAY_DIFFERENTIALS__
|
|
|
|
|
*dTdx = make_float3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
*dTdy = make_float3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
#endif
|
|
|
|
|
return 1; // total internal reflection
|
|
|
|
|
}
|
|
|
|
|
else {
|
2016-07-16 20:48:12 +02:00
|
|
|
float dnp = max(sqrtf(arg), 1e-7f);
|
2012-12-15 10:18:42 +00:00
|
|
|
float nK = (neta * cos) - dnp;
|
|
|
|
|
*T = -(neta * I) + (nK * Nn);
|
|
|
|
|
#ifdef __RAY_DIFFERENTIALS__
|
|
|
|
|
*dTdx = -(neta * dIdx) + ((neta - neta * neta * cos / dnp) * dot(dIdx, Nn)) * Nn;
|
|
|
|
|
*dTdy = -(neta * dIdy) + ((neta - neta * neta * cos / dnp) * dot(dIdy, Nn)) * Nn;
|
|
|
|
|
#endif
|
|
|
|
|
// compute Fresnel terms
|
|
|
|
|
float cosTheta1 = cos; // N.R
|
|
|
|
|
float cosTheta2 = -dot(Nn, *T);
|
|
|
|
|
float pPara = (cosTheta1 - eta * cosTheta2) / (cosTheta1 + eta * cosTheta2);
|
|
|
|
|
float pPerp = (eta * cosTheta1 - cosTheta2) / (eta * cosTheta1 + cosTheta2);
|
|
|
|
|
return 0.5f * (pPara * pPara + pPerp * pPerp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-16 00:17:10 +01:00
|
|
|
ccl_device float fresnel_dielectric_cos(float cosi, float eta)
|
2012-12-15 10:18:42 +00:00
|
|
|
{
|
|
|
|
|
// compute fresnel reflectance without explicitly computing
|
|
|
|
|
// the refracted direction
|
|
|
|
|
float c = fabsf(cosi);
|
|
|
|
|
float g = eta * eta - 1 + c * c;
|
|
|
|
|
if (g > 0) {
|
|
|
|
|
g = sqrtf(g);
|
|
|
|
|
float A = (g - c) / (g + c);
|
|
|
|
|
float B = (c * (g + c) - 1) / (c * (g - c) + 1);
|
|
|
|
|
return 0.5f * A * A * (1 + B * B);
|
|
|
|
|
}
|
|
|
|
|
return 1.0f; // TIR(no refracted component)
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-07 18:28:59 +02:00
|
|
|
ccl_device float3 fresnel_conductor(float cosi, const float3 eta, const float3 k)
|
2012-12-15 10:18:42 +00:00
|
|
|
{
|
Cycles: Add multi-scattering, energy-conserving GGX as an option to the Glossy, Anisotropic and Glass BSDFs
This commit adds a new distribution to the Glossy, Anisotropic and Glass BSDFs that implements the
multiple-scattering microfacet model described in the paper "Multiple-Scattering Microfacet BSDFs with the Smith Model".
Essentially, the improvement is that unlike classical GGX, which only models single scattering and assumes
the contribution of multiple bounces to be zero, this new model performs a random walk on the microsurface until
the ray leaves it again, which ensures perfect energy conservation.
In practise, this means that the "darkening problem" - GGX materials becoming darker with increasing
roughness - is solved in a physically correct and efficient way.
The downside of this model is that it has no (known) analytic expression for evalation. However, it can be
evaluated stochastically, and although the correct PDF isn't known either, the properties of MIS and the
balance heuristic guarantee an unbiased result at the cost of slightly higher noise.
Reviewers: dingto, #cycles, brecht
Reviewed By: dingto, #cycles, brecht
Subscribers: bliblubli, ace_dragon, gregzaal, brecht, harvester, dingto, marcog, swerner, jtheninja, Blendify, nutel
Differential Revision: https://developer.blender.org/D2002
2016-06-23 22:56:43 +02:00
|
|
|
float3 cosi2 = make_float3(cosi * cosi, cosi * cosi, cosi * cosi);
|
2014-09-07 18:28:59 +02:00
|
|
|
float3 one = make_float3(1.0f, 1.0f, 1.0f);
|
|
|
|
|
float3 tmp_f = eta * eta + k * k;
|
|
|
|
|
float3 tmp = tmp_f * cosi2;
|
|
|
|
|
float3 Rparl2 = (tmp - (2.0f * eta * cosi) + one) / (tmp + (2.0f * eta * cosi) + one);
|
|
|
|
|
float3 Rperp2 = (tmp_f - (2.0f * eta * cosi) + cosi2) / (tmp_f + (2.0f * eta * cosi) + cosi2);
|
2012-12-15 10:18:42 +00:00
|
|
|
return (Rparl2 + Rperp2) * 0.5f;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-18 11:43:09 +02:00
|
|
|
ccl_device float schlick_fresnel(float u)
|
|
|
|
|
{
|
|
|
|
|
float m = clamp(1.0f - u, 0.0f, 1.0f);
|
|
|
|
|
float m2 = m * m;
|
|
|
|
|
return m2 * m2 * m; // pow(m, 5)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Calculate the fresnel color which is a blend between white and the F0 color (cspec0) */
|
|
|
|
|
ccl_device_forceinline float3
|
|
|
|
|
interpolate_fresnel_color(float3 L, float3 H, float ior, float F0, float3 cspec0)
|
|
|
|
|
{
|
|
|
|
|
/* Calculate the fresnel interpolation factor
|
|
|
|
|
* The value from fresnel_dielectric_cos(...) has to be normalized because
|
|
|
|
|
* the cspec0 keeps the F0 color
|
2019-05-01 21:14:11 +10:00
|
|
|
*/
|
2017-04-18 11:43:09 +02:00
|
|
|
float F0_norm = 1.0f / (1.0f - F0);
|
|
|
|
|
float FH = (fresnel_dielectric_cos(dot(L, H), ior) - F0) * F0_norm;
|
|
|
|
|
|
|
|
|
|
/* Blend between white and a specular color with respect to the fresnel */
|
|
|
|
|
return cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 1.0f) * FH;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-24 14:19:19 +02:00
|
|
|
ccl_device float3 ensure_valid_reflection(float3 Ng, float3 I, float3 N)
|
|
|
|
|
{
|
|
|
|
|
float3 R = 2 * dot(N, I) * N - I;
|
|
|
|
|
|
|
|
|
|
/* Reflection rays may always be at least as shallow as the incoming ray. */
|
|
|
|
|
float threshold = min(0.9f * dot(Ng, I), 0.01f);
|
|
|
|
|
if (dot(Ng, R) >= threshold) {
|
|
|
|
|
return N;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Form coordinate system with Ng as the Z axis and N inside the X-Z-plane.
|
|
|
|
|
* The X axis is found by normalizing the component of N that's orthogonal to Ng.
|
|
|
|
|
* The Y axis isn't actually needed.
|
|
|
|
|
*/
|
|
|
|
|
float NdotNg = dot(N, Ng);
|
|
|
|
|
float3 X = normalize(N - NdotNg * Ng);
|
|
|
|
|
|
|
|
|
|
/* Keep math expressions. */
|
|
|
|
|
/* clang-format off */
|
|
|
|
|
/* Calculate N.z and N.x in the local coordinate system.
|
|
|
|
|
*
|
|
|
|
|
* The goal of this computation is to find a N' that is rotated towards Ng just enough
|
|
|
|
|
* to lift R' above the threshold (here called t), therefore dot(R', Ng) = t.
|
|
|
|
|
*
|
|
|
|
|
* According to the standard reflection equation,
|
|
|
|
|
* this means that we want dot(2*dot(N', I)*N' - I, Ng) = t.
|
|
|
|
|
*
|
|
|
|
|
* Since the Z axis of our local coordinate system is Ng, dot(x, Ng) is just x.z, so we get
|
|
|
|
|
* 2*dot(N', I)*N'.z - I.z = t.
|
|
|
|
|
*
|
|
|
|
|
* The rotation is simple to express in the coordinate system we formed -
|
|
|
|
|
* since N lies in the X-Z-plane, we know that N' will also lie in the X-Z-plane,
|
|
|
|
|
* so N'.y = 0 and therefore dot(N', I) = N'.x*I.x + N'.z*I.z .
|
|
|
|
|
*
|
|
|
|
|
* Furthermore, we want N' to be normalized, so N'.x = sqrt(1 - N'.z^2).
|
|
|
|
|
*
|
|
|
|
|
* With these simplifications,
|
|
|
|
|
* we get the final equation 2*(sqrt(1 - N'.z^2)*I.x + N'.z*I.z)*N'.z - I.z = t.
|
|
|
|
|
*
|
|
|
|
|
* The only unknown here is N'.z, so we can solve for that.
|
|
|
|
|
*
|
|
|
|
|
* The equation has four solutions in general:
|
|
|
|
|
*
|
|
|
|
|
* N'.z = +-sqrt(0.5*(+-sqrt(I.x^2*(I.x^2 + I.z^2 - t^2)) + t*I.z + I.x^2 + I.z^2)/(I.x^2 + I.z^2))
|
|
|
|
|
* We can simplify this expression a bit by grouping terms:
|
|
|
|
|
*
|
|
|
|
|
* a = I.x^2 + I.z^2
|
|
|
|
|
* b = sqrt(I.x^2 * (a - t^2))
|
|
|
|
|
* c = I.z*t + a
|
|
|
|
|
* N'.z = +-sqrt(0.5*(+-b + c)/a)
|
|
|
|
|
*
|
|
|
|
|
* Two solutions can immediately be discarded because they're negative so N' would lie in the
|
|
|
|
|
* lower hemisphere.
|
|
|
|
|
*/
|
|
|
|
|
/* clang-format on */
|
|
|
|
|
|
|
|
|
|
float Ix = dot(I, X), Iz = dot(I, Ng);
|
|
|
|
|
float Ix2 = sqr(Ix), Iz2 = sqr(Iz);
|
|
|
|
|
float a = Ix2 + Iz2;
|
|
|
|
|
|
|
|
|
|
float b = safe_sqrtf(Ix2 * (a - sqr(threshold)));
|
|
|
|
|
float c = Iz * threshold + a;
|
|
|
|
|
|
|
|
|
|
/* Evaluate both solutions.
|
|
|
|
|
* In many cases one can be immediately discarded (if N'.z would be imaginary or larger than
|
|
|
|
|
* one), so check for that first. If no option is viable (might happen in extreme cases like N
|
|
|
|
|
* being in the wrong hemisphere), give up and return Ng. */
|
|
|
|
|
float fac = 0.5f / a;
|
|
|
|
|
float N1_z2 = fac * (b + c), N2_z2 = fac * (-b + c);
|
|
|
|
|
bool valid1 = (N1_z2 > 1e-5f) && (N1_z2 <= (1.0f + 1e-5f));
|
|
|
|
|
bool valid2 = (N2_z2 > 1e-5f) && (N2_z2 <= (1.0f + 1e-5f));
|
|
|
|
|
|
|
|
|
|
float2 N_new;
|
|
|
|
|
if (valid1 && valid2) {
|
|
|
|
|
/* If both are possible, do the expensive reflection-based check. */
|
|
|
|
|
float2 N1 = make_float2(safe_sqrtf(1.0f - N1_z2), safe_sqrtf(N1_z2));
|
|
|
|
|
float2 N2 = make_float2(safe_sqrtf(1.0f - N2_z2), safe_sqrtf(N2_z2));
|
|
|
|
|
|
|
|
|
|
float R1 = 2 * (N1.x * Ix + N1.y * Iz) * N1.y - Iz;
|
|
|
|
|
float R2 = 2 * (N2.x * Ix + N2.y * Iz) * N2.y - Iz;
|
|
|
|
|
|
|
|
|
|
valid1 = (R1 >= 1e-5f);
|
|
|
|
|
valid2 = (R2 >= 1e-5f);
|
|
|
|
|
if (valid1 && valid2) {
|
|
|
|
|
/* If both solutions are valid, return the one with the shallower reflection since it will be
|
|
|
|
|
* closer to the input (if the original reflection wasn't shallow, we would not be in this
|
|
|
|
|
* part of the function). */
|
|
|
|
|
N_new = (R1 < R2) ? N1 : N2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* If only one reflection is valid (= positive), pick that one. */
|
|
|
|
|
N_new = (R1 > R2) ? N1 : N2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (valid1 || valid2) {
|
|
|
|
|
/* Only one solution passes the N'.z criterium, so pick that one. */
|
|
|
|
|
float Nz2 = valid1 ? N1_z2 : N2_z2;
|
|
|
|
|
N_new = make_float2(safe_sqrtf(1.0f - Nz2), safe_sqrtf(Nz2));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return Ng;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return N_new.x * X + N_new.y * Ng;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-15 10:18:42 +00:00
|
|
|
CCL_NAMESPACE_END
|