Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: Terrain-Texturing

  1. #11
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,439
    Blog Entries
    2
    Rep Power
    158
    I like speed-ups, especially a few 1000%

    and I altered the IMAGE_SaveBGRA-Function due some idea of Petr
    - to keep compatible with current format I just use a negative value for lWidth when I save the .DataBGRA using now
    File_Put(fNum, STRZIP$(sImageData))
    
    Last edited by ReneMiner; 01-05-2013 at 12:11.
    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 )

  2. #12
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10
    And this is the other one, IMAGE_BGR_to_BGRA:

    Function IMAGE_BGR_to_BGRA(ByVal sBGRData As String) As String
      Local lPos        As Long
      Local pByteIn     As DWord
      Local pByteOut    As DWord
      Local sImageData  As String
      
      '---Create a new buffer of 4 bytes for each color in BGR string
      sImageData = String$(Len(sBGRData)/3 * 4, Chr$(255))
      
      '---
      pByteIn   = StrPtr(sBGRData) 
      pByteOut  = StrPtr(sImageData) 
    
    
      For lPos = 0 To Len(sBGRData) - 1 Step 3
        Memory_Copy(pByteIn + lPos, pByteOut, 3)
        pByteOut += 4
      Next
       
      Function = sImageData
     
    End Function
    
    Please check results because I didn't make any test.
    Last edited by ErosOlmi; 01-05-2013 at 12:51.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #13
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,439
    Blog Entries
    2
    Rep Power
    158
    except the codeline that slipped up somehow to the first line (local lPos) - works perfect.
    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 )

  4. #14
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10
    oops: copy/paste problem. Fixed.

    In general, to get some speed is always preferred to avoid string concatenation and make in-place bytes changes.
    String concatenation is always a complex and memory/cpu consuming due to many allocation/deallocation steps needed every time it occurs.
    Last edited by ErosOlmi; 01-05-2013 at 12:54.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  5. #15
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,439
    Blog Entries
    2
    Rep Power
    158
    Lucky me- the forum is working again - I feared my life is at end

    No- get serious again. I append here because it's about my terrain-texturing stuff which you can see attached to post #13 of this thread. We mastered successful the problem to animate the water in the other thread- but now I got another problem:

    My water was translucent before - means one could see the ground below water-layer. Now I added textures (not in download above) and now the textured ground below water-layer becomes covered by water - the water-animation still is perfect- but I can not look through the water any more. I think it has to do with TBGL_PushBlendFunc %GL_ONE, %GL_ONE and I already tried a lot of combinations there- what can I do so the textured ground becomes visible?
    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 )

  6. #16
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Hehe, maybe you will have to get back to alpha in the end, with alpha premanipulated image - TGA can store alpha and TBGL can load 32bit TGAs.

    There is a nice tool to examine blending modes online:
    http://www.andersriggelsen.dk/glblendfunc.php


    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. #17
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,439
    Blog Entries
    2
    Rep Power
    158
    I think I will use the simple BGRA-format because I can easily add alpha to any pixel as I want. I don't even need to convert the bmp to tga for that - see above: we got a few ways to manipulate and convert image-data already

    Maybe...surprise...got something to code in mind...'til later

    PS: are all those (your linked tool) switches valid? (for example i don't know %GL_ONE_MINUS_CONTANT_COLOR from TBGL)
    Last edited by ReneMiner; 07-05-2013 at 08:56.
    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 )

  8. #18
    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,

    yes they are valid, but not supported on every OpenGL implementation. The equates are defined in thinBasic_glExt.inc, and you can use them with TBGL_BlendFunc and TBGL_PushBlendFunc in case %GL_ARB_imaging imaging extension is supported. To see, if %GL_ARB_imaging is supported, use TBGL_oglExtensionSupport function.


    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

  9. #19
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,439
    Blog Entries
    2
    Rep Power
    158
    Question into the other direction - opposite of TBGL_MakeTexture... is there a way to retrieve the Image-Data-String so I could for example TBGL_LoadTexture(bmp,dib,tga) instantly with native function and get something back like

    myBmp as String = TBGL_GetTextureData(TBGL_GetTextureHandle(textureIndex), %TBGL_DATA_BGRA or whatever possible...)

    as I can retrieve TBGL_GetTextureResolution?
    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 )

  10. #20
    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,

    it is possible, I will add TBGL_GetTextureData to TBGL in ThinBASIC 1.9.7.0.


    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

Page 2 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
  •