LoadDDS, please test.

Blitz3D Forums/Blitz3D Programming/LoadDDS, please test.

Tom(Posted 2006) [#1]
Hi all,

Messing with DX7 'again'. This LoadDDS function should work ok now on hardware that supports it.

DXT1, 3 and 5 are supported, simply because they're the only DXTC formats used by NVidias DDS exporter, so I assume they're the most useful.

Here's the demo: www.tomspeed.com/loaddds.zip
And what it should look like:


Notice banding in the DXT3 alpha compared to DXT5. Looks like 1 & 5 are most useful.

CopyRect doesn't like them, but I have managed a blit from one to another. I haven't tried read/write pixel yet.


Does it look the same for you?
What GFX hardware you using?

Thanks
Tom


warwulf(Posted 2006) [#2]
yeah it looks the same for me =] GJ tom


Naughty Alien(Posted 2006) [#3]
this is great! Its look same on my machine too..

its nVidia 5600FX, 256MB Vram


b32(Posted 2006) [#4]
It works very nice! P4 3,6GHz G-Force FX (laptop) 512 RAM


big10p(Posted 2006) [#5]
I get a single cube rendered on the far left of the screen, on a plain, light blue background (no checkered floor), and then I get the error "Illegal instruction".

Is this even supposed to work on my lowly GeForce2 GTS 32MB, though? I don't know about such things.


Tom(Posted 2006) [#6]
big10p: got a screeny?

If DXT1, 3 & 5 weren't supported the demo would have popped a runtimeerror letting you know, so it should work yes. The fact it doesn't means it's my code.

A search shows there was at one point (many years ago!) a problem with DXT1 on GF2 cards, could be a clue.
http://forums.guru3d.com/archive/index.php/t-1040.html
http://discussions.hardwarecentral.com/archive/index.php/t-27901.html


Phalastos(Posted 2006) [#7]
I get a memory access violation when i start your demo tom.
( AMD 2200+, 512 MB, ATI 9100 64 MB VRAM, Win 98 SE
But very thanks for your hard work!


big10p(Posted 2006) [#8]
Here's the screenie, Tom. It does sound like it might be an issue with DXTC and GF2's though, as you say.




puki(Posted 2006) [#9]
What's the point of this?

Worked for me and my Radeon X800 XL.

Also, this is quite good as Oblivion's textures are all in DDS format - this might save me creating new ones.


big10p(Posted 2006) [#10]
What's the point of this?
O_O


Tom(Posted 2006) [#11]
hehe puki!

With DXTC, you can fit upto 8 times the textures in memory (depending on what DXTC mode you use) than you currently can in Blitz3D, they'll load faster, being smaller they'll transfer to/from the GFX card faster, and you'll also save that amount in disk space.


puki(Posted 2006) [#12]
Just checking.

Off you go and finish it.


t3K|Mac(Posted 2006) [#13]
looks the same on intel915gms. great job again tom!


Beaker(Posted 2006) [#14]
Works fine on my GF4 440mx here.


Tom(Posted 2006) [#15]
Amazing how an onboard chipset just 'works' :)

Beaker noted that the exe was marked as possibly having a virus, this is because I UPX'd it to save on size. Here's an uncompressed EXE if you want it.

www.tomspeed.com/load_dds2.exe


puki(Posted 2006) [#16]
I checked it with 3 different AV products - it was fine for me. "Beaker" is prone to random outbursts.


Naughty Alien(Posted 2006) [#17]
..hey Tom, when some demo sources will be available to play with?


Tom(Posted 2006) [#18]
Just gotta pop out for a half hour, I'll post the demo source and DLL when I get back.

Would anyone getting a MAV or other error, try this:
www.tomspeed.com/load_dds_hicolor.exe

It forces the 512 flag when creating the dummy texture.


big10p(Posted 2006) [#19]
I still get the same error, Tom.


t3K|Mac(Posted 2006) [#20]
will this dll support anisotropic filtering too? atm i have 2 different dlls floating around, one works with the anisotropical filtering, the other with your DXTC stuff. i'd like to have all in one ;)


puki(Posted 2006) [#21]
Any chance of 'geometry instancing'? My card supports it and I leave it enabled. I assume this will have noticeable improvement over 'CopyEntity'. Don't think it is impossible straight away, ATI put a back-door in on this to bypass the DX9 requirements.

Next week is fine by me.


Phalastos(Posted 2006) [#22]
When i start the demo then i see this error.



The next start write : "unable to create 3D scene" :(


SheepOnMintSauce(Posted 2006) [#23]
Works great on my Radeon 9800 Pro. =)


Panno(Posted 2006) [#24]
after 2 cubes i get an MAV


Tom(Posted 2006) [#25]
Can the people with errors try this, type the number it displays here please.

www.tomspeed.com/enumdxtc.zip


puki(Posted 2006) [#26]
Bah, I wish I had an error now.


big10p(Posted 2006) [#27]
31


Phalastos(Posted 2006) [#28]
31


Rroff(Posted 2006) [#29]
You want to use DXT5 if possible, tho not sure a geforce 2 supports that or not... DXT1 has banding issues with non-aplha textures that DXT3 solved, tho as you noticed the same banding issues occur in DXT3 when you use alpha.


KuRiX(Posted 2006) [#30]
Hey Tom, you're just a genius...

Congratulations! and many thanks for this.

P.D: It works perfectly


Panno(Posted 2006) [#31]
31

glad to help


Stevie G(Posted 2006) [#32]
Nice one Tom ... perfect on gfx440mx!


Ross C(Posted 2006) [#33]
Amazing work man :o) Works perfect. Your my hero!!


Ricky Smith(Posted 2006) [#34]
Works fine for me - nVidia 6600LE - bet Ross C. will be pleased !!


markcw(Posted 2006) [#35]
i get the same errors as big10p & Phalastos, illegal instruction followed by a MAV and 31 for error number.

AMD-1.1ghz/ATI Radeon VE-32mb/Win98se/DX8.0


xmlspy(Posted 2006) [#36]
Works fine on my Geforce 6800


Tom(Posted 2006) [#37]
Thanks for the imput guys.

could the people getting errors using the demo in the top link please download this exe and run it in the same folder as the top demo (it uses the same media)

This will give me a clearer indication of where the error is:
www.tomspeed.com/loaddds_debug.exe

It should give you an error code for a specific compressed texture, like 'Error loading DXT1a, code: 5', please paste that info here.

Thanks!
Tom


Phalastos(Posted 2006) [#38]
Hi Tom,

same error with your debug version:




big10p(Posted 2006) [#39]
I still get the 'Illegal instruction' error.


puki(Posted 2006) [#40]
Is there any advantage to this DDS thing if we can use .OBJ files in B3D?


Panno(Posted 2006) [#41]
ahh debug exe. works fine
and the old demo give an mav


smilertoo(Posted 2006) [#42]
works ok here.


puki(Posted 2006) [#43]
I was doing some tests on the Oblivion textures.

An Oblivion stone wall texture was a TrueColour, 170KB, DDS texture - it was using 9,565 unique colours.

Converting it to a BMP inflated the file size to 768KB

I converted the original to a 256 colour, 175KB, PNG texture - which actually resulted in 251 unique colours.

I cannot see any visual difference between the original and my new PNG - file size is roughly the same.

So, at this stage what is the advantage of my DDS texture over my new 256 colour PNG?

In addition, (although I don't know how to do this) would I gain by converting my 256 colour PNG back into a DDS?


Ross C(Posted 2006) [#44]
When textures are loaded in, you can't have 8 bit textures. They get converted to 24 bit/32 bit i'm sure. I don't know if you can have true 16 bit images, or whether they get converted to 24/32.

So, when you load that 8 bit/256 color image, it should get converted. Remember, PNG is a compressed format that uses it's own pallet. This isn't the case with textures being loaded to VRAM.


puki(Posted 2006) [#45]
So, there is no point in reducing the colour depth of a texture?

"Scouse" hurry up and finish this DDS thing - I need it this instant. I am at a crossroads of batch converting Oblivion's textures - having already converted them to PNG once.

This must be drawn to a swift conclusion as it is seriously hampering my geometry - I am having to hand apply the textures and need a resolution of the upmost priority.


Mustang(Posted 2006) [#46]
Hey,

Tom, GREAT stuff! Will you marry me?

First test worked just fine on my Radeon9600XT.

Ppl having problems could also try the usual thing: latest DX, latest (preferably WHQL) drivers and of course latest Blitz3D upgrade?


so I assume they're the most useful.



Yup - you hardly ever need anything else - except unpacked textures of course which we already have. And in few cases some trickery to save memory with normal maps (which can't be (lossy) packed for obvious reasons).


Ross C(Posted 2006) [#47]
This is def great news. Nice to see it working with Radeon cards too :D


Rroff(Posted 2006) [#48]
Seems to be pre DX8 cards that have issues with it... I'll give it a while on my laptop latter and see if it works on there (old ATI Radeon Mobility GPU)

EDIT:

Well it runs fine on my laptop which has an old ATI 7500 equiv. GPU and also my desktop machine which has a 5950ultra.


Red Ocktober(Posted 2006) [#49]
yeah... anything below radeon 9200 or GeForceFX5200 seems to be problematic all over the board... i'm testing it now...

oh yeah, great stuff Tom... kudos and bows to you...

:)

*** added ***

works fine on both GeForce6100 and FX5200...

(a lil jerky on the FX5200, i only got 128MB on the card, so not unexpected)

it appears that i just suffered a PSU system failure on the machine with the radeon 9200 card... too lazy to change out the PSU right now, will look into it later...


--Mike


Ross C(Posted 2006) [#50]
My g4 ti 4600 was a dx 7 card i'm sure when i bought it.


Tom(Posted 2006) [#51]
I'm gonna make a stand alone DLL for this, will post it by tonight.

Puki: Don't be in such a hurry, it needs more work before you go releasing it in your projects.

As far as I can tell, all your cards support all 5 modes of DXTC so there's no obvious reason it shouldn't 'just work'. I'm positive it may be something to do with how I hijack a B3D texture and rewire in my own DX surface.

Check back later.
Tom


Ross C(Posted 2006) [#52]
Good stuff. Take your time, this is the most exciting upgrade blitz3d has had in a while :o)


WendellM(Posted 2006) [#53]
Debug version runs fine here in XP and looks like the shot at top of thread. In 98, I get the same error as Phalastos above. PC specs in sig.


puki(Posted 2006) [#54]
Is it ready yet?


Tom(Posted 2006) [#55]
Wendel: That's odd, it working in XP but not in 98. Gotta be a driver issue.

Puki: This is why DXTC is good! (accurate figure for vidmem are 21.91meg using Bitmaps, and 2.79meg for DDS)



As stated in the pic, the textures look the same but are in fact 16 different bitmaps loaded from HD. The same scene using DXTC even renders slightly faster, not much to write home about, but it's not slower, which is a good thing.


puki(Posted 2006) [#56]
How much better are they compared to PNGs of the same file-size?


WendellM(Posted 2006) [#57]
That's odd, it working in XP but not in 98. Gotta be a driver issue.

I just tried updating my 98 to Catalyst 6.2 (which seems to be the latest available for 98/ME) and got the same result (I was previously using 5.8, which is what XP is using). I tried it with 16-bit and 32-bit color desktop and it MAVs the same.

Might just not be possible on Radeon in 98 (based on other reports in this thread)?


Ross C(Posted 2006) [#58]
PNG's, bitmaps, JPEGS, they all get converted to uncompressed bitmaps in VRAM. The quality of these is the same as what they look like when you save them. Same goes for .DDS textures. Except, DDS textures remain compressed in VRAM.


markcw(Posted 2006) [#59]
my card has an option to use "compressed texture format" when i switch this off i get this error message instead of the illegal instruction/mav message.
"DXT1 not supported in hardware"

AMD-1.1ghz/ATI Radeon VE-32mb/Win98se/DX8.0


Mustang(Posted 2006) [#60]
Since M$ is soon ending all support for 98 I wouldn't sweat too much if something doesn't work in it:


End of support for Windows 98 and Windows Me

Effective July 11, 2006, Windows 98, Windows 98 Second Edition, and Windows Me (and their related components) will transition to a non-supported status. After this date, Microsoft will no longer provide any incident support options or security updates. Microsoft is not offering a custom support agreement for these products.

http://www.microsoft.com/windows98/



Oh, and I tested my laptop too which has Intel's integated GM852/855 and it worked 100% like it should. Amazing really... :)


Phalastos(Posted 2006) [#61]
Hi tom,
i had tested your demo under Win XP and it works fine.
But i hope you find a way to delete the win98se error.
Your ConvertToDXT command ist working fine under win98se.

Can you post a source to see where the error is?


@rtur(Posted 2006) [#62]
Works fine on GF5800 Ultra WinXP SP2


puki(Posted 2006) [#63]
Must be nearly finished.


Tom(Posted 2006) [#64]
puki: Enough links in your sig? :P

I've asked Mark for some info about how textures are stored/accessed in B3D, I'd really love for this to work on all cards.


Defoc8(Posted 2006) [#65]
good stuff tom :]
- puki, i think your missing the point - the dx textures are
stored in video mem as compressed images not raw bitmap
data..using conventional image formats only saves on disk
space - not on video mem usage..or perhaps you didnt
miss the point + are jst being akward ;)


oh and tom - works fine on 9600pro


Pinete(Posted 2006) [#66]
Sorry for the question,
sure it's really silly but..
loaddds2.exe says to me "userlib not found"...

Please, could you say me what's this userlib and
where I could found it??

Thanks in advance!


puki(Posted 2006) [#67]
Have you tried the original version first:
http://www.tomspeed.com/loaddds.zip


bytecode77(Posted 2006) [#68]
great! this could be useful in some casere. on my machine it looks like on the first pic...


Damien Sturdy(Posted 2006) [#69]
I could have died for this one year ago! :(

Excelent work Tom. Glad you continued with it, It'll come in handy and i'm sure we will start seeing some pretty damn hot stuff appearing soon.

We had to limit the racer graphics through lack of DDS. WITH DDS, our current build, using exactly 32mb in 16 bit, would use abour 3.2mb? *That's* impressive! :)


Pinete(Posted 2006) [#70]
works fine for me!

How could we use this amazing lib in our programs???

thanks in advance!


scribbla(Posted 2006) [#71]
works fine here, nice work

radeon 9700 win xp


puki(Posted 2006) [#72]
Must be getting close to finished.


Phalastos(Posted 2006) [#73]
I think tom waits for a answer / help of mark or skid.


big10p(Posted 2006) [#74]
Yeah, it got finished agaes ago, Puki. We all get sent a copy. Didn't you get yours?


*snigger*


puki(Posted 2006) [#75]
Hello?


Tom(Posted 2006) [#76]
Shhh! You'll wake the BRL gods.


Naughty Alien(Posted 2006) [#77]
what? You still didnt received respond from them Tom?


OrcSlayer(Posted 2006) [#78]
Hey Tom, works great on my rig. 256 meg Radeon 9600. All of them look great, except the DX3 does show banding if you look closely...DX5 is perfectly smooth.

Is this still going strong? I would love to get my hands on this technology...I had no idea how useful DX textures were.

Now I see how UT2004 can have so many textures in it's maps!


Paolo(Posted 2006) [#79]
This is an amazing stuff Tom, Congrats!

I'm pretty much pending of looking this inside B3D

... but in the meantime, can you give us some insight about how this will work?
Will there be a LoadDDSTexture() function or what?

Paolo.