Page MenuHome

Line Art GPU subdiv fix.
ClosedPublic

Authored by YimingWu (NicksBest) on Feb 8 2022, 4:49 AM.

Details

Summary

Now use evaluated mesh instead of ob->data for loading object. Tested on my Surface Pro with GPU subdiv turned on. This machine doesn't have a discrete graphics card, but since the subdivision is done through OpenGL, I believe it's gonna work correctly in other machines.

Please try testing this on other machines.

Diff Detail

Repository
rB Blender

Event Timeline

This is fine. As the subdivision is evaluated on the CPU here (by calling BKE_object_get_evaluated_mesh, you will generate a subdivision wrapper, which will execute the modifier on the CPU), there should not be any issues regarding graphics card. The GPU subdivision is only done at render time, so that's why the line art was not drawing properly: it was getting the pre-subdivision mesh.

source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
4472–4476

The Mesh that will be returned will be the result from evaluating the subdivision on the CPU not the GPU, so there should also not be any problems regarding vertex weight.

YimingWu (NicksBest) marked an inline comment as done.Feb 8 2022, 2:11 PM

I see. So the evaluation is still always on the CPU.

I was thinking maybe because I'm on integrated graphics there could be a possibility where the gpu checkbox is enabled but in the back-end it's actually not running. That's why I thought maybe someone should check it further. Thanks for the info!

source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
4472–4476

Thanks for the explaination :D so far It's indeed working correctly.

Code LGTM. As you are using the evaluated mesh data, you must get the right one.

This revision is now accepted and ready to land.Feb 14 2022, 10:53 AM
This revision was automatically updated to reflect the committed changes.
YimingWu (NicksBest) marked an inline comment as done.