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
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
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.
I think there are missing some Forum-sections as beta-testing and support
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
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...
I think there are missing some Forum-sections as beta-testing and support
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
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.
I think there are missing some Forum-sections as beta-testing and support
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
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:
RGBA or BGRA won't make any sense for terrain so use RGB or BGR to keep files small.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
%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
Last edited by ReneMiner; 14-05-2013 at 21:31.
I think there are missing some Forum-sections as beta-testing and support
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:
can be replaced with faster equivalent:While lDstPxlX > %Cell_Texturesize lDstPxlX -= %Cell_TextureSize cmX += 1 Wend While lDstPxlZ > %Cell_Texturesize lDstPxlZ -= %Cell_TextureSize cmZ += 1 Wend
The following:cmX = lDstPxlX \ %Cell_Texturesize + 1 ' -- Integer division cmZ = lDstPxlZ \ %Cell_Texturesize + 1 lDstPxlX = Mod(lDstPxlX, %Cell_Texturesize)+1 lDstPxlZ = Mod(lDstPxlZ, %Cell_Texturesize)+1
can be replaced with faster equivalent:While lSrcPxlX > 256 : lSrcPxlX -= 256 : Wend While lSrcPxlZ > 256 : lSrcPxlZ -= 256 : Wend
Tip: Distance calculationlSrcPxlX = Mod(lSrcPxlX, 256)+1 lSrcPxlZ = Mod(lSrcPxlZ, 256)+1
This:
can be replaced with:dDist = Sqr( Pow(lX,2) + Pow(lZ,2) )
PetrdDist = dist(0, 0, lX, lZ)
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
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
you'll need to add the "- 1" at end of this line.' 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) '...
Greetings from seamless screwed cheerio-hills
Last edited by ReneMiner; 14-05-2013 at 19:15.
I think there are missing some Forum-sections as beta-testing and support
Bookmarks