rtx: slightly improve fake poc lighting
This commit is contained in:
parent
00518d3251
commit
b58eb5b4b2
|
@ -1,13 +1,14 @@
|
||||||
## 2021-06-05, E103
|
## 2021-06-05, E103
|
||||||
- [x] rtx: dynamic surface lights / dynamic light clusters
|
- [x] rtx: dynamic surface lights / dynamic light clusters
|
||||||
- [x] rtx: animated textures
|
- [x] rtx: animated textures
|
||||||
|
- [x] rtx: attenuate surface lights by normal
|
||||||
|
|
||||||
# Next
|
# Next
|
||||||
- [ ] rtx: attenuate surface lights by normal
|
- [ ] run under asan
|
||||||
- [ ] rtx: better memory handling
|
- [ ] rtx: better memory handling
|
||||||
- [ ] robust tracking of memory hierarchies: global/static, map, frame
|
- [ ] robust tracking of memory hierarchies: global/static, map, frame
|
||||||
- or just do a generic allocator with compaction?
|
- 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: live rad file reloading (or other solution for tuning lights)
|
||||||
- [ ] rtx: restore dynamic stuff like particles, beams, etc
|
- [ ] rtx: restore dynamic stuff like particles, beams, etc
|
||||||
- [ ] rtx: emissive particles
|
- [ ] 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
|
- [ ] studio models: fix lighting: should have white texture instead of lightmap OR we could write nearest surface lightmap coords to fake light
|
||||||
|
|
||||||
# Planned
|
# 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
|
- [ ] studio models: pre-compute buffer sizes and allocate them at once
|
||||||
- [ ] rtx: denoise
|
- [ ] rtx: denoise
|
||||||
- [ ] non local means ?
|
- [ ] non local means ?
|
||||||
|
@ -70,7 +73,6 @@
|
||||||
|
|
||||||
# Someday
|
# Someday
|
||||||
- [ ] nvnsight into buffer memory and stuff
|
- [ ] nvnsight into buffer memory and stuff
|
||||||
- [ ] run under asan
|
|
||||||
- [ ] start building command buffers in beginframe
|
- [ ] start building command buffers in beginframe
|
||||||
- [ ] multiple frames in flight (#nd cmdbuf, ...)
|
- [ ] multiple frames in flight (#nd cmdbuf, ...)
|
||||||
- [ ] cleanup unused stuff in vk_studio.c
|
- [ ] cleanup unused stuff in vk_studio.c
|
||||||
|
|
|
@ -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 += 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.);
|
//C = vec3(1., 0., 1.);
|
||||||
if (bounce == 0)
|
if (bounce == 0)
|
||||||
C += kc * emissive;
|
C += kc * emissive * baseColor;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,12 +462,14 @@ void main() {
|
||||||
// const vec3 n3 = vertices[vi3].normal;
|
// const vec3 n3 = vertices[vi3].normal;
|
||||||
|
|
||||||
vec3 light_dir = sample_pos - pos;
|
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.);
|
//C = vec3(1., 0., 1.);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float light_dist = length(light_dir);
|
const float light_dist = length(light_dir);
|
||||||
|
light_dot /= light_dist;
|
||||||
light_dir /= light_dist;
|
light_dir /= light_dist;
|
||||||
if (shadowed(pos, light_dir, light_dist - shadow_offset_fudge)) {
|
if (shadowed(pos, light_dir, light_dist - shadow_offset_fudge)) {
|
||||||
//C = vec3(0., 1., 0.);
|
//C = vec3(0., 1., 0.);
|
||||||
|
@ -476,7 +478,7 @@ void main() {
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
const float brightness_fudge = 5.;
|
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
|
// Sample just one triangle
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue