Skip to content

Commit

Permalink
Adjust thresholds
Browse files Browse the repository at this point in the history
 + some fixes
  • Loading branch information
sergcpp committed Apr 18, 2024
1 parent a950a61 commit 6637319
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 54 deletions.
2 changes: 1 addition & 1 deletion internal/CoreRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct shadow_ray_t {
// origin
float o[3];
// four 7-bit ray depth counters
int depth;
uint32_t depth;
// direction and distance
float d[3], dist;
// throughput color of ray
Expand Down
4 changes: 0 additions & 4 deletions internal/CoreSIMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -7402,10 +7402,6 @@ void Ray::NS::ShadeSurface(const pass_settings_t &ps, const float limits[2], con
float(unpacked.sample_count);
color /= sc.spatial_cache_grid.exposure;
color *= fvec4{ray.c[0][i], ray.c[1][i], ray.c[2][i], 0.0f};
const float sum = hsum(color);
if (sum > limits[1]) {
color *= (limits[1] / sum);
}

out_rgba[0].set(i, color[0]);
out_rgba[1].set(i, color[1]);
Expand Down
4 changes: 0 additions & 4 deletions internal/ShadeRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1352,10 +1352,6 @@ Ray::color_rgba_t Ray::Ref::ShadeSurface(const pass_settings_t &ps, const float
fvec4 color = make_fvec3(unpacked.radiance) / float(unpacked.sample_count);
color /= sc.spatial_cache_grid.exposure;
color *= fvec4{ray.c[0], ray.c[1], ray.c[2], 0.0f};
const float sum = hsum(color);
if (sum > limits[1]) {
color *= (limits[1] / sum);
}
return color_rgba_t{color.get<0>(), color.get<1>(), color.get<2>(), color.get<3>()};
}
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/spatial_cache_update.comp.cso.inl

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/spatial_cache_update.comp.spv.inl

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions internal/shaders/shade.comp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2139,10 +2139,6 @@ vec3 ShadeSurface(const hit_data_t inter, const ray_data_t ray, inout vec3 out_b
vec3 color = unpacked.radiance / float(unpacked.sample_count);
color /= params.exposure;
color *= vec3(ray.c[0], ray.c[1], ray.c[2]);
const float sum = color.r + color.g + color.b;
if (sum > g_params.limit_indirect) {
color *= (g_params.limit_indirect / sum);
}
return color;
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/shaders/spatial_cache_update.comp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ void main() {
vec3 rad = texelFetch(g_radiance_tex, ivec2(x, y), 0).rgb * grid_params.exposure;

cache_data_t cache = g_inout_cache_data[y * g_params.cache_w + x];
cache.sample_weight[0][0] = ray.c[0];
cache.sample_weight[0][1] = ray.c[1];
cache.sample_weight[0][2] = ray.c[2];
cache.sample_weight[0][0] *= ray.c[0];
cache.sample_weight[0][1] *= ray.c[1];
cache.sample_weight[0][2] *= ray.c[2];
if (inter.v < 0.0 || inter.obj_index < 0 || cache.path_len == RAD_CACHE_PROPAGATION_DEPTH) {
for (int j = 0; j < cache.path_len; ++j) {
rad *= vec3(cache.sample_weight[j][0], cache.sample_weight[j][1], cache.sample_weight[j][2]);
Expand Down
2 changes: 1 addition & 1 deletion internal/shaders/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct ray_data_t {
float ior[4];
float cone_width, cone_spread;
uint xy;
uint depth;
uint depth;
};

struct shadow_ray_t {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_materials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ void test_complex_mat3(const char *arch_list[], const char *preferred_device) {

void test_complex_mat4(const char *arch_list[], const char *preferred_device) {
const int SampleCount = 10;
const int PixThres = 2281;
const int PixThres = 2282;

Ray::principled_mat_desc_t metal_mat_desc;
metal_mat_desc.base_texture = Ray::TextureHandle{0};
Expand Down

0 comments on commit 6637319

Please sign in to comment.