Create erasable surface


#61

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.


#62

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


#63

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


#64

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


#65

Try to change alpha channel of opacityMap


#66

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


#67

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


#68

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.


#69

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

It should be PNG obviously.


#70

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…


#71

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)


#72

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.


#73

Okay, come back when it’s done.


#74

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


#75

Did you mean “bear with it”?


#76

whichever spelling of the word is correct, yes


#77

Okay, i’ll keep that in mind.


#78

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


#79

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?


#80

Nope, it’s different.

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