4
4
#include < nbl/ builtin/ glsl/ material_compiler/ common_declarations.glsl>
5
5
6
6
#ifndef _NBL_USER_PROVIDED_MATERIAL_COMPILER_GLSL_BACKEND_FUNCTIONS_
7
- #error "You need to define 'vec3 nbl_glsl_MC_getNormalizedWorldSpaceV()', 'vec3 nbl_glsl_MC_getNormalizedWorldSpaceN()' , 'nbl_glsl_MC_getWorldSpacePosition()', ' mat2x3 nbl_glsl_MC_getdPos(in vec3 p )' functions above"
7
+ #error "You need to define 'vec3 nbl_glsl_MC_getNormalizedWorldSpaceV()', 'vec3 nbl_glsl_MC_getNormalizedWorldSpaceN()', 'mat2x3 nbl_glsl_MC_getdPos()' functions above"
8
8
#endif
9
9
10
10
#include < nbl/ builtin/ glsl/ math/ functions.glsl>
@@ -16,7 +16,6 @@ nbl_glsl_MC_precomputed_t nbl_glsl_MC_precomputeData(in bool frontface)
16
16
p.N = nbl_glsl_MC_getNormalizedWorldSpaceN();
17
17
p.V = nbl_glsl_MC_getNormalizedWorldSpaceV();
18
18
p.frontface = frontface;
19
- p.pos = nbl_glsl_MC_getWorldSpacePosition();
20
19
21
20
return p;
22
21
}
@@ -339,21 +338,21 @@ mat2x4 nbl_glsl_MC_instr_fetchSrcRegs(in nbl_glsl_MC_instr_t i)
339
338
return nbl_glsl_MC_instr_fetchSrcRegs(i, r);
340
339
}
341
340
342
- void nbl_glsl_MC_setCurrInteraction(in vec3 N, in vec3 V, in vec3 pos )
341
+ void nbl_glsl_MC_setCurrInteraction(in vec3 N, in vec3 V)
343
342
{
344
- mat2x3 dp = nbl_glsl_MC_getdPos(pos );
345
- nbl_glsl_IsotropicViewSurfaceInteraction interaction = nbl_glsl_calcSurfaceInteractionFromViewVector(V, pos, N, dp);
343
+ mat2x3 dp = nbl_glsl_MC_getdPos();
344
+ nbl_glsl_IsotropicViewSurfaceInteraction interaction = nbl_glsl_calcSurfaceInteractionFromViewVector(V, N, dp);
346
345
currInteraction.inner = nbl_glsl_calcAnisotropicInteraction(interaction);
347
346
nbl_glsl_MC_finalizeInteraction(currInteraction);
348
347
}
349
348
void nbl_glsl_MC_setCurrInteraction(in nbl_glsl_MC_precomputed_t precomp)
350
349
{
351
- nbl_glsl_MC_setCurrInteraction(precomp.frontface ? precomp.N : - precomp.N, precomp.V, precomp.pos );
350
+ nbl_glsl_MC_setCurrInteraction(precomp.frontface ? precomp.N : - precomp.N, precomp.V);
352
351
}
353
352
void nbl_glsl_MC_updateCurrInteraction(in nbl_glsl_MC_precomputed_t precomp, in vec3 N)
354
353
{
355
354
// precomputed normals already have correct orientation
356
- nbl_glsl_MC_setCurrInteraction(N, precomp.V, precomp.pos );
355
+ nbl_glsl_MC_setCurrInteraction(N, precomp.V);
357
356
}
358
357
359
358
// clamping alpha to min MIN_ALPHA because we're using microfacet BxDFs for deltas as well (and NDFs often end up NaN when given alpha=0) because of less deivergence
0 commit comments