INNER CODE UNIT · Python
generate_brdf_lut
SedulousWorks/SedulousEngine · Scripts/generate_brdf_lut.py:57
def generate_brdf_lut():
"""Generate the BRDF LUT data using vectorized numpy."""
start = time.time()
# Pre-compute Hammersley sequence for all samples.
sample_indices = np.arange(NUM_SAMPLES, dtype=np.uint32)
xi1_all = sample_indices.astype(np.float64) / NUM_SAMPLES
xi2_all = radical_inverse_vdc(sample_indices)
result_scale = np.zeros((SIZE, SIZE), dtype=np.float64)
result_bias = np.zeros((SIZE, SIZE), dtype=np.float64)
for y in range(SIZE):
if y % 32 == 0:
elapsed = time.time() - start
print(f" Row {y}/{SIZE} ({100*y//SIZE}%) [{elapsed:.1f}s]", file=sys.stderr)
roughness = (y + 1) / SIZE