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

Fill status #62

Open
lilfighterr opened this issue Dec 21, 2018 · 6 comments
Open

Fill status #62

lilfighterr opened this issue Dec 21, 2018 · 6 comments

Comments

@lilfighterr
Copy link

Hi,

Thanks for this wonderful asset. I'm trying to create a scenario where a texture needs to be painted over to complete a level. Is there a way to determine how much of the texture is painted? For example, I'm looking for something like a percentage that indicates if a texture has been 40% covered by paint.

Thanks.

@activegear
Copy link

@lilfighterr Please let me know if you figured out how to know paint progress ?

@PatrickYns
Copy link

Any update on that? @activegear @lilfighterr ?

@Jyri-K
Copy link

Jyri-K commented Jan 21, 2020

@lilfighterr @activegear @PatrickYns Hi! I’m also trying to figure out how this would be possible? Did anyone of you come up with any solutions or ideas?

@PatrickYns
Copy link

@Jyri-K yes, I've managed to do this with quite some effort. My main inspiration was a Unity project based on Splatoon called Splatunity (or so I recall)
The logic behind it was that we would take the original texture image, and constantly compare it to the newly rendered one. We would have to compare pixel by pixel if it matches, and that proved to be quite heavy performing - as a 2048x2048 image would require you to do 2048x2048 operations everytime you wanted to get a percentage colored.

To further optimize it, we saved the original texture image into a duplicate version that's 16x16, and on every compare function, we would first get the new texture, duplicate it into a downsized version that's also 16x16, and in that case we ended up with 256 operations, which was in theory around x16000 times faster.

We could smoothly do a texture comparison several times every second, all while having a stable 60 FPS on a mid-end mobile device.

@Jyri-K
Copy link

Jyri-K commented Jan 21, 2020

@Jyri-K yes, I've managed to do this with quite some effort. My main inspiration was a Unity project based on Splatoon called Splatunity (or so I recall)
The logic behind it was that we would take the original texture image, and constantly compare it to the newly rendered one. We would have to compare pixel by pixel if it matches, and that proved to be quite heavy performing - as a 2048x2048 image would require you to do 2048x2048 operations everytime you wanted to get a percentage colored.

To further optimize it, we saved the original texture image into a duplicate version that's 16x16, and on every compare function, we would first get the new texture, duplicate it into a downsized version that's also 16x16, and in that case we ended up with 256 operations, which was in theory around x16000 times faster.

We could smoothly do a texture comparison several times every second, all while having a stable 60 FPS on a mid-end mobile device.

Thanks for the reply! Sounds like a promising solution, will have to give it a go :)

@iozsaygi
Copy link

iozsaygi commented Jul 30, 2021

Sorry for being a super necromancer but i am using this tool to paint 3D cube in my project.
I am trying to check if painting is completed by comparing the "imageContentsHash" of textures.
I saved painted texture and I'm comparing current texture (the texture is getting painted) with the texture i saved by using "imageContentHash".
But i didn't manage to make it work. I was wondering if someone here can give me suggestions.

Here is the doc page of imageContentHash: https://docs.unity3d.com/ScriptReference/Texture-imageContentsHash.html

Thanks for any answer, again i am really sorry. Didn't wanted to open a new issue for this because it is already created before.

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

5 participants