Comments (2)
Hi @PtrMan
Could you please tell me which demo and which part of that scene is not converging? In this project I choose speed over ground truth convergence so as to keep the rendering real-time. Having a view inside a mirror reflection of caustics on another diffuse surface that correctly converges would require a deeper light bounce count. In order to speed up the path tracing loop, I often cap the bounce depth to 3 or 4 depending on the surface. To converge what I think that you are referring to would require a bounce depth of 6 or 7. It would still be slow to converge as the reflective surfaces are sampled in a fashion similar to Kevin Beason's smallpt (the original inspiration for this project) - that is, instead of rendering both paths of reflective vs refractive bounces, the renderer chooses at random which path to take every frame. This allows all the rays to be done with their work around the same time which keeps thread occupancy high on the GPU. To correctly follow and render both paths of caustics inside of reflections would increase thread divergence - some non-caustic rays would be done early and they would have to wait for the caustics rays to be done with their work before advancing to the next animation frame.
This is why on most rendering software the preview is liquid smooth and somewhat noisy, but when you leave it still to do the detailed final render, the frame rate hiccups and decreases. I experimented with this style of rendering, but found that pulling the mouse-look out of detailed rendering mode hurt the interactivity of the web-style app too much.
from three.js-pathtracing-renderer.
Hi @PtrMan ,
I just wanted to give you an update. I have replaced the old sampler that was using the one-liner random number generator, fract(sin(seed * large number)) that you find everywhere on the internet searching for 'fast RNGs for GPUs' (GPUs don't have them, you must create your own).
I replaced it with a RNG from iq on ShaderToy, that uses WebGL 2.0 newly-supported functionality of integer hashing using bit shifting and bit manipulations inside the GPU fragment shader. The result is that the Monte Carlo sampling is much cleaner, more random, and has less visual artifacts than the old RNG.
I'm going to go ahead and close out this issue because the new sampler should take care of caustics if you let the path tracer run for a long enough time.
-Erich
from three.js-pathtracing-renderer.
Related Issues (20)
- muti material not supported
- WebGPU port HOT 3
- More abstractions HOT 9
- Using more information from earlier samples HOT 3
- More samples per frame option HOT 63
- More compatibility with three js APIs HOT 2
- Stop a caustic ray if it crosses a surface HOT 3
- Just wondering how you handled something HOT 14
- Blue noise HOT 8
- GLTF viewer textures HOT 3
- sampler2D array HOT 14
- How to use this pathtracer in Freeciv 3D version? HOT 2
- [question] how to debug glsl in chrome? HOT 2
- GLTF_Model_Viewer didn't get the right result? HOT 6
- How to incorporate it into project? HOT 9
- statistical tool: bootstrapping
- Shadow Catcher HOT 1
- Support for a THREE.ParametricGeometry HOT 1
- GLTF_Viewer is not able to load textures HOT 1
- image stretched for BHV point light source HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from three.js-pathtracing-renderer.