- Home /
[Closed] Extracting current state of texture as new texture
So I've been working on some shader texture related project, and I just want to know if it is possible get the current state of a texture as a new texture and then reapply the new texture back to the same object.
For example,
I have a plane that is blue.
I have a cube in the middle of the plane.
I use the wiki depth mask shader on the blue plane.
During run time, the pixels intersecting with the cube will turn transparent due to the shader.
Extract the current state of the texture of the plane (where the pixels intersecting are transparent) as a new texture.
Replace the plane's texture with the newly extracted texture.
Is such a process possible? if so, how do I extract the current state of a texture as a new texture during run time?
The texture knows absolutely nothing about the effect from the shader - that happens due to the game re-drawing those pixels later on.
So this'll be hard. The only thing I can come up with right away is to sample the screen pixels of a virtual camera that draws the cube, but I have no idea where to start, or if that's a good idea.