Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deformation motion blur not working/failing #46

Open
kubo-von opened this issue Feb 18, 2020 · 13 comments
Open

Deformation motion blur not working/failing #46

kubo-von opened this issue Feb 18, 2020 · 13 comments

Comments

@kubo-von
Copy link
Contributor

Hey @boberfly !
It seems deformation motion blur is not working.
Test scene:
mb_optimized
gaffer Sphere animated with transform node, deforming alembic mesh, deforming hair.
render:
Screenshot from 2020-02-18 21-51-14

The sphere is working (probably because it's transform blur, but also it seems like the bbox of the mesh is clipping it ), mesh is not working, the hair I didn't manage to render, when it's in the scene and motion blur is enabled the batch render fails.

Files here:
https://drive.google.com/drive/folders/1j53KiEvSqaYjyhjS3wrtUbSx1SSzlZqG?usp=sharing

Cheers!

@boberfly
Copy link
Owner

Hey @kubo-von
I'm guessing these geos have stable topology? Also does it have motion steps? I'll take a look soon, thanks for the test data.

@kubo-von
Copy link
Contributor Author

Yeah it's just deformation, no topology changes. The Alembics were exported with 2 motion blur samples from Houdini. I've just checked it's working in Gaffer Arnold:

Screenshot from 2020-02-18 23-40-28

@boberfly
Copy link
Owner

Hey @kubo-von

This one is a bit of a head-scratcher for me to meet in the middle what Gaffer is sending to the renderer (basically just the shutter open/close frames) and what Cycles wants (shutter open, frame itself and close frames) and the Blender converter code is confusing, so it'll take me a bit of time (fixing transform blur first). My assumption right now is that in the transform case, it only has the open and close values but not the frame itself so it is glitching, I'm experimenting with a simple linear lerp of the two values but this might need to scale better by re-sampling relative to shutter open/close and if there's more samples than just 2.

I've figured out the crash at the end of batch rendering already (turns out you can only modify the default camera and not replace it with your own as it is book-keeping some data that it gives to the device and asserts if there's a mismatch).

Cheers!

@kubo-von
Copy link
Contributor Author

Hey @boberfly

Ah right, that explains the glitches with transform I'm getting. Thanks for looking into this!

I've also checked if cycles handles motion blur on meshes with changing topology and it seems not yet, it's waiting for D2388
Some workaround are doable though, like Flip Fluids addon which is adding prev and next frame blenshape deformed by the velocity, this could be even done by users even when exporting the alembic cache once the deformation blur is working.

Cheers!

@boberfly
Copy link
Owner

That's more of a blender-specific patch, you can do something similar today with an OSLCode node that pushes the verts with a velocity primvar.

Anyways, I had the system explained to me clearly and it sounds like I am on the right track, but I'll need to lerp a few verts and matrices (fortunately Cortex rocks and has everything I need to do this).

@boberfly
Copy link
Owner

Some progress: Transform is fixed but I'm not sure if the blur streak should be shrinking with more segments, I need to see what Arnold does here (increasing transform segments) but it seems wrong to me? Anyways, onto deformation now once I get a bit of time again.

@boberfly
Copy link
Owner

Got the fix here: b436617

The parts I'm not too sure about are the multiple motion segments and camera shutter for accuracy against Arnold, but that is hopefully the easier part.

@boberfly
Copy link
Owner

Screenshot_20200225_020544

@kubo-von
Copy link
Contributor Author

Awesome! Just tested it and seems to be working great.

I wanted to do some more tests with more motion steps (I assume that's what motion segments are?) and compare to Arnold. But could not find where top set these ? In Blender cycles it's per-object attribute. I've tried adding custom "motion_steps" attribute but no luck.

@boberfly
Copy link
Owner

The settings are in a StandardAttributes node. I'm seeing the motion streak shrink with more steps so I am wondering now if Blender does this as it could be a bug in Cycles itself.

@kubo-von
Copy link
Contributor Author

kubo-von commented Feb 25, 2020

Ah, right, sorry, don't know my gaffer nodes well enough yet :)

I see that too in gaffer. It doesn't seem to happen in Blender, but rotating object with one step looks like this there, and the motion steps have no effect what so ever, so it seems it's doing something else under the hood.

blender_cycles

On similar rotating object in gaffer I get what I would expect with 1 step:

Screenshot from 2020-02-25 18-23-36

@boberfly
Copy link
Owner

Fixed:
https://github.com/boberfly/GafferCycles/releases/tag/0.18.0

Not sure about the rotational arcs though, might not be working yet.

@kubo-von
Copy link
Contributor Author

Awesome, thank you!

Yeah seams the transform motion blur in rotation is still doing linear steps.
Screenshot from 2020-02-28 12-34-50

Not a biggie, unless you're doing chooppers and propeller planes I guess :D

Here's my simple test scene if it helps:
https://drive.google.com/file/d/1rjNI8f5p7ECDBPmgsO_AAmWOAO3w10l4/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants