On shader changes, make sure these are uploaded in the cases where an expensive object rebuild isn't required #6

Open
Alex Fuller wants to merge 1 commits from boberfly/cycles:volume_shader into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

Hello,

In Gaffer we found that on shader updates to volumes, the volume itself would disappear unless we make sure to re-issue the volume and delete the old one. On further investigation I saw that we could use the same mechanism that other geometry types use: check need_update_rebuild (which I believe is triggered by tag_update calls) first, and then check is_modified() if the previous one fails (which can be triggered when used_shaders gets changed).

My hunch is that Blender normally keeps around the same ccl::Shader object pointer and only updates the shader graph so this was a non-issue, but in Gaffer we re-create the shader on every update, re-create and swap to the new shader. The above change I haven't tried in Blender yet, I'll do this next so it doesn't break things for Blender.

I've also snuck in this MR the get_precision() call for VDB loaders, as I found we need to check precision in an interactive render to determine if we need to re-issue a volume with a different precision.

Hello, In Gaffer we found that on shader updates to volumes, the volume itself would disappear unless we make sure to re-issue the volume and delete the old one. On further investigation I saw that we could use the same mechanism that other geometry types use: check `need_update_rebuild` (which I believe is triggered by `tag_update` calls) first, and then check `is_modified()` if the previous one fails (which can be triggered when `used_shaders` gets changed). My hunch is that Blender normally keeps around the same `ccl::Shader` object pointer and only updates the shader graph so this was a non-issue, but in Gaffer we re-create the shader on every update, re-create and swap to the new shader. The above change I haven't tried in Blender yet, I'll do this next so it doesn't break things for Blender. I've also snuck in this MR the `get_precision()` call for VDB loaders, as I found we need to check precision in an interactive render to determine if we need to re-issue a volume with a different precision.
Alex Fuller added 1 commit 2023-07-27 00:47:22 +02:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u volume_shader:boberfly-volume_shader
git checkout boberfly-volume_shader
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: blender/cycles#6
No description provided.