@@ -116,28 +116,19 @@ vec3 nbl_glsl_MC_getNormalizedWorldSpaceN()
116
116
117
117
#include < nbl/ builtin/ glsl/ barycentric/ utils.glsl>
118
118
mat2x3 dPdBary;
119
- vec3 load_positions(out mat2x3 dPdBary_error, out vec3 lastVxPos_error, in uvec3 indices, in nbl_glsl_ext_Mitsuba_Loader_instance_data_t batchInstanceData)
119
+ vec3 load_positions(in uvec3 indices, in nbl_glsl_ext_Mitsuba_Loader_instance_data_t batchInstanceData)
120
120
{
121
121
mat3 positions = mat3 (
122
122
nbl_glsl_fetchVtxPos(indices[0 ],batchInstanceData),
123
123
nbl_glsl_fetchVtxPos(indices[1 ],batchInstanceData),
124
124
nbl_glsl_fetchVtxPos(indices[2 ],batchInstanceData)
125
125
);
126
126
const mat4x3 tform = batchInstanceData.tform;
127
- mat3 positions_error;
128
- // when we quantize positions to RGB21_UNORM, change to exp2(-22.f)
129
- const float quantizationError = nbl_glsl_numeric_limits_float_epsilon(1u);
130
- positions = nbl_glsl_mul_with_bounds_wo_gamma(positions_error,mat3 (tform),positions,quantizationError);
131
- positions_error *= nbl_glsl_ieee754_gamma(2u);
127
+ positions = mat3 (tform)* positions;
132
128
//
133
129
for (int i= 0 ; i< 2 ; i++ )
134
- {
135
- dPdBary[i] = nbl_glsl_ieee754_sub_with_bounds_wo_gamma(dPdBary_error[i],positions[i],positions_error[i],positions[2 ],positions_error[2 ]);
136
- dPdBary_error[i] *= nbl_glsl_ieee754_gamma(1u);
137
- }
138
- const vec3 lastVx = nbl_glsl_ieee754_add_with_bounds_wo_gamma(lastVxPos_error,positions[2 ],positions_error[2 ],tform[3 ],vec3 (0 .f));
139
- lastVxPos_error *= nbl_glsl_ieee754_gamma(1u);
140
- return lastVx;
130
+ dPdBary[i] = positions[i]- positions[2 ];
131
+ return positions[2 ]+ tform[3 ];
141
132
}
142
133
143
134
#ifdef TEX_PREFETCH_STREAM
@@ -200,25 +191,6 @@ nbl_glsl_xoroshiro64star_state_t load_aux_vertex_attrs(
200
191
return scramble_start_state;
201
192
}
202
193
203
- // TODO MOVE to some other header!
204
- vec3 nbl_glsl_interpolate_with_bounds(out vec3 error, in mat2x3 triangleEdges, in mat2x3 triangleEdges_error,
205
- in vec3 origin, in vec3 origin_error, in vec2 compactBary, in float compactBary_error
206
- )
207
- {
208
- vec3 error1;
209
- const vec3 col1 = nbl_glsl_ieee754_mul_with_bounds_wo_gamma(error1,triangleEdges[0 ],triangleEdges_error[0 ],compactBary.x,compactBary_error);
210
- error1 *= nbl_glsl_ieee754_gamma(1u);
211
- vec3 error2;
212
- const vec3 col2 = nbl_glsl_ieee754_mul_with_bounds_wo_gamma(error2,triangleEdges[1 ],triangleEdges_error[1 ],compactBary.y,compactBary_error);
213
- error2 *= nbl_glsl_ieee754_gamma(1u);
214
- vec3 error3;
215
- vec3 retval = nbl_glsl_ieee754_add_with_bounds_wo_gamma(error3,col1,error1,col2,error2);
216
- error3 *= nbl_glsl_ieee754_gamma(1u);
217
- retval = nbl_glsl_ieee754_add_with_bounds_wo_gamma(error,retval,error3,origin,origin_error);
218
- // error *= nbl_glsl_ieee754_gamma(1u);
219
- error *= nbl_glsl_ieee754_gamma(8u); // cause PBRT says so
220
- return retval;
221
- }
222
194
// robust ray origins
223
195
vec3 nbl_glsl_robust_ray_origin_impl(in vec3 origin, in vec3 direction, float offset, vec3 normal)
224
196
{
@@ -256,7 +228,7 @@ void gen_sample_ray(
256
228
void generate_next_rays(
257
229
in uint maxRaysToGen, in nbl_glsl_MC_oriented_material_t material, in bool frontfacing, in uint vertex_depth,
258
230
in nbl_glsl_xoroshiro64star_state_t scramble_start_state, in uint sampleID, in uvec2 outPixelLocation,
259
- in vec3 origin, vec3 origin_error, in vec3 prevThroughput)
231
+ in vec3 origin, in vec3 prevThroughput)
260
232
{
261
233
// get material streams as well
262
234
const nbl_glsl_MC_instr_stream_t gcs = nbl_glsl_MC_oriented_material_t_getGenChoiceStream(material);
0 commit comments