Revert "Use the same object id across object submeshes"
This reverts commit 45bc00d298
.
This commit is contained in:
@@ -40,7 +40,6 @@ GPU_SHADER_CREATE_INFO(workbench_next_mesh)
|
||||
.vertex_in(2, Type::VEC4, "ac")
|
||||
.vertex_in(3, Type::VEC2, "au")
|
||||
.vertex_source("workbench_prepass_vert.glsl")
|
||||
.storage_buf(WB_OBJECT_ID_SLOT, Qualifier::READ, "uint", "object_id_data[]")
|
||||
.additional_info("draw_modelmat_new")
|
||||
.additional_info("draw_resource_handle_new");
|
||||
|
||||
|
@@ -19,9 +19,5 @@ void main()
|
||||
workbench_material_data_get(
|
||||
resource_handle, ac.rgb, color_interp, alpha_interp, _roughness, metallic);
|
||||
|
||||
#ifdef WORKBENCH_NEXT
|
||||
object_id = int(uint(object_id_data[resource_handle]) & 0xFFFFu) + 1;
|
||||
#else
|
||||
object_id = int(uint(resource_handle) & 0xFFFFu) + 1;
|
||||
#endif
|
||||
}
|
||||
|
@@ -5,7 +5,6 @@
|
||||
#define WB_TILE_ARRAY_SLOT 2
|
||||
#define WB_TILE_DATA_SLOT 3
|
||||
#define WB_MATERIAL_SLOT 0
|
||||
#define WB_OBJECT_ID_SLOT 1
|
||||
#define WB_WORLD_SLOT 4
|
||||
|
||||
#define WB_RESOLVE_GROUP_SIZE 8
|
||||
|
@@ -80,7 +80,6 @@ class Instance {
|
||||
void end_sync()
|
||||
{
|
||||
resources.material_buf.push_update();
|
||||
resources.object_id_buf.push_update();
|
||||
}
|
||||
|
||||
void object_sync(Manager &manager, ObjectRef &ob_ref)
|
||||
@@ -203,8 +202,6 @@ class Instance {
|
||||
ResourceHandle _handle = i == 0 ? handle : manager.resource_handle(ob_ref);
|
||||
|
||||
Material &mat = resources.material_buf.get_or_resize(_handle.resource_index());
|
||||
resources.object_id_buf.get_or_resize(
|
||||
_handle.resource_index()) = handle.resource_index();
|
||||
|
||||
if (::Material *_mat = BKE_object_material_get_eval(ob_ref.object, i + 1)) {
|
||||
mat = Material(*_mat);
|
||||
@@ -245,7 +242,6 @@ class Instance {
|
||||
|
||||
if (batch) {
|
||||
Material &mat = resources.material_buf.get_or_resize(handle.resource_index());
|
||||
resources.object_id_buf.get_or_resize(handle.resource_index()) = handle.resource_index();
|
||||
|
||||
if (object_state.color_type == V3D_SHADING_OBJECT_COLOR) {
|
||||
mat = Material(*ob_ref.object);
|
||||
|
@@ -23,7 +23,6 @@ void MeshPass::init_pass(SceneResources &resources, DRWState state, int clip_pla
|
||||
state_set(state, clip_planes);
|
||||
bind_texture(WB_MATCAP_SLOT, resources.matcap_tx);
|
||||
bind_ssbo(WB_MATERIAL_SLOT, &resources.material_buf);
|
||||
bind_ssbo(WB_OBJECT_ID_SLOT, &resources.object_id_buf);
|
||||
bind_ubo(WB_WORLD_SLOT, resources.world_buf);
|
||||
if (clip_planes > 0) {
|
||||
bind_ubo(DRW_CLIPPING_UBO_SLOT, resources.clip_planes_buf);
|
||||
|
@@ -148,7 +148,6 @@ struct SceneResources {
|
||||
TextureFromPool depth_in_front_tx = "wb_depth_in_front_tx";
|
||||
|
||||
StorageVectorBuffer<Material> material_buf = {"material_buf"};
|
||||
StorageVectorBuffer<uint> object_id_buf = {"object_id_buf"};
|
||||
UniformBuffer<WorldData> world_buf = {};
|
||||
UniformArrayBuffer<float4, 6> clip_planes_buf;
|
||||
|
||||
|
Reference in New Issue
Block a user