gameknife / gkNextRenderer

A Modern gkRenderer
15 stars 2 forks source link

Feature request: refactor raytracing cycle of bounces with for operator #17

Closed tigrazone closed 1 day ago

tigrazone commented 1 week ago

Please refactor cycle of bounces with for operator. I'm trying but have issues in quality and result of rendering. I plan to implement MIS and full path tracing with NEE(Next event estimation). Pease help

tigrazone commented 1 week ago

Benefits:

gameknife commented 1 week ago

ok,i will put this on 1st priority, and also provide a equal rayquery pipeline

tigrazone commented 1 week ago

equal rayquery pipeline maybe move common code to separate file like authors of vk_raytrace do https://github.com/nvpro-samples/vk_raytrace common code - https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/pathtrace.glsl raytracing pipeline - https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/pathtrace.rgen rayquery pipeline - https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/pathtrace.comp

gameknife commented 1 week ago

equal rayquery pipeline maybe move common code to separate file like authors of vk_raytrace do https://github.com/nvpro-samples/vk_raytrace common code - https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/pathtrace.glsl raytracing pipeline - https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/pathtrace.rgen rayquery pipeline - https://github.com/nvpro-samples/vk_raytrace/blob/master/shaders/pathtrace.comp

yes, code will in common file except the control framework

gameknife commented 1 week ago

currently, rayquery pipeline is ok to use, I will catchup the reproject pass later. the performance is more faster than raytracing pipeline, guess that multi shader binding and payload transfer is the problem!

I think the new ray query rendereris a better choise to impl next features~

tigrazone commented 1 week ago

rayquery pipeline is NOT ok now. renders not similar. scene "Ray Tracing In One Weekend" for example, grayed. without balls

tigrazone commented 1 week ago

I just wait you add to RayQuery reprojection and make it work same as RayTracing pipeline

gameknife commented 6 days ago

I just wait you add to RayQuery reprojection and make it work same as RayTracing pipeline

I'm working on it, RayQuery Pipeline will be ok in few days. Procedural Hit not handled currently,

gameknife commented 4 days ago

I just wait you add to RayQuery reprojection and make it work same as RayTracing pipeline

reproject is ok, procedural hit is on the way. rq pipe is huge faster than rt pipe, I will find the different...

tigrazone commented 4 days ago

I know about rq speedup. I compare speed of rendering with vk_shaded_gltfscene and your renderer on luxball scene. With raytracing pipeline on both renderers and with --present-mode 0 Your renderer 33fps, vk_shaded_gltfscene 129fps on my rtx 3060. Something makes renderer too slow

tigrazone commented 4 days ago

With rayquery pipeline scene "Ray Tracing In One Weekend" rendered like gray plane rtow-gray1

gameknife commented 4 days ago

With rayquery pipeline scene "Ray Tracing In One Weekend" rendered like gray plane rtow-gray1

this is a full procedural scene, that makes the code complex, I will think about if really need to support it.

gameknife commented 4 days ago

I know about rq speedup. I compare speed of rendering with vk_shaded_gltfscene and your renderer on luxball scene. With raytracing pipeline on both renderers and with --present-mode 0 Your renderer 33fps, vk_shaded_gltfscene 129fps on my rtx 3060. Something makes renderer too slow

luxball has big area of ScatterDieletric material, if u change it to Lambertian, my 4070 fps boost from 45 -180fps @ 1080p, the render resulte of ScatterDieletric of vk_shaded_gltfscene seems not right, my impl is almost the same with blender's cycles render

gameknife commented 4 days ago

I know about rq speedup. I compare speed of rendering with vk_shaded_gltfscene and your renderer on luxball scene. With raytracing pipeline on both renderers and with --present-mode 0 Your renderer 33fps, vk_shaded_gltfscene 129fps on my rtx 3060. Something makes renderer too slow

luxball has big area of ScatterDieletric material, if u change it to Lambertian, my 4070 fps boost from 45 -180fps @ 1080p, the render resulte of ScatterDieletric of vk_shaded_gltfscene seems not right, my impl is almost the same with blender's cycles render

if i change to 720p without adaptive sample, fps boost from 100fps -> 400fps

gameknife commented 4 days ago

I know about rq speedup. I compare speed of rendering with vk_shaded_gltfscene and your renderer on luxball scene. With raytracing pipeline on both renderers and with --present-mode 0 Your renderer 33fps, vk_shaded_gltfscene 129fps on my rtx 3060. Something makes renderer too slow

luxball has big area of ScatterDieletric material, if u change it to Lambertian, my 4070 fps boost from 45 -180fps @ 1080p, the render resulte of ScatterDieletric of vk_shaded_gltfscene seems not right, my impl is almost the same with blender's cycles render

finally, I add adaptive sample for material, the metal and glass will gain more samples, and that is always enable, even if adaptive sample set to false. Just fixed it in the latest commit. check the performance when adaptive sample disabled.

tigrazone commented 4 days ago

Light sampling maybe add slowness and wrong. As usual it must be a part of next event estimate(NEE) process with MIS

tigrazone commented 4 days ago

I checked new commits with rayQuery. it is very fast. thank you!