forked from blender/blender
Implement instancing for light objects #35
@ -22,7 +22,7 @@ extern struct CLG_LogRef *LOG_RENDER_HYDRA_SCENE; /* BSD - Blender Scene Delegat
|
|||||||
|
|
||||||
class BlenderSceneDelegate : public pxr::HdSceneDelegate {
|
class BlenderSceneDelegate : public pxr::HdSceneDelegate {
|
||||||
friend ObjectData; /* has access to instances */
|
friend ObjectData; /* has access to instances */
|
||||||
friend MeshData; /* has access to materials */
|
friend MeshData; /* has access to materials */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class EngineType { VIEWPORT = 1, FINAL, PREVIEW };
|
enum class EngineType { VIEWPORT = 1, FINAL, PREVIEW };
|
||||||
|
@ -107,13 +107,15 @@ bool InstancerData::update_visibility()
|
|||||||
change_tracker.MarkInstancerDirty(prim_id, pxr::HdChangeTracker::DirtyVisibility);
|
change_tracker.MarkInstancerDirty(prim_id, pxr::HdChangeTracker::DirtyVisibility);
|
||||||
for (auto &it : mesh_instances_) {
|
for (auto &it : mesh_instances_) {
|
||||||
it.second.data->visible = visible;
|
it.second.data->visible = visible;
|
||||||
change_tracker.MarkRprimDirty(it.second.data->prim_id, pxr::HdChangeTracker::DirtyVisibility);
|
change_tracker.MarkRprimDirty(it.second.data->prim_id,
|
||||||
|
pxr::HdChangeTracker::DirtyVisibility);
|
||||||
}
|
}
|
||||||
char name[16];
|
char name[16];
|
||||||
for (auto &it : light_instances_) {
|
for (auto &it : light_instances_) {
|
||||||
for (int i = 0; i < it.second.count; ++i) {
|
for (int i = 0; i < it.second.count; ++i) {
|
||||||
snprintf(name, 16, "L_%08x", i);
|
snprintf(name, 16, "L_%08x", i);
|
||||||
change_tracker.MarkRprimDirty(it.second.data->prim_id.AppendElementString(name), pxr::HdChangeTracker::DirtyVisibility);
|
change_tracker.MarkRprimDirty(it.second.data->prim_id.AppendElementString(name),
|
||||||
|
pxr::HdChangeTracker::DirtyVisibility);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include "BKE_duplilist.h"
|
#include "BKE_duplilist.h"
|
||||||
|
|
||||||
#include "mesh.h"
|
|
||||||
#include "light.h"
|
#include "light.h"
|
||||||
|
#include "mesh.h"
|
||||||
|
|
||||||
namespace blender::render::hydra {
|
namespace blender::render::hydra {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user