Comments (6)
@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.
@lilfighterr Please let me know if you figured out how to know paint progress ?
from inkpainter.
Any update on that? @activegear @lilfighterr ?
from inkpainter.
@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 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.
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)
- wipe effect HOT 1
- Ink Painter Texturing Error when using ProBuilder HOT 1
- Adding InkCanvas component at runtime HOT 1
- Solution for Inkpainter with repeated texture. HOT 1
- 2D support HOT 1
- Meshes imported from Blender does not work after SceneManager resets current scene. HOT 1
- Multiple Height Fluids
- Does not work when a texture is tiled.
- Paint size is affected by the size of the object being painted to.
- How to have dripping height paint on Collison?
- How to check what percentage of texture has been painted and how much remaining?
- StackOverflowException when painting on any non-Unity object using WorldPoint or Nearest Surface Point on MousePainter
- Asset won't work once project is built?
- NormalMap Paint didnt work with me on android
- It doesn't work in any ragdoll humanoid
- EXE program file is missing
- Creating an InkCanvas on runtime. HOT 1
- EXE Program Is Missing
- Samples don't work on unity 2022.3.16 with URP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inkpainter.