Skip to content

Commit 2a3cda3

Browse files
committed
moved A out of ndf base into generate base
1 parent 91b39d5 commit 2a3cda3

File tree

6 files changed

+79
-63
lines changed

6 files changed

+79
-63
lines changed

include/nbl/builtin/hlsl/bxdf/ndf/beckmann.hlsl

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ struct BeckmannGenerateH
203203
using vector2_type = vector<T, 2>;
204204
using vector3_type = vector<T, 3>;
205205

206-
static vector3_type __call(const vector2_type A, const vector3_type localV, const vector2_type u)
206+
vector3_type __call(const vector3_type localV, const vector2_type u)
207207
{
208208
//stretch
209-
vector3_type V = nbl::hlsl::normalize<vector3_type>(vector3_type(A.x * localV.x, A.y * localV.y, localV.z));
209+
vector3_type V = nbl::hlsl::normalize<vector3_type>(vector3_type(ax * localV.x, ay * localV.y, localV.z));
210210

211211
vector2_type slope;
212212
if (V.z > 0.9999)//V.z=NdotV=cosTheta in tangent space
@@ -266,19 +266,22 @@ struct BeckmannGenerateH
266266
slope.x = tmp;
267267

268268
//unstretch
269-
slope = vector2_type(A.x,A.y)*slope;
269+
slope = vector2_type(ax, ay) * slope;
270270

271271
return nbl::hlsl::normalize<vector3_type>(vector3_type(-slope, 1.0));
272272
}
273+
274+
scalar_type ax;
275+
scalar_type ay;
273276
};
274277
}
275278

276279

277-
template<typename T, bool IsAnisotropic, MicrofacetTransformTypes reflect_refract NBL_PRIMARY_REQUIRES(concepts::FloatingPointScalar<T>)
280+
template<typename T, bool _IsAnisotropic, MicrofacetTransformTypes reflect_refract NBL_PRIMARY_REQUIRES(concepts::FloatingPointScalar<T>)
278281
struct Beckmann
279282
{
280283
using scalar_type = T;
281-
using base_type = impl::BeckmannCommon<T,IsAnisotropic>;
284+
using base_type = impl::BeckmannCommon<T,_IsAnisotropic>;
282285
using quant_type = SDualMeasureQuant<scalar_type>;
283286
using vector2_type = vector<T, 2>;
284287
using vector3_type = vector<T, 3>;
@@ -287,6 +290,7 @@ struct Beckmann
287290
using g2g1_query_type = impl::SBeckmannG2overG1Query<scalar_type>;
288291
using quant_query_type = impl::NDFQuantQuery<scalar_type>;
289292

293+
NBL_CONSTEXPR_STATIC_INLINE bool IsAnisotropic = _IsAnisotropic;
290294
NBL_CONSTEXPR_STATIC_INLINE bool IsBSDF = reflect_refract != MTT_REFLECT;
291295
template<class Interaction>
292296
NBL_CONSTEXPR_STATIC_INLINE bool RequiredInteraction = IsAnisotropic ? surface_interactions::Anisotropic<Interaction> : surface_interactions::Isotropic<Interaction>;
@@ -311,50 +315,50 @@ struct Beckmann
311315
enable_if_t<C::value && !IsAnisotropic, dg1_query_type> createDG1Query(NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
312316
{
313317
dg1_query_type dg1_query;
314-
dg1_query.ndf = __base.template D<MicrofacetCache>(cache);
315-
dg1_query.lambda_V = __base.LambdaC2(interaction.getNdotV2());
318+
dg1_query.ndf = __ndf_base.template D<MicrofacetCache>(cache);
319+
dg1_query.lambda_V = __ndf_base.LambdaC2(interaction.getNdotV2());
316320
return dg1_query;
317321
}
318322
template<class LS, class Interaction, typename C=bool_constant<!IsAnisotropic> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
319323
enable_if_t<C::value && !IsAnisotropic, g2g1_query_type> createG2G1Query(NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
320324
{
321325
g2g1_query_type g2_query;
322-
g2_query.lambda_L = __base.LambdaC2(_sample.getNdotL2());
323-
g2_query.lambda_V = __base.LambdaC2(interaction.getNdotV2());
326+
g2_query.lambda_L = __ndf_base.LambdaC2(_sample.getNdotL2());
327+
g2_query.lambda_V = __ndf_base.LambdaC2(interaction.getNdotV2());
324328
return g2_query;
325329
}
326330
template<class Interaction, class MicrofacetCache, typename C=bool_constant<IsAnisotropic> NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
327331
enable_if_t<C::value && IsAnisotropic, dg1_query_type> createDG1Query(NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
328332
{
329333
dg1_query_type dg1_query;
330-
dg1_query.ndf = __base.template D<MicrofacetCache>(cache);
331-
dg1_query.lambda_V = __base.LambdaC2(interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
334+
dg1_query.ndf = __ndf_base.template D<MicrofacetCache>(cache);
335+
dg1_query.lambda_V = __ndf_base.LambdaC2(interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
332336
return dg1_query;
333337
}
334338
template<class LS, class Interaction, typename C=bool_constant<IsAnisotropic> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
335339
enable_if_t<C::value && IsAnisotropic, g2g1_query_type> createG2G1Query(NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
336340
{
337341
g2g1_query_type g2_query;
338-
g2_query.lambda_L = __base.LambdaC2(_sample.getTdotL2(), _sample.getBdotL2(), _sample.getNdotL2());
339-
g2_query.lambda_V = __base.LambdaC2(interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
342+
g2_query.lambda_L = __ndf_base.LambdaC2(_sample.getTdotL2(), _sample.getBdotL2(), _sample.getNdotL2());
343+
g2_query.lambda_V = __ndf_base.LambdaC2(interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
340344
return g2_query;
341345
}
342346

343-
vector<T, 3> generateH(const vector3_type localV, const vector2_type u)
347+
vector3_type generateH(const vector3_type localV, const vector2_type u)
344348
{
345-
return impl::BeckmannGenerateH<scalar_type>::__call(__base.A, localV, u);
349+
return __generate_base.__call(localV, u);
346350
}
347351

348352
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
349353
enable_if_t<C::value && !IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
350354
{
351-
scalar_type d = __base.template D<MicrofacetCache>(cache);
355+
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
352356
return createDualMeasureQuantity<T>(d, interaction.getNdotV(BxDFClampMode::BCM_MAX), _sample.getNdotL(BxDFClampMode::BCM_MAX));
353357
}
354358
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
355359
enable_if_t<C::value && IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
356360
{
357-
scalar_type d = __base.template D<MicrofacetCache>(cache);
361+
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
358362
return createDualMeasureQuantity<T, reflect_refract>(d, interaction.getNdotV(BxDFClampMode::BCM_ABS), _sample.getNdotL(BxDFClampMode::BCM_ABS), quant_query.getVdotHLdotH(), quant_query.getVdotH_etaLdotH());
359363
}
360364

@@ -383,7 +387,8 @@ struct Beckmann
383387
return base_type::template G2_over_G1<g2g1_query_type, MicrofacetCache>(query, cache);
384388
}
385389

386-
base_type __base;
390+
base_type __ndf_base;
391+
impl::BeckmannGenerateH<scalar_type> __generate_base;
387392
};
388393

389394
template<typename T>

include/nbl/builtin/hlsl/bxdf/ndf/ggx.hlsl

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ struct GGXCommon<T,IsBSDF,false NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScala
157157
return G2_over_G1;
158158
}
159159

160-
vector<scalar_type, 2> A; // TODO: remove?
161160
scalar_type a2;
162161
scalar_type one_minus_a2;
163162
};
@@ -242,7 +241,6 @@ struct GGXCommon<T,IsBSDF,true NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar
242241
return G2_over_G1;
243242
}
244243

245-
vector<scalar_type, 2> A;
246244
scalar_type ax2;
247245
scalar_type ay2;
248246
scalar_type a2;
@@ -255,9 +253,9 @@ struct GGXGenerateH
255253
using vector2_type = vector<T, 2>;
256254
using vector3_type = vector<T, 3>;
257255

258-
static vector3_type __call(const vector2_type A, const vector3_type localV, const vector2_type u)
256+
vector3_type __call(const vector3_type localV, const vector2_type u)
259257
{
260-
vector3_type V = nbl::hlsl::normalize<vector3_type>(vector3_type(A.x*localV.x, A.y*localV.y, localV.z));//stretch view vector so that we're sampling as if roughness=1.0
258+
vector3_type V = nbl::hlsl::normalize<vector3_type>(vector3_type(ax * localV.x, ay * localV.y, localV.z));//stretch view vector so that we're sampling as if roughness=1.0
261259

262260
scalar_type lensq = V.x*V.x + V.y*V.y;
263261
vector3_type T1 = lensq > 0.0 ? vector3_type(-V.y, V.x, 0.0) * rsqrt<scalar_type>(lensq) : vector3_type(1.0,0.0,0.0);
@@ -274,15 +272,19 @@ struct GGXGenerateH
274272
//tested, seems -t1*t1-t2*t2>-1.0
275273
vector3_type H = t1*T1 + t2*T2 + sqrt<scalar_type>(1.0-t1*t1-t2*t2)*V;
276274
//unstretch
277-
return nbl::hlsl::normalize<vector3_type>(vector3_type(A.x*H.x, A.y*H.y, H.z));
275+
return nbl::hlsl::normalize<vector3_type>(vector3_type(ax*H.x, ay*H.y, H.z));
278276
}
277+
278+
scalar_type ax;
279+
scalar_type ay;
279280
};
280281
}
281282

282283

283-
template<typename T, bool IsAnisotropic, MicrofacetTransformTypes reflect_refract NBL_PRIMARY_REQUIRES(concepts::FloatingPointScalar<T>)
284+
template<typename T, bool _IsAnisotropic, MicrofacetTransformTypes reflect_refract NBL_PRIMARY_REQUIRES(concepts::FloatingPointScalar<T>)
284285
struct GGX
285286
{
287+
NBL_CONSTEXPR_STATIC_INLINE bool IsAnisotropic = _IsAnisotropic;
286288
NBL_CONSTEXPR_STATIC_INLINE bool IsBSDF = reflect_refract != MTT_REFLECT;
287289

288290
using scalar_type = T;
@@ -319,46 +321,46 @@ struct GGX
319321
enable_if_t<C::value && !IsAnisotropic, dg1_query_type> createDG1Query(NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
320322
{
321323
dg1_query_type dg1_query;
322-
dg1_query.ndf = __base.template D<MicrofacetCache>(cache);
324+
dg1_query.ndf = __ndf_base.template D<MicrofacetCache>(cache);
323325
scalar_type clampedNdotV = interaction.getNdotV(_clamp);
324-
dg1_query.G1_over_2NdotV = __base.G1_wo_numerator(clampedNdotV, interaction.getNdotV2());
326+
dg1_query.G1_over_2NdotV = __ndf_base.G1_wo_numerator(clampedNdotV, interaction.getNdotV2());
325327
return dg1_query;
326328
}
327329
template<class LS, class Interaction, typename C=bool_constant<!IsAnisotropic> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
328330
enable_if_t<C::value && !IsAnisotropic, g2g1_query_type> createG2G1Query(NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
329331
{
330332
g2g1_query_type g2_query;
331-
g2_query.devsh_l = __base.devsh_part(_sample.getNdotL2());
332-
g2_query.devsh_v = __base.devsh_part(interaction.getNdotV2());
333+
g2_query.devsh_l = __ndf_base.devsh_part(_sample.getNdotL2());
334+
g2_query.devsh_v = __ndf_base.devsh_part(interaction.getNdotV2());
333335
return g2_query;
334336
}
335337
template<class Interaction, class MicrofacetCache, typename C=bool_constant<IsAnisotropic> NBL_FUNC_REQUIRES(RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
336338
enable_if_t<C::value && IsAnisotropic, dg1_query_type> createDG1Query(NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
337339
{
338340
dg1_query_type dg1_query;
339-
dg1_query.ndf = __base.template D<MicrofacetCache>(cache);
341+
dg1_query.ndf = __ndf_base.template D<MicrofacetCache>(cache);
340342
scalar_type clampedNdotV = interaction.getNdotV(_clamp);
341-
dg1_query.G1_over_2NdotV = __base.G1_wo_numerator(clampedNdotV, interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
343+
dg1_query.G1_over_2NdotV = __ndf_base.G1_wo_numerator(clampedNdotV, interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
342344
return dg1_query;
343345
}
344346
template<class LS, class Interaction, typename C=bool_constant<IsAnisotropic> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction>)
345347
enable_if_t<C::value && IsAnisotropic, g2g1_query_type> createG2G1Query(NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction)
346348
{
347349
g2g1_query_type g2_query;
348-
g2_query.devsh_l = __base.devsh_part(_sample.getTdotL2(), _sample.getBdotL2(), _sample.getNdotL2());
349-
g2_query.devsh_v = __base.devsh_part(interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
350+
g2_query.devsh_l = __ndf_base.devsh_part(_sample.getTdotL2(), _sample.getBdotL2(), _sample.getNdotL2());
351+
g2_query.devsh_v = __ndf_base.devsh_part(interaction.getTdotV2(), interaction.getBdotV2(), interaction.getNdotV2());
350352
return g2_query;
351353
}
352354

353-
vector<T, 3> generateH(const vector3_type localV, const vector2_type u)
355+
vector3_type generateH(const vector3_type localV, const vector2_type u)
354356
{
355-
return impl::GGXGenerateH<scalar_type>::__call(__base.A, localV, u);
357+
return __generate_base.__call(localV, u);
356358
}
357359

358360
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<!IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
359361
enable_if_t<C::value && !IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
360362
{
361-
scalar_type d = __base.template D<MicrofacetCache>(cache);
363+
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
362364
quant_type dmq;
363365
dmq.microfacetMeasure = d;
364366
dmq.projectedLightMeasure = d * _sample.getNdotL(BxDFClampMode::BCM_MAX);
@@ -367,7 +369,7 @@ struct GGX
367369
template<class LS, class Interaction, class MicrofacetCache, typename C=bool_constant<IsBSDF> NBL_FUNC_REQUIRES(LightSample<LS> && RequiredInteraction<Interaction> && RequiredMicrofacetCache<MicrofacetCache>)
368370
enable_if_t<C::value && IsBSDF, quant_type> D(NBL_CONST_REF_ARG(quant_query_type) quant_query, NBL_CONST_REF_ARG(LS) _sample, NBL_CONST_REF_ARG(Interaction) interaction, NBL_CONST_REF_ARG(MicrofacetCache) cache)
369371
{
370-
scalar_type d = __base.template D<MicrofacetCache>(cache);
372+
scalar_type d = __ndf_base.template D<MicrofacetCache>(cache);
371373
quant_type dmq;
372374
dmq.microfacetMeasure = d; // note: microfacetMeasure/2NdotV
373375

@@ -419,7 +421,8 @@ struct GGX
419421
return base_type::template G2_over_G1<g2g1_query_type, LS, Interaction, MicrofacetCache>(query, _sample, interaction, cache);
420422
}
421423

422-
base_type __base;
424+
base_type __ndf_base;
425+
impl::GGXGenerateH<scalar_type> __generate_base;
423426
};
424427

425428
namespace impl

include/nbl/builtin/hlsl/bxdf/reflection/beckmann.hlsl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ struct SBeckmannIsotropic
3939
static this_t create(scalar_type A, NBL_CONST_REF_ARG(spectral_type) eta, NBL_CONST_REF_ARG(spectral_type) etak)
4040
{
4141
this_t retval;
42-
retval.__base.ndf.__base.A = vector2_type(A, A);
43-
retval.__base.ndf.__base.a2 = A*A;
42+
retval.__base.ndf.__ndf_base.a2 = A*A;
43+
retval.__base.ndf.__generate_base.ax = A;
44+
retval.__base.ndf.__generate_base.ay = A;
4445
retval.__base.fresnel.eta = eta;
4546
retval.__base.fresnel.etak2 = etak * etak;
4647
retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2;
@@ -114,10 +115,11 @@ struct SBeckmannAnisotropic
114115
static this_t create(scalar_type ax, scalar_type ay, NBL_CONST_REF_ARG(spectral_type) eta, NBL_CONST_REF_ARG(spectral_type) etak)
115116
{
116117
this_t retval;
117-
retval.__base.ndf.__base.A = vector2_type(ax, ay);
118-
retval.__base.ndf.__base.ax2 = ax*ax;
119-
retval.__base.ndf.__base.ay2 = ay*ay;
120-
retval.__base.ndf.__base.a2 = ax*ay;
118+
retval.__base.ndf.__ndf_base.ax2 = ax*ax;
119+
retval.__base.ndf.__ndf_base.ay2 = ay*ay;
120+
retval.__base.ndf.__ndf_base.a2 = ax*ay;
121+
retval.__base.ndf.__generate_base.ax = ax;
122+
retval.__base.ndf.__generate_base.ay = ay;
121123
retval.__base.fresnel.eta = eta;
122124
retval.__base.fresnel.etak2 = etak * etak;
123125
retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2;

include/nbl/builtin/hlsl/bxdf/reflection/ggx.hlsl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ struct SGGXIsotropic
3939
static this_t create(scalar_type A, NBL_CONST_REF_ARG(spectral_type) eta, NBL_CONST_REF_ARG(spectral_type) etak)
4040
{
4141
this_t retval;
42-
retval.__base.ndf.__base.A = vector2_type(A, A);
43-
retval.__base.ndf.__base.a2 = A*A;
44-
retval.__base.ndf.__base.one_minus_a2 = scalar_type(1.0) - A*A;
42+
retval.__base.ndf.__ndf_base.a2 = A*A;
43+
retval.__base.ndf.__ndf_base.one_minus_a2 = scalar_type(1.0) - A*A;
44+
retval.__base.ndf.__generate_base.ax = A;
45+
retval.__base.ndf.__generate_base.ay = A;
4546
retval.__base.fresnel.eta = eta;
4647
retval.__base.fresnel.etak2 = etak * etak;
4748
retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2;
@@ -115,10 +116,11 @@ struct SGGXAnisotropic
115116
static this_t create(scalar_type ax, scalar_type ay, NBL_CONST_REF_ARG(spectral_type) eta, NBL_CONST_REF_ARG(spectral_type) etak)
116117
{
117118
this_t retval;
118-
retval.__base.ndf.__base.A = vector2_type(ax, ay);
119-
retval.__base.ndf.__base.ax2 = ax*ax;
120-
retval.__base.ndf.__base.ay2 = ay*ay;
121-
retval.__base.ndf.__base.a2 = ax*ay;
119+
retval.__base.ndf.__ndf_base.ax2 = ax*ax;
120+
retval.__base.ndf.__ndf_base.ay2 = ay*ay;
121+
retval.__base.ndf.__ndf_base.a2 = ax*ay;
122+
retval.__base.ndf.__generate_base.ax = ax;
123+
retval.__base.ndf.__generate_base.ay = ay;
122124
retval.__base.fresnel.eta = eta;
123125
retval.__base.fresnel.etak2 = etak * etak;
124126
retval.__base.fresnel.etaLen2 = eta * eta + retval.__base.fresnel.etak2;

include/nbl/builtin/hlsl/bxdf/transmission/beckmann.hlsl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ struct SBeckmannDielectricIsotropic
3939
static this_t create(NBL_CONST_REF_ARG(fresnel::OrientedEtas<monochrome_type>) orientedEta, scalar_type A, NBL_CONST_REF_ARG(spectral_type) luminosityContributionHint)
4040
{
4141
this_t retval;
42-
retval.__base.ndf.__base.A = vector2_type(A, A);
43-
retval.__base.ndf.__base.a2 = A*A;
42+
retval.__base.ndf.__ndf_base.a2 = A*A;
43+
retval.__base.ndf.__generate_base.ax = A;
44+
retval.__base.ndf.__generate_base.ay = A;
4445
retval.__base.fresnel.orientedEta = orientedEta;
4546
retval.__base.fresnel.orientedEta2 = orientedEta.value * orientedEta.value;
4647
retval.__base.luminosityContributionHint = luminosityContributionHint;
@@ -120,10 +121,11 @@ struct SBeckmannDielectricAnisotropic
120121
static this_t create(NBL_CONST_REF_ARG(fresnel::OrientedEtas<monochrome_type>) orientedEta, scalar_type ax, scalar_type ay, NBL_CONST_REF_ARG(spectral_type) luminosityContributionHint)
121122
{
122123
this_t retval;
123-
retval.__base.ndf.__base.A = vector2_type(ax, ay);
124-
retval.__base.ndf.__base.ax2 = ax*ax;
125-
retval.__base.ndf.__base.ay2 = ay*ay;
126-
retval.__base.ndf.__base.a2 = ax*ay;
124+
retval.__base.ndf.__ndf_base.ax2 = ax*ax;
125+
retval.__base.ndf.__ndf_base.ay2 = ay*ay;
126+
retval.__base.ndf.__ndf_base.a2 = ax*ay;
127+
retval.__base.ndf.__generate_base.ax = ax;
128+
retval.__base.ndf.__generate_base.ay = ay;
127129
retval.__base.fresnel.orientedEta = orientedEta;
128130
retval.__base.fresnel.orientedEta2 = orientedEta.value * orientedEta.value;
129131
retval.__base.luminosityContributionHint = luminosityContributionHint;

0 commit comments

Comments
 (0)