Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object ID is the same for every object #319

Closed
dibli-goost opened this issue Jun 8, 2022 · 13 comments
Closed

Object ID is the same for every object #319

dibli-goost opened this issue Jun 8, 2022 · 13 comments

Comments

@dibli-goost
Copy link

Malt version

Release

Blender version

Blender 3.1.2

OS

Windows 10 64x

Hardware info

AMD Ryzen Threadripper 1920x 12-Core Processor, 3950 Mhz, 24 Logical Processors | 32GB RAM | Radeon RX 570 Series

Issue description and reproduction steps

In the image below, notice that there is a bit of a weirdness regarding how Malt is generating the lines on the Eye, which is a separate object from the face mesh.. labeled with green is a pure white material, labeled with red is a pure black material, Malt generates a black line around the eye, but is truncated in the middle of it, pointed out with a blue arrow.

image

The issue here is that Malt doesn't necessarily distinguish between the objects (or materials), you have to give Malt a unique value for one of these materials. Packing a uvec4, we can give them a unique one, and you'll see it correctly generates the lines:

image

To reproduce using the attached blend, simply plug the Object ID into the PPO.id, and you will see that it changes nothing regarding the way the lines are rendered, presumably whatever the Object ID is outputting is the default input for the PPO.id? Whatever that value is is the same for every object.

Attachments

Malt Line Width Bug.zip

@pragma37
Copy link
Member

pragma37 commented Jun 8, 2022

I don't get that line issue on my end (?):

imagen

Are you using the latest version?

presumably whatever the Object ID is outputting is the default input for the PPO.id?

Thats indeed how it works. By default the first id channel has a unique value for every object and the other channels are just initialized to 0 so you can use them however you want.

The first channel is also used for detecting self-shadows so it can be useful to override it in some cases.

Whatever that value is is the same for every object.

You can easily check if that's the case by generating a color based on the object id. In my case it works as intended:

imagen

@dibli-goost
Copy link
Author

Are you using the latest version?

I think I was on the latest update before 3.2, but I went ahead and updated Blender to 3.2 and malt to the latest release to match the one you just released. The problem is still occuring:

You can easily check if that's the case by generating a color based on the object id. In my case it works as intended:

imagen

image

I know that there have been issues with AMD hardware before, could that be the case here?

@pragma37
Copy link
Member

pragma37 commented Jun 9, 2022

I just made the test on my AMD Windows 10 laptop and it works fine.
But it certainly looks like a driver-related issue.

Figuring hardware-dependent issues can be a pain if I can't reproduce them locally.
I'll prepare some tests when I have some time.

You can try posting the log file (see the attachment instructions), there might be relevant info.

@dibli-goost
Copy link
Author

dibli-goost commented Jun 9, 2022

malt 2022-06-09(13-28).log

Let me know if there's anything else I can do!

@pragma37
Copy link
Member

pragma37 commented Sep 4, 2022

Could you open this blend file with this BlenderMalt build installed, switch the viewport to render mode and post the log file?

@dibli-goost
Copy link
Author

dibli-goost commented Sep 6, 2022

malt 2022-09-06(05-00).log

This is what I'm seeing in the viewport, not getting the blue color I usually get as seen above, seems to be generating them properly here.

image

Made sure to check some other project files on that build, returns the usual blue color. Same exact value for each object in the scene.

@pragma37
Copy link
Member

pragma37 commented Sep 6, 2022

That's weird...
Although they're good news I guess? XD

Could you try to edit the scene until it breaks?
For example:

  • Add a light.
  • Add a different material/node tree to some of the cubes (Use Random > Per Object, for example).
  • Import one of the objects that don't work in other scenes.

It would also be useful if you could post the log of a (minimal) non-working scene. (Set the number of samples to 1 in the world settings so the log is not too large)

@dibli-goost
Copy link
Author

(Just kinda writing things down as I experiment with them)

Adding a light doesn't change anything. Editing the cubes doesn't break them. Creating a new material A ok.

All objects that I directly create seem to be broken. I thought before that they were getting a blue colored id, but I guess that's just because of me hashing them or whatever. Using vector 3d instead. completely black. I don't think that they are generating an id at all.

Some of the objects in the test file are lacking values too. Cubes 4 and 9. Random Per Object works normally on all the existing cubes, except 4 and 9! Those are getting the exact same color, objects that I create are getting that same color as well.

image

Here's an updated test project + log, i've apended one of my body meshes, added a light, and created an extra cube.

id_test2.zip

malt 2022-09-06(10-56).log


"All Objects That I Create" includes duplication and linked duplication of the objects that are working fine, Always breaks.

However, If I create an instance of the collection containing your cubes, cubes number 4 and 9 seem to revert to normal. the entire top row of cubes that were instanced break. (Deleting the instance reverts cubes 4 and 9 to be broken). Duplicating the instance of the collection fixes the previous instance. But even more cubes are broken on the last row. Duplicating it AGAIN.. all of the cubes are fixed. Duplicating it AGAIN, well it looks like the first one in the series. They break in a repeating pattern.

(Brightened the world bg for the gif so that things are more clearly visible here. All black cubes are completely black, they have no value)
cube series


Finally, created a new project and added a cube, set the material to check the id. No value.. Here's the blend file and log.

New Project id test.zip
malt 2022-09-06(10-56).log

I did also try linking/appending one of the non-broken cubes from the other project, they break.


Oh, and I just checked the latest Material Examples (node ux ver) objects, those are broken though. No idea what it is about the cubes in the id_test project you gave me that has prevented them from breaking, most of them anyways.

@pragma37
Copy link
Member

pragma37 commented Sep 6, 2022

This is quite weird. There doesn't seem to be anything wrong in the logs.

The IDs are generated correctly.

There must be an issue when uploading the data to the GPU, or maybe at binding time.
But it's super weird that it happens with IDs and it doesn't happen with object matrices, for example.

Here's another modified version.
BlenderMalt.zip

Does it work?
If it doesn't, do the non-working IDs have a different hash color or are they still bluish?

@dibli-goost
Copy link
Author

dibli-goost commented Sep 7, 2022

That seems to have fixed it for me!

All objects are getting properly generated ids now as far as I can tell. Both the id node and random per object seem to work.

@pragma37
Copy link
Member

pragma37 commented Sep 7, 2022

Nice!
But we can't do in the main version what that version is doing, since it would be very slow.

I think I know what the root issue is, though.
If this version works, we can fix it in the main version:
BlenderMalt.zip

@dibli-goost
Copy link
Author

Yep that seems to fix it for me too. Glad to see this get resolved. Should we mark this issue as closed then?

@pragma37
Copy link
Member

pragma37 commented Sep 7, 2022

Yay! finally. This was a hard one. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants