dds MAV

Blitz3D Forums/Blitz3D Programming/dds MAV

Oiduts Studios(Posted 2010) [#1]
I have never used dds textures before. I am trying to have palm trees in my game with alpha on them. I was looking trough the forums and found out that dds was fast an loaded directly to your vram. For some reason when I try to apply the texture with entitytexture, it MAVs. Is there some other way to load these or apply these? I exported the texture in gimp 2.0 with DXT5, i found that in the forums.

Note : I am updated to version 1.103 and I know dds works on my PC because I can run Blitzsky which used dds textures.

EDIT : The loaded texture is reported as 0


Dreamora(Posted 2010) [#2]
sure its exported as DXT5 not DXT5NM


Oiduts Studios(Posted 2010) [#3]
Uh, I do not understand... The options for export through gimp are...
under COMPRESSION:
-BC1/DXT1
-BC2/DXT3
-BC3/DXT5
-BC3n/DXT5n
-BC4/ATI1
-BC5/ATI2
-Alpha Exponent(DXT5)
-YCoCg(DXT5)
-YCoCg scaled(DXT5)

If you need more information please ask.
Thank you for your help


Oiduts Studios(Posted 2010) [#4]
Well I got it to work, I cant believe I overlooked the attributes, they were not in multiples of 4. Well I have another problem, the texture that I applied to it in blitz doesn't line up with the UV map I set up in AC3D. Is there a way to apply an alpha dds to an object with UV coordinates that were already set in a third party program?


Gabriel(Posted 2010) [#5]
Well I got it to work, I cant believe I overlooked the attributes, they were not in multiples of 4.

In addition to being multiples of 4, the width and height should also be powers of 2. They will be converted to powers of 2 anyway, so you may as well get them right from the start.

This may well (but also may not) be related to your UV problem.


Oiduts Studios(Posted 2010) [#6]
Well in addition to the UV problem I also got a Z-Buffer problem. Can someone please tell me the certain attributes I must set up to eliminate the weird overlapping. Oh and what I meant by "does not line up with UV map", i meant the texture is just slapped on there like it where any other object.

EDIT: I don't know exactly what I did but the UV is now perfect. There is still a problem with the z-buffer stuff.


Oiduts Studios(Posted 2010) [#7]
Wow, once again I really cant point out exactly what I did but I solved all of the issues, trees look great,thanks guys.


Ross C(Posted 2010) [#8]
You will get alpha issues due to alpha pixels not having a proper depth. I'm not sure on the specifics of it though.


Rroff(Posted 2010) [#9]
More than about 4 alpha passes will result in z fighthing in the scene... tho there are ways around that - tho they can be a bit complex - usually involving rendering stuff in groups, saving to a buffer while preserving the z-buffer and then swapping to the next group then compositing the final scene - quite a bit of work.


Oiduts Studios(Posted 2010) [#10]
Well I am using the same texture for all my palms so I shouldn't run into any problems until later. I was wondering though, when you see the trees from a distance they are very pixilated, I know this could be solved by anti-aliasing but is there some other technique? I tried anti-aliasing in gimp, but it did not seem to help, I also tried mipmapping in blitz by adding the 8 to the end to loadtexture. Also, I was thinking of solving the issue by appling a texture to the palms without transparency when you are at a distance. The problem is, the trees are made using copyentity, should they be converted into types for this or is there another way to independently apply a texture to a tree judging how far you are from it.


Oiduts Studios(Posted 2010) [#11]
I blurred the dds and now it looks good, it would be AWESOME if we had anti-aliasing though...


Dreamora(Posted 2010) [#12]
antialiasing is a pretty costly thing hardware wise.


Oiduts Studios(Posted 2010) [#13]
Yes but I think anyone would love the option, depending on the computer at use.


Rroff(Posted 2010) [#14]
End user can/will force AA on or off in this day and age anyhow in the drivers... and if they use an nVidia card they can always create a profile for the game/app that enables AA.


jfk EO-11110(Posted 2010) [#15]
BTW there is the Antialias 1 Command in Blitz. If you don't mind if the framerate drops from 60 to 10 Hz, the try it. But I have noticed when you turn it on and off a couple of times, then it stops working, kind of.

A better way to reduce the artefacts is IMHO not to use extreme contrasts in brightness between foreground and background.

Z-Sorting Problems with alpha Stuff is a known Problem. There is a trick that allows to hand-sort things: you have to Reposition all the alpha entities BY POSITION, eg. when you're in the middle of a corn field, you have to position the row that is nearest to the camera first then the second row, then the third... always away from the camera, in two directions, north and south. This, surprisingly, sorts the Z-Buffer of the alpha stuff, even if there are thousands of alphaed entities. Funny, if you do some further alpha entity positioning after that, the sorting is broken again, the weird zfight starts again.

You may play the Demo 8 of my fps engine to see Grass that is hand-z-sorted this way (tho I still have a version uploaded that is using BMPs as Cutscenes for the Movie player, and unfort. there may be a problem with SP3, however)

A further hint to get a perfect Matte Line for DXT5 dds that should be loaded as a masked Texture: Make a second layer of your texture (in Gimp), behind the original one, Blur it and set it's opacy to about 1 or 2 percent. This may also be useful for plain alpha loaded textures.


Oiduts Studios(Posted 2010) [#16]
Well lucky for me I haven't ran into any z-buffer problems for a while, but thanks. I tried running your demo and got a MAV, the loading bar got about 9/10 of the way, is there something I am supposed to do besides changing the resolution?


jfk EO-11110(Posted 2010) [#17]
No, there isn't anything special you have to do.
You could open the config file in notepad and enter a Resolution that fits your needs, the Screensettings utility is a bit outdated (currently using a new one).

You say the loading bar was at 90 percent? So the Game Start and Level Start bitmap was already displayed? This is strange. It should run, with at least 127 MByte of Vram. (It may crash with less).

I guess you have more than that. Probably a Problem with Windows7? I have to say this is plain Blitz3D (1.98 back then), no additional DLLs or so used. Did you have problems with other Blitz apps too?

Ah, excuse me for being off topic.


MadJack(Posted 2010) [#18]
I'm trying to track down an issue Tank Universal's having with Nvidia + W7. Initially it looks like loadsprite is causing rendering glitches and crashes -but I haven't confirmed that yet.

If I do, I'll make a post in the B3d bugs topic...


jfk EO-11110(Posted 2010) [#19]
Can't they stop making new OSes all the time? :) One day this is going to end up like the tower of babylon thingie. "Anyone speak 8086?"

I am now uploading a new version of my 2008 demo. The BMPs have been replaced by MPEG1 movies, this hopefully works on all machines. (But on Blitz Monkeys machine it doesn't seem to be the problem).


Oiduts Studios(Posted 2010) [#20]
Well, I have never had a problem with running any blitz games on my PC, but I do have SLI to. I have ran into some problems with that on other games, when I get home today I will try disabling it and try running the demo again.