NJU-3DV / Relightable3DGaussian

[ECCV2024] Relightable 3D Gaussian: Real-time Point Cloud Relighting with BRDF Decomposition and Ray Tracing
https://nju-3dv.github.io/projects/Relightable3DGaussian/
Other
376 stars 24 forks source link

Config file #7

Open darthgera123 opened 7 months ago

darthgera123 commented 7 months ago

Hi @yGaoJiany thanks for the nice codebase. My question was how did you make the light_transform.json that is used to relight the scenes. Could you share the script for that

yGaoJiany commented 7 months ago

Hi, try this:

import json
import numpy as np

fps = 60
seconds = 5

trajectory_dict = dict()
for i, light_angle in enumerate(np.linspace(0, np.pi * 2, fps * seconds)):
    print(f"Rendering frame {i+1}/{fps * seconds}")
    light_rotate = np.array([
        [np.cos(light_angle), -np.sin(light_angle), 0],
        [np.sin(light_angle), np.cos(light_angle), 0],
        [0, 0, 1]], dtype=np.float32)
    trajectory_dict[i] = light_rotate.reshape(-1).tolist()

json_str = json.dumps(trajectory_dict, indent=2)
with open("1.json", "w") as f:
    f.write(json_str)

We used this code to generate a json and then manually reorganised it into light_transform.json.

darthgera123 commented 7 months ago

Thanks @yGaoJiany if i understand correctly this is then point lights which are then projected to envmap?

yGaoJiany commented 7 months ago

The json just stores the rotational transformation of the light source over time (frames), and the light source is expressed in a separate envmap, stored in the folder env_map.

lijunnankman commented 5 months ago

Hi! @yGaoJiany ! How did you make the transform matrixs in "transform.json". They look like random?

yGaoJiany commented 5 months ago

Not random. We use CloudCompare to transform 3D Gaussian point clouds for multi-object combinations, and record the transformation matrix provided by CloudCompare in a json file.