Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Rendering Game tokens like in Card Dungeon?

  1. #1

    Rendering Game tokens like in Card Dungeon?

    Hi folks,

    maybe you saw an tutorial/article before that explains how the 2D monster /player game tokens were rendered in games like Card Dungeon or Card Hunter?

    I think it might be some kind of shader as I can't imagine that for each monster a 3D model was build.

    Did you came across over this before?


  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Mike,

    I did a very shameful variation to this in the past:
    - render 8 quads, tightly packed one behind other
    - first quad with proper character, alpha masked
    - the rest with color reset to white, keeping the alpha

    Don't do it at home! (But it worked for objects in longer distance, like these...).
    It was expensive alpha-test wise, but with just a few quads...


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Thanks Petr for your idea. Sounds good, how did it look when you circle the camera around it? I am sure the gaps were showing, or?

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    In original solution, I solved it (partially) by collapsed quads (looked like letter V from top).

    I was thinking about it again now, and I bring new solution with slices + vertical and horizontal beams.


    Petr
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Petr Schreiber; 28-03-2016 at 19:36.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    Looks great. To bad I can't test it with my own images. PNG is not supported and when exporting to TGA, it says the file format is not supported.

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    You should be able to use own TGAs.

    Open your PNG in GIMP and when saving:
    - uncheck the RLE compression
    - choose left down (maybe bottom down, not sure) option

    This way it will work. Loading PNG is possible via custom wrapper using TBGL_MakeTexture + GDIPlus.
    I cannot find it at the moment, but I will try again.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Mike,

    why struggle with TGA, when we can have PNG, right?
    I could not find the code so I wrote it from scratch, please redownload Cards.zip to see, how to load PNG now.

    I made SmartTexture a github project, so feel free to fork and give pull requests...


    Petr
    Last edited by Petr Schreiber; 28-03-2016 at 20:02.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #8
    Awesome Petr, like always. Is there a way to have the image rendered on both sides?

  9. #9
    And what is a tbasicU file again? Been so long away from TB.

  10. #10
    Here is a small result.

    cyclops.PNG

Page 1 of 2 12 LastLast

Similar Threads

  1. TBGL module from Petr Schreiber BimBom - card game
    By ReneMiner in forum TBGL Scripts and Projects
    Replies: 4
    Last Post: 13-04-2014, 22:44
  2. TBGL module from Petr Schreiber Argument - card game
    By ReneMiner in forum TBGL Scripts and Projects
    Replies: 1
    Last Post: 08-04-2014, 18:39
  3. Article: Beyond TBGL: Offscreen rendering, why and how?
    By Petr Schreiber in forum vBCms Comments
    Replies: 14
    Last Post: 18-02-2013, 20:12
  4. how to control rendering contrast
    By Eggman in forum TBGL General
    Replies: 7
    Last Post: 17-01-2010, 09:49
  5. Next thinBasic: how numeric tokens are stored internally
    By ErosOlmi in forum thinBasic vaporware
    Replies: 14
    Last Post: 12-07-2008, 16:47

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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