Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Terrain-Texturing

  1. #21
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Well, developed, documented and simply tested. You can download it here as usually.
    The syntax is without the use of TBGL_GetTextureHandle, simply for example TBGL_GetTextureData(1, %TBGL_DATA_BGRA).

    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

  2. #22
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,436
    Blog Entries
    2
    Rep Power
    158
    Great... I was the whole day busy trying to get it done by freeimage, but somehow that does not load the bmp correctly - now I can skip this and use TBGL...

    To the help:

    Returns ??? I would say String,
    check Equate- Should be %TBGL_Data_xxxx
    Last edited by ReneMiner; 07-05-2013 at 19:52.
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: Windows 11 Enterprise x64 Build 22065 (21H2 pre-release)
    (says the systeminfo. anything else says it were Windows 10 - more or less insider - a lot of the system settings do not function - i could imagine it will not send feedback to microsoft since it always says i need a new app to open that feedback-hub-link. But hey: thinbasic runs well )

  3. #23
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Ooops, right you are. I reuploaded the fixed help file. I need to get some sleep now


    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

  4. #24
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,436
    Blog Entries
    2
    Rep Power
    158
    OK, I'm still playing the texture-man here- now is the following: just for test I tried out different texture-quality - all work fine but if I use %TBGL_TEX_CRISPANISO the font (TBGL_BuildFont used) in slot 1 disappears from screen. Is it hardware-dependend? I thought I got pretty good hardware...

    And however I try - I don't get the water to be translucent as long as the ground below has texture. The link above for trying the switches shows totally different results - I also tried lots of settings - even have all switches available during runtime - only idea that is left is to make the ground from a 24-Bit-Texture since alpha would make no sense here anyway. Maybe I try this now...
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: Windows 11 Enterprise x64 Build 22065 (21H2 pre-release)
    (says the systeminfo. anything else says it were Windows 10 - more or less insider - a lot of the system settings do not function - i could imagine it will not send feedback to microsoft since it always says i need a new app to open that feedback-hub-link. But hey: thinbasic runs well )

  5. #25
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Hi Rene,

    when you specify %TBGL_CRISPANISO, do not forget to specify the anisotropy level parameter. That should do the trick.

    I have updated TBGL to presume default value of 2 for anisotropy, in case user does not specify it and fixed some more typos in the help file. You can get it here as usually.


    Petr
    Last edited by Petr Schreiber; 08-05-2013 at 08:55.
    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

  6. #26
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,436
    Blog Entries
    2
    Rep Power
    158
    Just to demonstrate - I've found a way to mix textures seemless from totally different textures now- here just 2 screenshots
    - sorry, I can currently not upload it here because full filesize exceeds now 100 MB...

    But as you see, I am able to create almost endless terrain-worldspace (2^32^2 Cell-Mehes) in the meantime.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	terrainedscreen2.jpg 
Views:	136 
Size:	122.5 KB 
ID:	8269   Click image for larger version. 

Name:	terrainedscreen3.jpg 
Views:	146 
Size:	77.8 KB 
ID:	8270  
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: Windows 11 Enterprise x64 Build 22065 (21H2 pre-release)
    (says the systeminfo. anything else says it were Windows 10 - more or less insider - a lot of the system settings do not function - i could imagine it will not send feedback to microsoft since it always says i need a new app to open that feedback-hub-link. But hey: thinbasic runs well )

  7. #27
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Very nice Rene,

    I am curious to hear more about the approach you picked. It looks great!


    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

  8. #28
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,436
    Blog Entries
    2
    Rep Power
    158

    Arrow

    OK, I won't keep it a secret... I upload it here but be aware- tB-Minversion 1.9.6 + latest TBGL-Package needed.

    I selected to include a few textures only so you can play a little bit. If you want more textures, place them in BMP-Format into some subfolder of media-folder.
    Textures should have Size of 256*256, else won't work.
    (Press F4 to reload Subfolder-List or click onto some subfolder in list to reload folder-content then when adding textures due runtime.)

    For the interested: All texture-painting is done in sub TERRAIN_Texturize()

    You should choose a small Pointer-Size (1 or 2) to draw fast and dense.
    The larger the cursor the more blend-effect but needs longer.
    If you got a slow computer it's not recommended to use Pointer-Sizes above 5.

    You can convert BMP easily to some %TBGL_DATA_-Format using the Functions TEXTURE_... in unit Main.
    Just write some Sub, you might fire your new sub by changing something in Gadget-Unit, suggest:
    Sub GADGET_ClickMenuitem(), Case %gHelpAbout,
    comment the current codeline there "GADGET_CreateMessage..." and hack the call of your own sub in.
    Thereafter your sub will run if you click on Menu\Help\About...

    convert a BMP by calling like this:
    If TEXTURE_LoadData( "c:\Filename.Bmp", %PreservedSlots) Then 
      TEXTURE_SaveData("c:\Filename.DataRGB", %PreservedSlots)
    
    ' optional you can also use this syntax
    ' TEXTURE_SaveData("c:\Filename", %PreservedSlots, %TBGL_Data_RGB)
    ' but omit file-extension in passed filename then if it differs from format, 
    ' else you'll have a file extension like "Filename.bmp.DataRGB" !
    Endif
    
    RGBA or BGRA won't make any sense for terrain so use RGB or BGR to keep files small.
    %PreservedSlots is some empty texture-slot which is safe to use here.

    @Petr: Texture_LoadData/Texture_SaveData - maybe an idea...but build-in to TBGL probably difficult because this uses "ZLib"

    Edit: Attachement removed - still a lot to do
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	terrainedscreen3.jpg 
Views:	136 
Size:	77.8 KB 
ID:	8272  
    Last edited by ReneMiner; 14-05-2013 at 21:31.
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: Windows 11 Enterprise x64 Build 22065 (21H2 pre-release)
    (says the systeminfo. anything else says it were Windows 10 - more or less insider - a lot of the system settings do not function - i could imagine it will not send feedback to microsoft since it always says i need a new app to open that feedback-hub-link. But hey: thinbasic runs well )

  9. #29
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Hi Rene,

    this is working really nice. I will probably not add any ZLib dependant stuff to TBGL, but I will think about function updating just part of the texture - it could improve the bus transfer speeds.

    Tip: Loop elimination
    The following:
    While lDstPxlX > %Cell_Texturesize
      lDstPxlX -= %Cell_TextureSize
      cmX += 1
    Wend
              
    While lDstPxlZ > %Cell_Texturesize
      lDstPxlZ -= %Cell_TextureSize
      cmZ += 1
    Wend
    
    can be replaced with faster equivalent:
    cmX = lDstPxlX \ %Cell_Texturesize + 1        ' -- Integer division
    cmZ = lDstPxlZ \ %Cell_Texturesize + 1 
    lDstPxlX = Mod(lDstPxlX, %Cell_Texturesize)+1
    lDstPxlZ = Mod(lDstPxlZ, %Cell_Texturesize)+1
    
    The following:
    While lSrcPxlX > 256 : lSrcPxlX -= 256 : Wend
    While lSrcPxlZ > 256 : lSrcPxlZ -= 256 : Wend
    
    can be replaced with faster equivalent:
    lSrcPxlX = Mod(lSrcPxlX, 256)+1
    lSrcPxlZ = Mod(lSrcPxlZ, 256)+1
    
    Tip: Distance calculation
    This:
    dDist = Sqr( Pow(lX,2) + Pow(lZ,2) )
    
    can be replaced with:
    dDist = dist(0, 0, lX, lZ)
    
    Petr
    Last edited by Petr Schreiber; 12-05-2013 at 11:21.
    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

  10. #30
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,436
    Blog Entries
    2
    Rep Power
    158
    thanks for your suggests - I changed it (but not in download yet, there are a few more Sqr's that I changed too, all in Terrain_-altering-subs)

    Mentioning "While" - is there no ElseWhile ?

    You might experience that the water-animation slows down pretty much if the mousepointer points into 3d-view - that's because of TBGL_GetPixelInfo - place pointer above some Gadget as Land-Dialog or Top-Menubar to see the water animated correctly. Show/Hide Water from View-Menu where you also can change water-height or water-texture by turning mousewheel when pointing onto some numeral there.

    PS: I've found some bug related to selection of colors. To fix yourself, check out

    Sub GADGET_ClickFrame
    ' somewhere around line 1817  you find:
    If Between(lY, 0, 4) Then 
      Colour_Current = %clrUser1 + lY + 5 * (Gadget(%gColorBrowse).V + lX)
    
    ' should look like this after fix:      
      Colour_Current = %clrUser1 + lY + 5 * (Gadget(%gColorBrowse).V + lX - 1)
    '...
    
    you'll need to add the "- 1" at end of this line.

    Greetings from seamless screwed cheerio-hills
    Last edited by ReneMiner; 14-05-2013 at 19:15.
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: Windows 11 Enterprise x64 Build 22065 (21H2 pre-release)
    (says the systeminfo. anything else says it were Windows 10 - more or less insider - a lot of the system settings do not function - i could imagine it will not send feedback to microsoft since it always says i need a new app to open that feedback-hub-link. But hey: thinbasic runs well )

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Sphere Texturing
    By zak in forum TBGL General
    Replies: 1
    Last Post: 10-06-2011, 18:40
  2. texturing model by one picture stretched
    By zak in forum TBGL General
    Replies: 3
    Last Post: 11-09-2010, 20:29
  3. M15 texturing - UV Coordinates
    By dcromley in forum M15 file format
    Replies: 5
    Last Post: 06-04-2009, 08:41
  4. 9 terrain matrix
    By kryton9 in forum Resources
    Replies: 13
    Last Post: 05-07-2007, 00:32

Tags for this Thread

Posting Permissions

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