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()', 'mat2x3 nbl_glsl_perturbNormal_dPdSomething()', and 'mat2 nbl_glsl_perturbNormal_dUVdSomething()' functions above"
7
+ #error "You need to define 'vec3 nbl_glsl_MC_getNormalizedWorldSpaceV()', 'vec3 nbl_glsl_MC_getNormalizedWorldSpaceN()' functions above"
8
+ #ifdef TEX_PREFETCH_STREAM
9
+ #error "as well as 'mat2x3 nbl_glsl_perturbNormal_dPdSomething()', and 'mat2 nbl_glsl_perturbNormal_dUVdSomething()'"
10
+ #endif
8
11
#endif
9
12
#define _NBL_BUILTIN_GLSL_BUMP_MAPPING_DERIVATIVES_DECLARED_
10
13
@@ -197,7 +200,9 @@ bool nbl_glsl_MC_op_isDiffuse(in uint op)
197
200
#include < nbl/ builtin/ glsl/ bxdf/ brdf/ specular/ blinn_phong.glsl>
198
201
#include < nbl/ builtin/ glsl/ bxdf/ bsdf/ diffuse/ lambert.glsl>
199
202
#include < nbl/ builtin/ glsl/ bxdf/ bsdf/ specular/ dielectric.glsl>
203
+ #ifdef TEX_PREFETCH_STREAM
200
204
#include < nbl/ builtin/ glsl/ bump_mapping/ utils.glsl>
205
+ #endif
201
206
202
207
// nbl_glsl_BSDFAnisotropicParams currBSDFParams;
203
208
nbl_glsl_MC_interaction_t currInteraction;
@@ -481,6 +486,7 @@ vec3 nbl_glsl_MC_fetchTex(in uvec3 texid, in vec2 uv, in mat2 dUV)
481
486
#endif
482
487
}
483
488
489
+ #ifdef TEX_PREFETCH_STREAM
484
490
void nbl_glsl_MC_runTexPrefetchStream(in nbl_glsl_MC_instr_stream_t stream, in vec2 uv, in mat2 dUV)
485
491
{
486
492
for (uint i = 0u; i < stream.count; ++ i)
@@ -504,6 +510,7 @@ void nbl_glsl_MC_runTexPrefetchStream(in nbl_glsl_MC_instr_stream_t stream, in v
504
510
}
505
511
}
506
512
513
+ #ifdef NORM_PRECOMP_STREAM
507
514
void nbl_glsl_MC_runNormalPrecompStream(in nbl_glsl_MC_instr_stream_t stream, in nbl_glsl_MC_precomputed_t precomp)
508
515
{
509
516
nbl_glsl_MC_setCurrInteraction(precomp);
@@ -521,6 +528,8 @@ void nbl_glsl_MC_runNormalPrecompStream(in nbl_glsl_MC_instr_stream_t stream, in
521
528
nbl_glsl_MC_writeReg(dstreg,nbl_glsl_perturbNormal_derivativeMap(currInteraction.inner.isotropic.N, dh));
522
529
}
523
530
}
531
+ #endif
532
+ #endif
524
533
525
534
#ifdef GEN_CHOICE_STREAM
526
535
void nbl_glsl_MC_instr_eval_and_pdf_execute(in nbl_glsl_MC_instr_t instr, in nbl_glsl_MC_precomputed_t precomp, in nbl_glsl_LightSample s, in nbl_glsl_MC_microfacet_t _microfacet, in bool skip)
0 commit comments