Code Monkey home page Code Monkey logo

Comments (6)

PatrickYns avatar PatrickYns commented on September 15, 2024 3

@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.

from inkpainter.

activegear avatar activegear commented on September 15, 2024

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

from inkpainter.

PatrickYns avatar PatrickYns commented on September 15, 2024

Any update on that? @activegear @lilfighterr ?

from inkpainter.

Jyri-K avatar Jyri-K commented on September 15, 2024

@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?

from inkpainter.

Jyri-K avatar Jyri-K commented on September 15, 2024

@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 :)

from inkpainter.

iozsaygi avatar iozsaygi commented on September 15, 2024

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.

from inkpainter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.