New Blitz3D Update Available!

Blitz3D Forums/Blitz3D Programming/New Blitz3D Update Available!

marksibly(Posted 2006) [#1]
Hi,

Blitz3DUpdate197.exe is now available from the 'product updates' section of the 'Account' page.

Here are the additions to versions.txt

Fixed PlayMusic case sensitive file extension issue.

LoadTexture now loads compressed '.dds' files.

TextureBuffer() returns 0 for compressed textures.

Compressed anim and cube textures not yet supported.

Only DXTC modes 1, 3 & 5 are currently supported. Modes 2 & 4 are pretty much never used in the industry, even
NVidias own DDS exporter for Photoshop now only supports modes 1, 3 & 5.

The loader code stricly adheres to the DDS format, files saved from Photoshop using NVidias DDS exporter will
work fine. If you're getting errors, it could be that your DDS file is non-standard.

The mipmap flag is ignored when loading DDS textures. Instead, if the DDS file contains mipmaps, then they are
loaded & used.

DDS textures will load when used by meshes that are loaded using Blitz3D's various load mesh commands.

Usage tips:
If your texture does not have an alpha use mode DXT1
If your texture has a 1 bit mask, use mode DXT1a
If your texture has a smooth gradient alpha, use mode DXT5

Added MeshCullBox for manual mesh culling. This allows you to correct some situations where an
animated mesh extends beyond the guesstimated bounding box.


Enjoy!


LineOf7s(Posted 2006) [#2]
All I can think to say is: w00t!


puki(Posted 2006) [#3]
LoadTexture now loads compressed '.dds' files


Isn't that what that "Tom" boy was working on? He might cry. Still, at least we got it prior to "Beaker" dying of old age.


skidracer(Posted 2006) [#4]
Puki, you can thank Tom and Mark for this landmark release.


ashmantle(Posted 2006) [#5]
I'll extend my thanks to Tom and Mark aswell.. Thanks guys! Made my day!


puki(Posted 2006) [#6]
Ah, okay - I though "Sibly" stole it from "Tom".


marksibly(Posted 2006) [#7]
Yep, I stole it from Tom!

Actually, the code is 99% Tom's - I just added some sanity checking etc.


HNPhan(Posted 2006) [#8]
omg, this is so nice!


Picklesworth(Posted 2006) [#9]
Great update!

I have to say, though, I miss not having the product updates list.
What if I was gone for 2 weeks? How would I have found this? I would need to have thought about checking Product Updates under my account, and I would have to remember which version of B3d I had.

Anyway, don't want to turn this into a discussion about forums, so I'd best conceal that suggestion.
Yay, DXTC!! :)


SopiSoft(Posted 2006) [#10]
Great addition, that of .DDS D3DXTextureFormat support! :D


HNPhan(Posted 2006) [#11]
'im mostly happy to be able to load in custom mip maps (can do some weird FX with it...)


LineOf7s(Posted 2006) [#12]
Where's Mustang? He's going to wee his knickers!


serverman(Posted 2006) [#13]
Ok, next stop: stencil shadows :-P
Nice additions indeed!


xmlspy(Posted 2006) [#14]
Very nice Mr. Sibly


Naughty Alien(Posted 2006) [#15]
..its working fine..try it already..stencil shadows next, pleaseeeee.. :))


Mustang(Posted 2006) [#16]

Where's Mustang? He's going to wee his knickers!



:)

Never thought I'd see this day - now Tom needs to code tangent space normal map support and render to textures and I would be 100% happy...

BIG thanks to Tom and Mark for this update! Shows people who thought Blitz3D is dead that it isn't so.


John Blackledge(Posted 2006) [#17]
Thanks, Mark. Good to see that you're still involved with everybody's favourite language.


semar(Posted 2006) [#18]
Thank you Mark for keeping Blitz3D alive !

Sergio.


QuickSilva(Posted 2006) [#19]
Fantastic! Thanks guys :)

Jason.


Damien Sturdy(Posted 2006) [#20]
Awesome! This should keep things going for a few more years! :D


Shambler(Posted 2006) [#21]
Did I just hear several jaws hit the ground? ;)


Dreamora(Posted 2006) [#22]
Thats great news :-)

Small question: *ready to hide behind a stone* Did the ConvertToDXTC command of Toms DLL make it way over to B3D 1.97 as well to compress uncompressed textures?


GfK(Posted 2006) [#23]
What's a DDS texture, then?

And what's DXTC?

Great update I'm sure but the new stuff doesn't look to have been explained too well....


Barton(Posted 2006) [#24]
DDS and DXT feature is great !!

I have now after DDS update of my Game 60 MB More Graphics Memory !!!


Tom(Posted 2006) [#25]
Gfk: DDS = Direct Draw Surface, it's also the term used, and file extention used, for storing compressed textures on HD.

DXTC = Direct X Texture Compression, just another term for it.

A DDS texture, is a texture that uses one of 5 DXTC modes to compress the texture data. All DX7 compatible GFX cards should support it (if they don't... well, they're not DX7 compatible cards then). The GPU on your GFX card decompresses the texture data using hardware each time it's used, and it's all done lighting quick, so there's no delay at all.

The result is that DDS textures take less room in video memory, and because the compression is hard coded, the saving will always be the same.

There are 5 compression modes, but only 3 are supported in this update, and in fact, you'll probably only ever need to use 2 of them, DXT1 and DXT5

DXT1 is best used when your texture has no alpha information in it, or, if your texture will be masked. DXT1 can also store a 1bit alpha channel (all that's needed for masked textures). The space saving is 8:1 i.e, a DXT1 or DXT1a texture will only use 12.5% of the video memory a RAW/PNG/BMP texture would use! And of course, you get the same space saving on HD :)

DXT3 and DXT5 are both used when your texture has an alpha gradient (i.e greater than 1bit), both use 4bits of information for the alpha channel. But where DXT3 uses an explicit alpha, DXT5 automatically interpolates the alpha channel so as to smooth out its appearance. If you saw my DDS demos you may have noticed how a smooth alpha gradient appeared 'stepped' when using mode DXT3, but looked much smoother using DXT5.

Dreamora: If I can get that function to be less hacky, I'll ask Mark about it. I want to get this stuff working with cubemaps, that'd save a ton of vid mem, and also safe blitting (copyrect), so we'll see how it goes.


serverman(Posted 2006) [#26]
@GfK: DDS is a DirectX texture format (like .X is the DirectX 3D mesh format). The special about it is that it can be compressed without loss (I believe). There is tool in the DirectX 9 SDK named "DirectX Texture Tool". With it you can convert textures to the DDS format.

Uncompressed 1024x1024 texture: 3 MB
The same texture with DXT1 compressed: 513 KB


@rtur(Posted 2006) [#27]
Great additions, thanks!


Barton(Posted 2006) [#28]
I have now a Bug with DDS Textures.
After pressing the ALT+Windows Keys (Back to Windows) and reopen the Game-Window, the Textures are damaged.

here a Screenshot after minimization and maximization the Game-Window. Please copy the link

[URL]http://img301.imageshack.us/my.php?image=bugmc4.jpg [/URL]


ashmantle(Posted 2006) [#29]
Gfk: download nVidia's free photoshop plugin if you've got photoshop!

http://developer.nvidia.com/object/nv_texture_tools.html


serverman(Posted 2006) [#30]
@Barton: O.o OMG this looks really weird. Can anyone confirm the "ALT+Windows bug"?


Dreamora(Posted 2006) [#31]
And if you don't have Photoshop, download DirectX SDK, it has a free standalone something to DDS converter


OrcSlayer(Posted 2006) [#32]
My most sincere thanks to Tom and Mark for getting this into an official Blitz update. Nothing beats full integration!


Mustang(Posted 2006) [#33]
http://en.wikipedia.org/wiki/DirectDraw_Surface

http://en.wikipedia.org/wiki/DXTC


FOURCC Description Alpha premultiplied? Compression ratio Texture Type
DXT1 Opaque / 1-bit Alpha N/A 8:1 / 6:1 Simple non-alpha
DXT2 Explicit alpha Yes 4:1 Sharp alpha
DXT3 Explicit alpha No 4:1 Sharp alpha
DXT4 Interpolated alpha Yes 4:1 Gradient alpha
DXT5 Interpolated alpha No 4:1 Gradient alpha



...If someone still needs more info, but Tom basically said it all already.

Tom, do you have any clue how to do "render to texture" with Blitz3D?


jfk EO-11110(Posted 2006) [#34]
Great news, thanks a lot! It seems blitz3D is far from a "closed case". Tho - Barton just opened a new Pandora box... But anyway, why the heck has anybody got to press Alt-Win during the game ?!?
;)
Well, in my engine an average level just hit the 128 Megs borderline, so this comes in very handy, making my games playable on "small" cards again.


serverman(Posted 2006) [#35]
A good and free programm to create DDS textures with MIP maps and DXTC: http://www.ati.com/developer/compressonator.html


Panno(Posted 2006) [#36]
wow


Thanks for the Update Mr.Sibly.
Thanks for the Code Tom.

glad too see this


Warren(Posted 2006) [#37]
Is anyone pushing Blitz3D hard enough that they're running out of video memory?


Paolo(Posted 2006) [#38]

LONG LIFE TO GODS

MR. SIBLY
MR. TOM
MR. BLITZ3D :)

Great work, thanks a lot ...


...ok people, what do you say?
as Cygnus said above, this is really bringing a lot
of more life to this great language ...

Paolo.


Dreamora(Posted 2006) [#39]
WarrenM: Sadly yes, with T.ED or RealmCrafter MegaTerrain you are able to ... 64x 512x512 + Mipmaps already ranges in the 80mb range where it isn't much work to get to 128mb after all.
But sadly those apps only accept image formats and not DDS, so a convertToDXTC would come very handy.


Tom(Posted 2006) [#40]
Dreamora: Those apps only need a quick recompile in 1.97 for them to be compatible. I take it they're current apps that are still being updated? Hound the authors! :)

Barton: Well spotted (the bug). According to the DX7 help file it's a known issue, surface memory can be freed when the application loses focus, or the gfx card is given exclusive access by other programs. There are native DX functions to restore the surfaces when this happens, I've passed the info along to Mark.


puki(Posted 2006) [#41]
I should take some of the credit for squeaking on about this.

Let's face it, the only person who has a use for the DDS feature is me.

Right, thanks accepted - you can all carry on as you were.


ashmantle(Posted 2006) [#42]
@puki: megalomania?


t3K|Mac(Posted 2006) [#43]
very nice mark & tom!!! this is really great! keep up the good work!


Boiled Sweets(Posted 2006) [#44]
Excellent stuff. Keep up the good work guys.


t3K|Mac(Posted 2006) [#45]
@warrenm: the (unfinished) 1st level of my upcoming shooter uses already 112 MB of texture ram... and there is a lot to be done. with dxtc i can cut this down to approx. 14 mb. so you are able to play even with 64 mb on your graphicsboard.

i love this feature ;)


markcw(Posted 2006) [#46]
many thanks for this great update to blitz3d!


slenkar(Posted 2006) [#47]
how can you tell if a texture has alpha?

if you load it with the alpha flag in blitz?


fredborg(Posted 2006) [#48]
Great update! Thanks mark and tom!


Sledge(Posted 2006) [#49]

MeshCullBox



Hurrah!


Opcode(Posted 2006) [#50]
Thanks Mark and Tom, great stuff! :-)


Tom(Posted 2006) [#51]
Slunkar: The mask & alpha flags still work as normal.


IPete2(Posted 2006) [#52]
Mark (and Tom) thanks for this update! Much appreciated.

IPete2.


Ice9(Posted 2006) [#53]
Nice job BR


Dreamora(Posted 2006) [#54]
Very nice addition.

Although I know that they tend to be ignored, might we request:

Compress(texture_handle,dxt_mode)
Uncompress(texture_handle)
(both either returning the handle of the compressed/uncompressed image or doing it on the given texture)
commands so we can "modify" compressed textures or compress textures we generate on the dynamically?


Beaker(Posted 2006) [#55]
Great work Tom and Mark.

Does anyone know what b3d related tools support DDS already (and export them correctly to b3d file)?
Fragmotion? (I know this supports DDS internally)
b3d pipeline?
Unwrap3D? (I know this supports DDS internally)


fredborg(Posted 2006) [#56]
Nope, but this is probably easier than finding out: http://www.blitzbasic.com/Community/posts.php?topic=61874#691437


Beaker(Posted 2006) [#57]
Very handy fred.


Ricky Smith(Posted 2006) [#58]
Wonderful - many thanks Tom & Mark - and thanks fredborg for that very useful little function !

There's life in the old dog yet ! ( I mean Blitz3d not Mark ;)

I will be adding DDS support ( recompiling !) to PaceMaker at once.


Ross C(Posted 2006) [#59]
WHOA! Hehehehehehe, i've been gone for a week and look what happens! Nice one guys. Thanks for this! For me, Blitz3d is complete :D


Boiled Sweets(Posted 2006) [#60]
Wicked! Well done Mark and Tom.


lo-tekk(Posted 2006) [#61]
Simply great, thank you !


gosse(Posted 2006) [#62]
cool


HappyCat(Posted 2006) [#63]
Does DXTC require hardware support? In other words will it still work on older cards?


t3K|Mac(Posted 2006) [#64]
define "older cards"...


fredborg(Posted 2006) [#65]
Riva TNT and ATI Rage cards and older do not support DXTC. But these are both from around 1998, so there probably aren't many around that are still working :)


HappyCat(Posted 2006) [#66]
Would those cards otherwise run Blitz3D stuff?

As I'm sure you're aware, there's a difference between a card having DX7 (or 8 or 9 or whatever) level hardware and being DX7 compatible (with the right drivers), and I was wondering which Tom meant by "All DX7 compatible GFX cards should support it (if they don't... well, they're not DX7 compatible cards then)".

Would be a shame if using DXTC meant that I'd be shutting out cards that would otherwise be able to run my game.


Damien Sturdy(Posted 2006) [#67]
I have a TNT2. *pokes it*. I don't think it likes new systems, but it runs in the old ones fine, and it's fine for blitz.

HappyCat: In that case you must make a choice- Keep the texture sizes down or have good visuals and kick out ancient hardware, or just code a "Low quality" mode- which prob isn't worth it these days...


HappyCat(Posted 2006) [#68]
Yep - I was asking so that I could try to make that decision :-) Thanks for the info.


t3K|Mac(Posted 2006) [#69]
pah, tnt2 is waaaaay old ;) i don't care about those old cards... if my game runs fine on radeon 9700 or higher, everything will be fine.


serverman(Posted 2006) [#70]
As long as your card is DirectX 7 capable everything should be fine.


skidracer(Posted 2006) [#71]
Riva TNT and ATI Rage cards and older do not support DXTC.


Add to that list Matrox Millennium G550 and Matrox Millennium G450, the problem with these cards is from my experience they never die...

If you do want to target ancient computers then I personally would be looking at targetting a 400mHz Pentium2 with a 16MB 3D card without DXTC. I've tested games like Platypus and early versions of Cletus and both worked fine on this configuration.

It is a minimal market that only a minimal number of Blitz3D programmers will be interested in but I don't think that makes it any less legitimate.


(tu) ENAY(Posted 2006) [#72]
Wow great news, I can't believe I missed it! :)


puki(Posted 2006) [#73]
Yeh, now go back to your mission with "George Bray".


markcw(Posted 2006) [#74]
Add to that list Matrox Millennium G550 and Matrox Millennium G450, the problem with these cards is from my experience they never die...

would anyone happen to know what the GeForce minimum is? I couldn't quite find the information but i gathered it was a GeForce 2, ie. that GeForce 256 doesn't support compressed textures.


Andy(Posted 2006) [#75]
>would anyone happen to know what the GeForce minimum is? I
>couldn't quite find the information but i gathered it was
>a GeForce 2, ie. that GeForce 256 doesn't support
>compressed textures.

DXTC is a DirectX6 feature, and Geforce 256 was a DX6 card, so it does DXTC. On the other hand, there some problems with the Geforce 256's handling of DXTC in 32bit mode, but I am not sure if it was software or hardware related and/or ever fixed.

TNT2 does not have DXTC.


Andy


Pinete(Posted 2006) [#76]
absolutely fantastic!!
Really it's a great update!
the next step could be stencil shadows in order to continue
the updating of Blitz!!
To have DDS and Stencil shadows could be a dream!!

Thanks for your work mark and Tom!!!, thanks!!


Weetbix(Posted 2006) [#77]
This should be great!


MadJack(Posted 2006) [#78]
For the less knowledgeable of us (meaning me), how does MeshCullBox work? What are its parameters?


Tom(Posted 2006) [#79]
MeshCullBox x#,y#,z#,width#,height#,depth#

x,y,z is where you want the center of your cull bounding box to be, width,height,depth are the extremes of the bounding box.

I think when an animated mesh is loaded the bounding box is set from frame 0. But the animation in some meshes causes vertices to go beyond the default bounding box, hence the new option to make the cull bounding box bigger so you can cover those extremes.


lo-tekk(Posted 2006) [#80]
@Boiled Sweets: Hi pal,

as i opened this topic, mozilla requested me to give logindata to your website x-times. That's real annoying. Pls change your sig or repair your homepage.

Best regards


big10p(Posted 2006) [#81]
Yeah, me too - using IE. WTF? :/


boomboom(Posted 2006) [#82]
Same using Opera


Floyd(Posted 2006) [#83]
It also stopped me from saving a page he had posted to. The save proceeds for a while and then just stalls.

You can work around this by selecting Hide Signatures in your profile.


MadJack(Posted 2006) [#84]
'MeshCullBox x#,y#,z#,width#,height#,depth#'

Thanks Tom.


Red Ocktober(Posted 2006) [#85]
DoggoneIT!!! DoggoneIT!!!

why didn't someobody tell me about this!!!!!

you'all know old people can't see worth a damn... i didn't see this yesterday, and i DID look...

GREAT STUFF Mark... BIG THX Tom...

what's next... dx9 and shaders??!! :O)

--Mike


Finjogi(Posted 2006) [#86]
Very nice update, Thanks!!


Bobysait(Posted 2006) [#87]
=> 3 Mo on video Ram with 1024*1024 dds
=> 16 Mo with the same in JPg .

Really a good update !
Now, i'd like to know one thing => We should save texturebuffer in dds ? Or we nned to code the export part ?

And final question :
is that if we create a texture, and apply effects on it, it can get the optimisation of dds format ?
Like glowing screen on a copyrect ? I'm sure my question is absolutely stupid, but, in any way it can, i'd be surprising glad :)


D4NM4N(Posted 2006) [#88]

WarrenM: Sadly yes, with T.ED or RealmCrafter MegaTerrain you are able to ... 64x 512x512 + Mipmaps already ranges in the 80mb range where it isn't much work to get to 128mb after all.
But sadly those apps only accept image formats and not DDS, so a convertToDXTC would come very handy.




LOL it will now! Good job team blitz !


After ive done a bit o readin ocourse :)


Can i just ask though, do loaded models autoload DDSs too without retextureing them?


Tom(Posted 2006) [#89]
Can i just ask though, do loaded models autoload DDSs too without retextureing them?


Works with all but LoadBSP() I think.


Mustang(Posted 2006) [#90]
And if it doesn't, you can always use this:

"Function to load DDS in "already made" models"

http://www.blitzbasic.com/Community/posts.php?topic=61874


Tom(Posted 2006) [#91]
Problem there is, BSPs don't save the file extentions. Or at least, that's the case with some Phalastos sent me. As I see it, the LoadBSP routine only needs to be ammended to look for the .dds extention.

I'm making some new CopyRect commands to work with the DDS textures. Blitting from DXTC to RGB is quick, but from anything to DXTC is bit slower, but it works at least. And some SupportsDXT1() functions.

And I've got render to texture working much better now, will post a DLL later.

Tom


Mustang(Posted 2006) [#92]

And I've got render to texture working much better now, will post a DLL later.



YES! OMG! This just gets better and better... (My) Blitz3D development just got "extended play"! :)

Oh, and copyrect stuff is cool too, makes the DXTC functionality complete. What are those support functions? Can we have ability to pack "self/code made" textures?


Boiled Sweets(Posted 2006) [#93]
Whats so cool about the render to texture then?


LineOf7s(Posted 2006) [#94]
Mustang. Wee. Knickers.

'Nuff said. :o)


t3K|Mac(Posted 2006) [#95]
RenderToTexture is much faster than rendering to backbuffer and copyrecting to the texturebuffer.


Mustang(Posted 2006) [#96]

Whats so cool about the render to texture then?



Think about in game mirrors (wall, car), cameras (video, security, hud)... basically anything you can do by rendering the camera view to a texture instead of "big screen" (backbuffer). Not to mention 2D/3D post-effects like bloom and motion blur etc...

"Uses of Rendering to Texture Surfaces":

http://www.gamasutra.com/features/19991112/pallister_03.htm

[not sure if above link requires registering - which is free anyway]


Mustang. Wee. Knickers.

'Nuff said. :o)



Yup, this is getting embarrassing... ;P


Boiled Sweets(Posted 2006) [#97]

RenderToTexture is much faster than rendering to backbuffer and copyrecting to the texturebuffer.



Woah! I do this very thing once a second in Vorboils. It runs at 60 FPS on my low spec machine so maybe doing this type of call relatively infrequently is not a problem.

Is the RenderToTexture likely to become a new function?


t3K|Mac(Posted 2006) [#98]
@tom: what about a new command:

blur_texture(texture,mode,intensity)

this would be really great. if you can let blitz render to a texture i think your dll has faster access to it than blitz with readpixel/writepixel/ and all the stuff.


Dreamora(Posted 2006) [#99]
Problem with Render targets: erm yeah, the systems that have the large problems with it now will still have it as low spec cards (ATI IGP, older Intel onboard, S3, SiS) can't do it either.


Damien Sturdy(Posted 2006) [#100]

RenderToTexture is much faster than rendering to backbuffer and copyrecting to the texturebuffer.



It's faster, but not *that* much faster. Our Fun Racer demo did this every two frames and it was smooth and had almost no performance hit- it took 0fps off of my FPS total :)

(That just means the limit was in the logic not the rendering ;) )


t3K|Mac(Posted 2006) [#101]
ok not THAT fast but faster ;) and less overhead.