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 Professional Discussion / is there any way to control mipmaps?

Author
Message
provoststeven
15
Years of Service
User Offline
Joined: 17th Jul 2009
Location: Irvine, California
Posted: 8th Aug 2009 10:46
I create my mipmaps with the nvidia plugin...only problem is...the mipping is too great, roughly twice as much as it should be. Any help?
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Aug 2009 12:38
Quote: "roughly twice as much as it should be"


What do you mean?

Mipmaps successively subdivide the image by 2 till you get down to 1x1. This is easy if the original image is a power of two, e.g. 128x128 pixels. You will get the following 8 mipmaps: 128x128, 64x64, 32x32, 16x16, 8x8, 4x4, 2x2, 1x1. Things are not so clear if the original image is not a power of two.

For example, I've just tested a 65x47 image and created mipmaps using the MS DXTex.exe utility. This seems to give the following 7 mipmaps: 65x47, 31x22, 15x10, 7x4, 4x2, 2x1, 1x1.
Math89
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 8th Aug 2009 13:15
I think he means that DBPro choose the wrong mipmap (e.g. 128 instead of 256). I'm not sure that it's the case, it would be surprising since DirectX does it automatically.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Aug 2009 22:07
Quote: "I think he means that DBPro choose the wrong mipmap (e.g. 128 instead of 256)."


How would he know that? Anyway, I think you're right it's automatically set by DirectX. You can, however, modify the mipmap that is used. I know you can do this in a shader and you might be able to choose it via the pipeline states in DBPro but I doubt it (i.e. I don't recall seeing a DBPro command for this - I believe it's just full mipmapping or none).

But he should tell us what he means - we're just thrashing around in the Dark otherwise.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Aug 2009 22:32
Without shaders, DBPro will either use mipmapping (at a level decided by DirectX), or not. AFAIK, there's no middle ground.

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Aug 2009 23:07
Quote: "AFAIK, there's no middle ground."


That makes two of us in the Dark.
provoststeven
15
Years of Service
User Offline
Joined: 17th Jul 2009
Location: Irvine, California
Posted: 9th Aug 2009 00:20
Quote: "How would he know that?"


I'm a professional game artist, at my work, I make a lot of 1024 x 1024 texture maps...the result in game is not mipped as much as it is in dark basic (see attatched image). Our game at work uses direct X. Our shaders are very different from the one i'm using right now in dark basic...is there anyway to specify this in the shader?

Attachments

Login to view attachments
aki
16
Years of Service
User Offline
Joined: 8th Nov 2008
Location:
Posted: 9th Aug 2009 03:54
Quote: "see attatched image"

I could be wrong, but at that angle, it looks to be due to a lack of anisotropic filtering. I believe the Styx plugin has anisotropic filtering support, but I would be very interested if you found any free plugins that support it. Or, try forcing it on your graphics control panel.
provoststeven
15
Years of Service
User Offline
Joined: 17th Jul 2009
Location: Irvine, California
Posted: 9th Aug 2009 09:20
I think you're right about the anistropic filtering...i checked out the a couple threads about the styx plugin, and it looks like the solution to my problem. Do you know if it works with shaders?
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Aug 2009 13:31 Edited at: 9th Aug 2009 13:38
Quote: "the result in game is not mipped as much as it is in dark basic (see attatched image). "


That image doesn't tell me anything. What am I supposed to be comparing it with? But aki could be right about filtering being the issue. What about anti-aliasing? Games often take control of that.

Quote: "is there anyway to specify this in the shader?"


Yes. There are a number of commands which give you some control, e.g. tex2Dgrad and tex2Dbias. I have found it almost impossible to find decent documentation on those - but AtomR and I made some progress with tex2Dgrad in a texture atlas discussion around Mar/Apr 09 on this thread:

Learning to write shaders

Edit Corrected reference to date of mipmap discussion.
provoststeven
15
Years of Service
User Offline
Joined: 17th Jul 2009
Location: Irvine, California
Posted: 12th Aug 2009 05:46
styx fixed the problem! thanks guys!

Login to post a reply

Server time is: 2025-06-07 10:39:06
Your offset time is: 2025-06-07 10:39:06