rtx: slightly improve fake poc lighting

This commit is contained in:
Ivan 'provod' Avdeev 2021-06-05 13:06:03 -07:00
parent 00518d3251
commit b58eb5b4b2
2 changed files with 10 additions and 6 deletions

View File

@ -1,13 +1,14 @@
## 2021-06-05, E103
- [x] rtx: dynamic surface lights / dynamic light clusters
- [x] rtx: animated textures
- [x] rtx: attenuate surface lights by normal
# Next
- [ ] rtx: attenuate surface lights by normal
- [ ] run under asan
- [ ] rtx: better memory handling
- [ ] robust tracking of memory hierarchies: global/static, map, frame
- or just do a generic allocator with compaction?
- [ ] rtx: better light culling: normal, bsp visibility, light volumes and intensity, ...
- [ ] rtx: better light culling: normal, bsp visibility, light volumes and intensity, sort by intensity, etc
- [ ] rtx: live rad file reloading (or other solution for tuning lights)
- [ ] rtx: restore dynamic stuff like particles, beams, etc
- [ ] rtx: emissive particles
@ -29,6 +30,8 @@
- [ ] studio models: fix lighting: should have white texture instead of lightmap OR we could write nearest surface lightmap coords to fake light
# Planned
- [ ] rtx: too many emissive lights in c3a1b
- [ ] rtx: c3a1b: assert model->size >= build_size.accelerationStructureSize failed at vk_rtx.c:347
- [ ] studio models: pre-compute buffer sizes and allocate them at once
- [ ] rtx: denoise
- [ ] non local means ?
@ -70,7 +73,6 @@
# Someday
- [ ] nvnsight into buffer memory and stuff
- [ ] run under asan
- [ ] start building command buffers in beginframe
- [ ] multiple frames in flight (#nd cmdbuf, ...)
- [ ] cleanup unused stuff in vk_studio.c

View File

@ -430,7 +430,7 @@ void main() {
//C += kc * vec3(hash(float(kusok_index)), hash(float(kusok_index)+15.43), hash(float(kusok_index)+34.));//kusok.emissive.rgb;
//C = vec3(1., 0., 1.);
if (bounce == 0)
C += kc * emissive;
C += kc * emissive * baseColor;
continue;
}
@ -462,12 +462,14 @@ void main() {
// const vec3 n3 = vertices[vi3].normal;
vec3 light_dir = sample_pos - pos;
if (dot(light_dir, n1) >= 0.) {
float light_dot = -dot(light_dir, n1);
if (light_dot <= 0.) {
//C = vec3(1., 0., 1.);
continue;
}
const float light_dist = length(light_dir);
light_dot /= light_dist;
light_dir /= light_dist;
if (shadowed(pos, light_dir, light_dist - shadow_offset_fudge)) {
//C = vec3(0., 1., 0.);
@ -476,7 +478,7 @@ void main() {
// TODO
const float brightness_fudge = 5.;
C += sampling_light_scale * brightness_fudge * kc * baseColor * emissive * dot(light_dir, normal) / (light_dist * light_dist);
C += light_dot * sampling_light_scale * brightness_fudge * kc * baseColor * emissive * dot(light_dir, normal) / (light_dist * light_dist);
// Sample just one triangle
break;