@@ -117,9 +117,9 @@ void main()
117
117
118
118
nbl_glsl_xoroshiro64star_state_t scramble_start_state; // this should get advanced for secondary rays by 3 or 4 iterations
119
119
120
- nbl_glsl_MC_precomputed_t precomputed;
121
120
nbl_glsl_MC_instr_stream_t gcs;
122
121
nbl_glsl_MC_instr_stream_t rnps;
122
+ nbl_glsl_MC_precomputed_t precomputed;
123
123
124
124
const bool nonBackgroudPixel = revdepth>0.0;
125
125
if (nonBackgroudPixel)
@@ -163,7 +163,6 @@ void main()
163
163
nbl_glsl_MC_oriented_material_t material = nbl_glsl_MC_material_data_t_getOriented(InstData.data[objectID].material,frontfacing);
164
164
165
165
// use loaded data
166
- precomputed = nbl_glsl_MC_precomputeData(frontfacing);
167
166
emissive = nbl_glsl_MC_oriented_material_t_getEmissive(material);
168
167
gcs = nbl_glsl_MC_oriented_material_t_getGenChoiceStream(material);
169
168
rnps = nbl_glsl_MC_oriented_material_t_getRemAndPdfStream(material);
@@ -173,6 +172,9 @@ void main()
173
172
normalizedN.x = dot(InstData.data[objectID].normalMatrixRow0,normal);
174
173
normalizedN.y = dot(InstData.data[objectID].normalMatrixRow1,normal);
175
174
normalizedN.z = dot(InstData.data[objectID].normalMatrixRow2,normal);
175
+
176
+ // need to do this after we have world, V and N ready
177
+ precomputed = nbl_glsl_MC_precomputeData(frontfacing);
176
178
177
179
// prefetch textures and normals
178
180
#ifdef TEX_PREFETCH_STREAM
0 commit comments