Create erasable surface


Try to draw it by hand, you have to see that your model is transparent in parts.
Because we are going to do the same by code and we have to be sure that other things work.


So I should make another texture with some sections missing like it’s been scratched and see what happens to the model?


Yes, to ensure it works. It’s not a big deal, but help you a lot.


Okay, with the scratched texture on it, the areas that should be transparent aren’t, they show the same brown color I’m using for the border


Try to change alpha channel of opacityMap


The whole image just fades in and out. The background plane is visible when the alpha is low, but the image elements behind it don’t appear


Play with it, I can’t help :frowning:


I misunderstood what an opacity map was, the areas I want to be be transparent need to darker than the areas I want to be opaque correct?

Either way, this seems to work but it doesn’t render properly when i launch. The entire scratch surface disappears.


Hm. You have RGBA colored image. So your A should be 0. Any other doesn’t matter.

It should be PNG obviously.


Idk what I did, but I re-uploaded the image and it worked somehow.
As I say that, I click launch and the plane is missing again.
Then I tweak the alpha while launch window is open and it comes back with the scratch marks on it…


Probably because of different opacity color channel.

You see - currently it’s R . (red). So you have to draw semi-transparent image in PNG and change to A (alpha channel)


Explains why it wasn’t working before. I’ll have to change that and try playing around with it some more later, but atm my damn laptop keeps crashing so I need to get some repairs done. Hopefully won’t take too long.


Okay, come back when it’s done.


Okay, alpha channel is working with png (need to wait until the end of the week to get laptop fixed, so will just bear with it).


Did you mean “bear with it”?


whichever spelling of the word is correct, yes


Okay, i’ll keep that in mind.


Going back to this, do I need to do something here instead of just logging to console that we got there?


On a slightly off topic note, I found this example of creating a drawing surface using html that has an eraser function. Would something like that work with a pre-rendered image?


Nope, it’s different.

Yes, in this callback you have to copy texture from your temporary map to main one.