Function to load DDS in "already made" models

Blitz3D Forums/Blitz3D Programming/Function to load DDS in "already made" models

Paolo(Posted 2006) [#1]
I haven't tested this so much but until now
the function is working good,

1- First, create a new folder to save all
your .dds textures.
2- Convert any texture to dds and save it
into the folder USING THE SAME TEXTURE NAME but
with .dds extension of course.
3- Paste my code anywhere but be sure it is
scanned before your main loop so that
the Global variable gets the correct value.
Add the correct value to the Global, this is the
path to your dds folder (for example ".\DDS\")

4-Now, use the LOAD_DDS(mesh) for each
mesh you want to replace the textures, the function only works
for single meshes, not for childs, if you have an animated mesh
you will have to use the function with each child.

Basically the function search for a texture with the same name
into the dds's folder, and if found, the texture's brush is changed so
that it uses the dds texture.



Paolo.


markcw(Posted 2006) [#2]
can you not just open an "already made" file, find the texture filename strings and changed the extension to dds, or better yet, just use a program eg. ultimateunwrap3d?

wouldn't using this method also mean you have to load the old texture as well as the dds?


fredborg(Posted 2006) [#3]
Or simply convert the mesh file :)

This will convert any mesh file and save a copy as "filename_dds.extension" with all texture file references replaced by .dds reference.



Paolo(Posted 2006) [#4]
I don't understand how I didn't see this

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



... I simply thought only the LoadTexture() was working with dds ... :)

but anyway ... Fredborg !!! that function is great, and beyond
my understanding with all those "asc" "asc" and more "asc" :)

Paolo.


markcw(Posted 2006) [#5]
must have been the excitement of finally having dds support.
i'm excited about it too, although i'm not sure why as i don't have a project that would need them. :(

dds = Asc(".") + (Asc("d") Shl 8) + (Asc("d") Shl 16) + (Asc("s") Shl 24)
this is a macro to write a fourcc (four-character code), which is neater and simpler than writing each byte separately, instead you write it as an integer/dword and bit shift the ascii value by the appropriate amount to get it's integer equivalent.


Mustang(Posted 2006) [#6]

... I simply thought only the LoadTexture() was working with dds ... :)



Yes, but when you have old models you need to change the structure so that they automatically load .dds's (if you have converted the old textures first of course). "New" LoadTexture() is good too but doesn't help with old models that have embedded non-dds texture references.


fredborg(Posted 2006) [#7]
@Mustang: Go get a cup of coffee and scroll up a bit :)


Naughty Alien(Posted 2006) [#8]
Fredborg..is this upgrade means that Giles will be updated by DDS support?? I would like to buy it if it is case..


Paolo(Posted 2006) [#9]
also, I can confirm the ALT+TAB bug,
minimizing the window while running in full screen make the
dds textures buggy ...


GF2-mx200 winxp DX9.0c

is this the case for all cards?


Paolo.


Dreamora(Posted 2006) [#10]
Ask Nvidia why they implemented a buggy/incorrect algorithm previous to GeForce4 (especially on your Geforce1 GPU which is what GF2 mx is) ...

btw: Alt - Tabbing always is critical with Blitz3D and fullscreen ... Not only with DDS.