Open vis-prime opened 1 year ago
Ok found the exact reason !
in the render loop camera.updateMatrixWorld()
needs to be called, no more trails now
the result is quite noisy & shadows are blocky , what could be the reason for that ?
demo : https://vis-prime.github.io/explore-vanilla-drei/?scene=RealismEffects code : https://github.com/vis-prime/explore-vanilla-drei/blob/main/demos/realismEffectsDemo.js
Do you get similar results when drag and dropping that model into the demo scene? Otherwise increase the denoiser's aggressivity by increasing denoiseIterations, denoiseSpecular and denoiseDiffuse. Maybe it could also be an issue with the temporal reprojection pass, what happens if you increase the blend factor of it to a higher value like 0.95?
Also, calling updateMatrixWorld() on the camera should only be done if you have matrixAutoUpdate disabled in your scene like it is the case in the demo scene - is it also disabled in your scene, as I'm wondering if the trailing only happens if you don't call updateMatrixWorld?
on the drag and drop page i don't get the same artifacts
So just to break down everything here are all the special steps I took compared to a generic project
Renderer init
renderer = new WebGLRenderer({
powerPreference: "high-performance",
premultipliedAlpha: false,
stencil: false,
antialias: false,
alpha: false,
preserveDrawingBuffer: true,
})
renderer.setPixelRatio(Math.min(1.5, window.devicePixelRatio))
renderer.setSize(window.innerWidth, window.innerHeight)
renderer.outputEncoding = sRGBEncoding
renderer.toneMapping = ACESFilmicToneMapping
renderer.autoClear = false
Postprocessing stack first pass: velocityDepthNormalPass second pass: SSGI/SSR/SSGDI ,TRAA ,motionBlur
If GI is off I use a renderPass so traa and motionblur can run independently
(also console.log prints composer.passes
any time you change an option)
Exr loader
const exrLoader = new EXRLoader().setDataType(FloatType)
render loop
camera.updateMatrixWorld()
Anything obvious i've missed ? I also haven't done the offscreen canvas thing and did not add any matrixAutoUpdate false anywhere
screenshots SSGI SSGDI SSR
Interesting, I'll check your demo when I have time. Do you get different results when not using TRAA and motion blur?
I'm also wondering if the device pixel ratio could play a role as you get some odd pattering in the images.
Screen goes black or frame freezes when i use SSGI with TRAA or motion blur, something definitely went wrong
i'll re-do the setup and use your example code as starting point , I'll report back with the findings
does anything feel off ?
Update
Things i noticed are
camera.updateMatrixWorld
is required on every frame to prevent the trails
The GI pass has to be on it's own effectPass without the other realism effects
motionblur or traa can be merged on another effectPass
other effects like bloom etc can be merged with either of theses effectPasses
I removed the scaling logic (since the model is built to scale) and i'm getting this random tearing effect
Thanks. So I've added camera.updateMatrixWorld()
to the velocity pass so that shouldn't be an issue anymore. The problem was, that without using a RenderPass, the camera's matrix world would still be outdated when rendering the velocity in the velocity pass causing that trailing.
I recently added in the readme that without using a RenderPass, SSGI has to be in its own effect since that caused some confusion.
I'll try to look into that horizontal tearing, not too sure what could be causing that..
updated to latest
camera.updateMatrixWorld()
no longer required
the random tearing issue still exists (only clue is that once I removed the scaling logic the models became very small compared to before)
this issue can be closed then , I'll make new one for the other issue I found
continuing this thread from twitter https://twitter.com/vis_prime/status/1632602124269023233?s=20
I'm noticing trails being formed which does not happen on the demo page
https://user-images.githubusercontent.com/119810373/223689810-29465e17-b74d-4a98-abb4-fe8a0635d5d6.mp4