Results 1 to 7 of 7

Thread: Is possible to replace texture part?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Load the colored background as 1 texture into GPU, and then the grayscale in memory. When you want to erase parts of the grayscale, just set those pixels alpha to 0. Reload the grayscale into videomemory after updates, but with certain interval and area. You may also be able to update just a rectangular part of the grayscale image at the time to optimize speed, or split it into a grid of multiple textures. It's similar to game like Worms, where i'd definitely split the texture into say 10x10 set of textures.

    This example few years back for example used such split: https://www.youtube.com/watch?v=cEKD4CNvexU

  2. #2
    Thanks User137, have you a sample code?

    Regards
    Sesilla

  3. #3
    Yeah here is project source, you need nxPascal to compile. I remembered wrong though, this demo is using framebuffer for realtime texture editing. For that reason it propably can't be pixel-perfect, but it's efficient. May be difficult code to digest, i can only barely keep up with it myself. Material map is a separate dynamic array.

    Framebuffer allows things like even rendering actual 3D-models into the texture.
    Attached Files Attached Files
    Last edited by User137; 19-11-2015 at 04:15 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •