Skip to content

Commit 1634c55

Browse files
committed
Updated ex18
Here staircase actually works.... wtf
1 parent cc9084b commit 1634c55

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

examples_tests/18.MitsubaLoader/main.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,18 @@ void main()
106106
107107
// "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."
108108
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);
110111
#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);
112113
#endif
113114
#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);
115116
#endif
116117
117118
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);
120121
121122
OutColor = vec4(color, 1.0);
122123
}
@@ -430,7 +431,7 @@ int main()
430431
};
431432
for (const auto& inst : instances)
432433
{
433-
if (inst.emitter.type==ext::MitsubaLoader::CElementEmitter::AREA)
434+
if (inst.emitter.front.type==ext::MitsubaLoader::CElementEmitter::AREA)
434435
{
435436
core::vectorSIMDf pos;
436437
assert(cpumesh->getMeshBufferCount()==1u);
@@ -439,7 +440,7 @@ int main()
439440
inst.tform.pseudoMulWith4x1(pos);
440441

441442
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>();
443444
l.position = pos;
444445

445446
lights.push_back(l);

0 commit comments

Comments
 (0)