Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
92e432b
Create mega_volume_path.cpp
OmidGhotbi May 13, 2025
69795d0
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
eec954d
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
3b5e0cb
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
78d0a09
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
c1c5db7
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
e134012
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
cce770f
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
7c5c351
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
86c5bc1
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
bf91e4b
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
2fa55ed
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
9f9b0fe
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
71a4642
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
ac395bf
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
936af2c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a6f2a75
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
0a7242c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
9879f7f
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
6c8f6de
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
ebe8523
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
14855c0
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
5f15ccd
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
366d6a0
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
bb22837
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
542a666
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
3cc5e81
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
8a1542d
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
459eeec
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
b9f4dcb
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a74e941
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
44fb2d2
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
94da19c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
e17cb99
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
9c110de
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
5c727ff
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
b996a36
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
5809cbd
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
6829659
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
281831c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
3872c76
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
25c8e65
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
027fc56
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
56cf108
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
bda37df
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
d403ccb
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
b505068
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
8184c1c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
cb7942d
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
d3f7a97
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
179e052
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
6984466
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a00f0a1
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
21a656a
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
337668b
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
3c70e78
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a739ddc
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
8dc57e6
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
81095a0
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
67390a7
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
5bc7538
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
b3e96f9
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
2ac6699
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
ca002e1
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a52cf8e
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
0b99b3f
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
8eb4ba2
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
96fa619
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
3508eeb
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
4acb1bb
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
fc95c56
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
05e0a43
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
e174372
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
45012ac
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
f42d490
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
f0ebbfc
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
49ded5c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
575f50a
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
24e107a
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
64762e6
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
e2fcb8e
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
b4d0a49
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
6cea054
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
5c44e48
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
b995337
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
d7eaf28
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
9a2975b
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
8e2644e
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
49e370c
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
2594ebb
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
8c00768
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
0bfc62f
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
2be064d
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
15a8710
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
ec9d519
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
638d167
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
9891cbf
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a8ecd18
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
e42313d
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
703a188
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
87a0fb3
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
aff3021
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
013cb7d
Update CMakeLists.txt
OmidGhotbi May 13, 2025
ab00c7f
Update homogeneous.cpp
OmidGhotbi May 13, 2025
b54a05e
Update mega_volume_path.cpp
OmidGhotbi May 13, 2025
a79338c
Update camera.cpp
OmidGhotbi May 13, 2025
62d1c96
Update camera.cpp
OmidGhotbi May 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/base/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,23 @@ Camera::Instance::Instance(Pipeline &pipeline, CommandBuffer &command_buffer, co
Camera::Sample Camera::Instance::generate_ray(Expr<uint2> pixel_coord, Expr<float> time,
Expr<float2> u_filter, Expr<float2> u_lens) const noexcept {
auto [filter_offset, filter_weight] = filter()->sample(u_filter);
auto pixel = make_float2(pixel_coord) + .5f + filter_offset;
auto pixel = make_float2(pixel_coord) + 0.5f + filter_offset;
auto [ray, weight] = _generate_ray_in_camera_space(pixel, u_lens, time);
weight *= filter_weight;

auto c2w = camera_to_world();
auto o = make_float3(c2w * make_float4(ray->origin(), 1.f));
auto d = normalize(make_float3x3(c2w) * ray->direction());

// Transform direction from camera space to world space.
auto d_camera = make_float3x3(c2w) * ray->direction();
auto len = length(d_camera);
// Use 'ite' (if-then-else) with proper DSL vector types:
//auto d = normalize(ite(len < 1e-5f, make_float3(0.f, 0.f, -1.f), d_camera));
auto d = ite(len < 1e-7f, make_float3(0.f, 0.f, -1.f), d_camera/len);

ray->set_origin(o);
ray->set_direction(d);
ray->set_direction(normalize(d));

return {std::move(ray), pixel, weight};
}

Expand Down
1 change: 1 addition & 0 deletions src/integrators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ luisa_render_add_plugin(megawave CATEGORY integrator SOURCES megawave.cpp)
luisa_render_add_plugin(megapm CATEGORY integrator SOURCES megapm.cpp)
luisa_render_add_plugin(megavpt CATEGORY integrator SOURCES mega_vpt.cpp)
luisa_render_add_plugin(megavptnaive CATEGORY integrator SOURCES mega_vpt_naive.cpp)
luisa_render_add_plugin(megavolumetricpt CATEGORY integrator SOURCES mega_volume_path.cpp)
Loading
Loading