2

One way to accomplish this would be to have 4 textures: a pre-scratched texture a post-scratched texture an alpha mask which determines which of the latter textures are visible a "brush" or scratch texture(s) which will be used to paint onto the alpha mask. When the user clicks you would stencil the brush texture onto the alpha mask at the mouse ...


2

Now that I read my question I noticed the bug. I used GL11/GL_TEXTURE_1D instead of GL11/GL_TEXTURE_2D for the second texture, sorry: (def dep-texture (GL11/glGenTextures)) (GL13/glActiveTexture GL13/GL_TEXTURE1) (GL11/glBindTexture GL11/GL_TEXTURE_2D dep-texture) (GL20/glUniform1i (GL20/glGetUniformLocation program "dep") 1) (GL11/glTexImage2D ...


1

I've never implemented any of this stuff before. But from my understanding there's two basic ways you could solve this problem. Decals The simplest solution would be to just to just put simple billboards with "wet" or "clean" materials on top of the surfaces. This has the real world equivalent of placing an animatable sticker on top of ...


1

Select the texture in your Assets folder, and change the Wrap Mode to Clamp. This says that samples near the edge of the texture should clamp to the pixel on that edge, instead of repeat which wraps around to blend with the pixels from the opposite edge (good for when you want tiling effects, not so good for a single quat)


1

When a pixel shader samples a texture (regardless of what kind of texture), it usually does so using the UV coordinates interpolated between the UV coordinates of the vertices of the polygon. The result is a pair of floating point values between 0 and 1. It then uses those coordinates to get the color value of the texture at that point, with 0:0 being the ...


Only top voted, non community-wiki answers of a minimum length are eligible