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 / Mini Map Resolution Problem

Author
Message
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 28th Sep 2007 01:15
Hi All, There should be a very simple solution to this but I cant find it and its driving me nuts. My problem relates to the triangle images I'm using as minimap icons for Ships in the radar on the HUD. Its the crappy resolution of these that is the problem. When the triangle faces up (i.e. due north 0 degrees) its fine, but when it turns to say 10 degrees to the left it looks bad, not sure how to describe it other than it looks blocky and kind of like the graphics you'd see in an 8 bit machine like a ZX spectrum.

The triangles were made in PSPro and I pasted them onto small plains in BD (then use set object PlainNo,1,0,1 to eliminate any black pixels). I've experimented with different triangles in PSP (i.e. 16x16 pixels to 256x256) but no joy.

Can anyone suggest a way to improve the resolution of these minimap icon graphics?

Thanks.
Comrade Robski
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 28th Sep 2007 16:22 Edited at: 28th Sep 2007 16:22
Perhaps an obvious answer is to increase the size of the images you are using: this will increase the resolution of the texture if you keep the object the same size.

One other point is that in general you get better results using square images that are 2^n pixels in size - e.g. 2x2, 4x4, 8x8, 16x16, 32x32, 64x64 etc etc will result in better, less distorted textures, at least in my experience.
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 28th Sep 2007 16:36
possibly rotate the picture externally in the paint program - have one long strip with it at 0deg,30deg,60deg,90deg.......270deg,300deg & 330deg

then load it as a bitmap and use the get image command to get each of these images

then put on your little mini map thing




obviously change the actual words, that's just an idea for the framework


However this would use a lot of images, but it's the only idea I can think of off the top of my head.

http://jamesmason01.googlepages.com/index.htm
Mr Tank
22
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 28th Sep 2007 17:33
Make sure you are using "set object" right - with filtering on. Also maybe you should be using mipmapping. If your image resolution is much higher than the resolution of the patch of the screen you can see it in, you can get sampling problems. Mipmapping solves this. Alternately you could just blur the edges of the triangle image a bit -this is what mipmapping does anyway.

Obviously people could give better advice if you gave a clearer explanation, or the code and media.

Also you are using black as transparency. Not entirely sure how well this works. There are particular transparency flags you should use in theis case if i remember right. Also maybe look into using images with an alpha channel- the alpha channel can be mipmapped and filtered, but i've got a feeling the black as transparency doesn't work like this.

SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 2nd Oct 2007 00:05
Thanks all for your suggestions. I've tried blurring the edges (no joy) but will investigate mipmapping (which I've never used before), although it sounds like it wont work if all it does is blur the edges. I have a good feeling experimenting with the alpha channel might work (good idea Mr Tank).
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 4th Oct 2007 12:36 Edited at: 4th Oct 2007 13:04
Hi Again, unfortunately I am having no joy whatsoever, therefore I am appealing to anyone who has the time to look at the attached code and simple triangle images to see if a better resolution solution can be found.

If you turn the little triangle left and right (left and right cursors) you'll see what I mean about the resolution being crap, and zooming and out (z and x) also helps illustrate the problem. e.g. when the triangle is at say a 30 degree angle then the 3 lines that make it a triangle don't look very straight.

Cheers in advance

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Oct 2007 21:35
It's the problem with pixels. At odd angles and short line lengths, the pixels are gonna show up. Even with antialiasing and dithering, there are still little tiny boxes that are on or off, and the less in a row the pixels are, the more they will be evident. Possibly curving the sides or having another image superimposed under the first that fills in the blanks and increases in intensity as the original gets smaller or changes it's angle (an alpha blending technique perhaps) might help, but you want to avoid it looking square I guess.

If it's not of too much consequence to your endeavors, try finding those angles that you think it looks the best at, and only allow rotation in increments that hit those angles (or at least hit them often). If 45 degrees is the sweet spot, try rotations at 3, 5 degrees, 9 degrees, or 15 degrees. If 60 and 45 degrees are the gems then 3, 5 and 15 degree increments might work

Enjoy your day.
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 7th Oct 2007 12:04
Thanks Latch and Demon breath, this does seem to be the best approach.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Oct 2007 20:04
One more Approach possibly - The guy who made T.Ed Terrain editor sold here - on his site has a program that takes a model and makes a ton of sprites of it in every position and angle. (Not Every - but enough for a radar likely!)

Give it a go. http://www.d-grafix.com

Called: SpriteForge

Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 24th Oct 2007 06:15
Thanks to all for your posts. Shawn of starwraith has provided the best solution and I decided to post it here in case anyone else comes across this problem and does a search.

Solution: Apply guassian blur and save as jpg. The png images I was saving as dont work well with DB for this sort of thing.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Oct 2007 16:24
Don't you get horrible greyish colours where it is supposed to be semi-transparent?

Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 25th Oct 2007 05:50
No, not if you ghost it

Login to post a reply

Server time is: 2025-05-31 21:06:28
Your offset time is: 2025-05-31 21:06:28