Make object visibility and instancing creation to be calculated via depsgraph #57

Merged
Bogdan Nagirniak merged 16 commits from BLEN-442 into hydra-render 2023-07-08 10:09:53 +02:00

Purpose

Fix code review comments:
blender/blender#104712 (comment)
blender/blender#104712 (comment)
blender/blender#104712 (comment)

Technical steps

  1. Made getting object visibility from depsgraph without using custom functionality.
  2. Made instancing creation to be calculated from depsgraph. Moved to to use one InstancerData in BlenderSceneDelegate for whole scene.
  3. Removed unused code.

Note

After this PR some code cleanup would be required + do some optimization in instancing creation. This would be done in separate PR.

### Purpose Fix code review comments: https://projects.blender.org/blender/blender/pulls/104712#issuecomment-950874 https://projects.blender.org/blender/blender/pulls/104712#issuecomment-950884 https://projects.blender.org/blender/blender/pulls/104712#issuecomment-950885 ### Technical steps 1. Made getting object visibility from depsgraph without using custom functionality. 2. Made instancing creation to be calculated from depsgraph. Moved to to use one `InstancerData` in `BlenderSceneDelegate` for whole scene. 3. Removed unused code. ### Note After this PR some code cleanup would be required + do some optimization in instancing creation. This would be done in separate PR.
Bogdan Nagirniak self-assigned this 2023-06-23 12:52:46 +02:00
Brian Savery (AMD) was assigned by Bogdan Nagirniak 2023-06-23 12:52:46 +02:00
Georgiy Markelov was assigned by Bogdan Nagirniak 2023-06-23 12:52:46 +02:00
Vasyl Pidhirskyi was assigned by Bogdan Nagirniak 2023-06-23 12:52:47 +02:00
Bogdan Nagirniak added 6 commits 2023-06-23 12:53:07 +02:00
Collaborator

Why not do the instancing optimization here as well?

Why not do the instancing optimization here as well?
Georgiy Markelov requested review from Georgiy Markelov 2023-06-26 20:31:32 +02:00
Georgiy Markelov requested changes 2023-06-26 20:32:08 +02:00
Georgiy Markelov left a comment
Collaborator

These checkboxes don't work properly
image

These checkboxes don't work properly ![image](/attachments/0426e05d-a98a-4314-8125-b367667da872)
Bogdan Nagirniak added 2 commits 2023-06-30 09:50:24 +02:00
Bogdan Nagirniak added 1 commit 2023-06-30 16:36:40 +02:00
Georgiy Markelov approved these changes 2023-06-30 16:55:59 +02:00
Georgiy Markelov left a comment
Collaborator

Works fine.

Works fine.
Bogdan Nagirniak added 1 commit 2023-06-30 20:47:11 +02:00
Bogdan Nagirniak added 2 commits 2023-07-01 02:28:49 +02:00
Bogdan Nagirniak requested review from Brian Savery (AMD) 2023-07-01 02:55:12 +02:00
Bogdan Nagirniak requested review from Vasyl Pidhirskyi 2023-07-01 02:55:12 +02:00
Author
Owner

Why not do the instancing optimization here as well?

Made instancing optimization here as well.

> Why not do the instancing optimization here as well? Made instancing optimization here as well.
Georgiy Markelov requested changes 2023-07-03 15:20:10 +02:00
Georgiy Markelov left a comment
Collaborator

discussed offline about updates issue + comments in code

discussed offline about updates issue + comments in code
@ -529,3 +439,3 @@
DEGObjectIterSettings settings = {0};
settings.depsgraph = depsgraph;
settings.flags = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET;
settings.flags = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET |
Collaborator

use macro DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS here

use macro `DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS` here
@ -48,3 +43,3 @@
void update_as_parent();
void update_double_sided(MaterialData *mat_data);
void pre_update();
Collaborator

Please add comment why this is done in this way

Please add comment why this is done in this way
Bogdan Nagirniak added 2 commits 2023-07-03 19:46:49 +02:00
Bogdan Nagirniak added 2 commits 2023-07-04 11:04:05 +02:00
Georgiy Markelov approved these changes 2023-07-04 11:20:26 +02:00
Georgiy Markelov left a comment
Collaborator

works fine

works fine
Brian Savery (AMD) approved these changes 2023-07-07 19:06:05 +02:00
Bogdan Nagirniak merged commit ca0c3841e2 into hydra-render 2023-07-08 10:09:53 +02:00
Sign in to join this conversation.
No Label
No Milestone
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: BogdanNagirniak/blender#57
No description provided.