Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Mipmapping

Author
Message
Brick Break
User Banned
Posted: 12th Jul 2009 04:42
You heard me- I know how to mipmap, but I can't. Why? I don't know. Have you ever had problems trying to implement mipmapping into your games and either have it not work at all or get these weird artifacts where it looks like someone did a lousy paint job? Now, I don't know whether this just applies to a matrix (Only thing I ever really tried it on), or if it's something to do with Vista not having the drivers for it, but I know that this problem is specific to DarkBASIC Classic. How might I go about getting it to work? Is it a simple matter of using meshes instead of matrices and making sure I have the right drivers, or does it go deeper than that? Could someone shed some light on this?

WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!
Brick Break
User Banned
Posted: 12th Jul 2009 07:53
Bump: Anyone?

WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 13th Jul 2009 18:47
Not sure if you've had any earlier posts on this (I've been out of it for a few days with a broken internet connection ) so I don't know if you've posted code/examples. I apologise in advance if this all proves useless!

Firstly, are you sure your texture actually has mipmap data in it? Images like the .dds files for the alien mutant in Dark Matter One have mipmap levels - if you open them in MSPaint I think you see the same image repeated several times, but getting smaller and smaller. Each smaller image is a higher mip level - a lower-res texture to be applied as the objetc gets further away. (I think in Adobe Photoshop, you're asked which mip level you want to see and edit)

Anyway, if you're only using a standard bmp image then there's only one mip mode. You can have DBC generate mip levels, using "Set Matrix Texture" or (for 3d objects) "Set Object Texture", making sure the third value is set to 1.

Failing that, I'm not really sure off the top of my head. Try looking into the examples under 3d objects for "Set Object Texture". There's a great example program given somewhere, the main caption is "Reduce Swimming Pixels", I'll see if I can track it down later.

Hope this is of some use!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 14th Jul 2009 11:57
Sorry to double post, but I found those examples I was looking for. It took so long as I had to trawl through practically every example program DBC comes with to find what I was after!

Firstly, you should look at Basic3D example 29 (you can get it from the examples menu, or from the Example program given with "Set Object Texture") The other thing is called "Matrix Moulding" - exam04.dba in the matrix 3D help files (you can also find it through the "Set Matrix Texture" help file entry.)

I think the key command is "Set Matrix Texture MatrixNum, TexWrapMode, MipmapFlag" - Make sure the third parameter is set to one, or your texture will have no mipmap levels of detail. Also, you'll need the command "Set Mipmap Mode MipVal". If MipVal is zero, then Mipmapping is disabled, but if you set it to one or two then you should notice the effect on texture smoothing.

I think this'll solve your problem. Hope so, anyway!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Brick Break
User Banned
Posted: 14th Jul 2009 21:03 Edited at: 14th Jul 2009 21:04
I know how to use DarkBASIC's mipmapping features, I just can't get it to work on most computers. On some, it's not mipmapped at all, on others the mipmapping is fine, and on my laptop it looks like this:


WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2009 00:28
Is that a matrix?

It looks less like a mipmapping problem and more like the tiles are not in the correct order.

For example, this incorrect tiling :



As opposed to this (correct):



Enjoy your day.
Brick Break
User Banned
Posted: 15th Jul 2009 00:57 Edited at: 15th Jul 2009 00:58
Oh, so now it's my coding? Here's an example that comes with DarkBASIC:


WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!

Attachments

Login to view attachments
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Jul 2009 01:03
OK... There is something wrong with your drivers... I know that example and mine isn't screwed up like that...


Make the path of your enemies easier with Waypoint Pro!
Brick Break
User Banned
Posted: 15th Jul 2009 01:30
Well, I updated my drivers a while back, which fixed a lot of problems, but not this mipmapping thing. Could it be that I'm on the x3100?

WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2009 04:14
Does it look like that if you don't use mipmapping? That looks like a texturing problem. Maybe you should check the settings of the graphics card.

I wonder what would happen if you used emulation mode in DBC.

Enjoy your day.
Brick Break
User Banned
Posted: 15th Jul 2009 04:34
It looks perfectly fine without mipmapping, albeit there is some pixel swimming. In DBPro and other games I don't get that problem.

WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!
feiting shadow
17
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 16th Jul 2009 11:50
This is a really old trick, and it might be a bad idea (so take the old ones and rename them to .bak or something so they're not gone). Find the XP drivers, copy them to a disk or something, then in Vista literally overwrite them.

This used to work for making ME work like XP, since it calls the same functions yet the internals are changed. (why Cedega works in linux for windows games). However if the problem isn't vista, and it's DBC, then I wouldn't do this unless you are familiar with the DOS prompt or if your machine's not holding anything you vitally need. Just a trick I thought I'd share.

Signed
------
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th Jul 2009 13:21
"NOTICE HOW MIPMAPPING SMOOTHS THIS EFFECT"

That was quite funny...

TheComet


Make the path of your enemies easier with Waypoint Pro!
Brick Break
User Banned
Posted: 16th Jul 2009 22:29
@TheComet- Yeah, I grabbed that screenshot deliberately. Glad you caught it!

WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!

Login to post a reply

Server time is: 2024-05-20 09:16:03
Your offset time is: 2024-05-20 09:16:03