@@ -106,17 +106,18 @@ void main()
106
106
107
107
// "The sign of this computation is negated when the value of GL_CLIP_ORIGIN (the clip volume origin, set with glClipControl) is GL_UPPER_LEFT."
108
108
const bool front = (!gl_FrontFacing) != (PC.camTformDeterminant*InstData.data[InstanceIndex].determinant < 0.0);
109
- nbl_glsl_MC_precomputed_t precomp = nbl_glsl_precomputeData(front);
109
+ precomp = nbl_glsl_MC_precomputeData(front);
110
+ material = nbl_glsl_MC_material_data_t_getOriented(InstData.data[InstanceIndex].material,precomp.frontface);
110
111
#ifdef TEX_PREFETCH_STREAM
111
- nbl_glsl_runTexPrefetchStream(getTexPrefetchStream(precomp ), UV, dUV);
112
+ nbl_glsl_MC_runTexPrefetchStream(nbl_glsl_MC_oriented_material_t_getTexPrefetchStream(material ), UV, dUV);
112
113
#endif
113
114
#ifdef NORM_PRECOMP_STREAM
114
- nbl_glsl_runNormalPrecompStream(getNormalPrecompStream (precomp), dUV, precomp);
115
+ nbl_glsl_MC_runNormalPrecompStream(nbl_glsl_MC_oriented_material_t_getNormalPrecompStream (precomp), dUV, precomp);
115
116
#endif
116
117
117
118
118
- nbl_glsl_IsotropicViewSurfaceInteraction inter;
119
- vec3 color = nbl_computeLighting(inter, dUV, precomp );
119
+ nbl_glsl_AnisotropicViewSurfaceInteraction inter;
120
+ vec3 color = nbl_computeLighting(inter, dUV);
120
121
121
122
OutColor = vec4(color, 1.0);
122
123
}
@@ -430,7 +431,7 @@ int main()
430
431
};
431
432
for (const auto & inst : instances)
432
433
{
433
- if (inst.emitter .type ==ext::MitsubaLoader::CElementEmitter::AREA)
434
+ if (inst.emitter .front . type ==ext::MitsubaLoader::CElementEmitter::AREA)
434
435
{
435
436
core::vectorSIMDf pos;
436
437
assert (cpumesh->getMeshBufferCount ()==1u );
@@ -439,7 +440,7 @@ int main()
439
440
inst.tform .pseudoMulWith4x1 (pos);
440
441
441
442
SLight l;
442
- l.intensity = inst.emitter .area .radiance *area*2 .f *core::PI<float >();
443
+ l.intensity = inst.emitter .front . area .radiance *area*2 .f *core::PI<float >();
443
444
l.position = pos;
444
445
445
446
lights.push_back (l);
0 commit comments