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 / Texture not the same size as original image

Author
Message
Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 14th Feb 2003 00:45
Hi

I have this weird problem and I can't figure out how to fix it.

Imagine two textures which should fit together seamlessly. The top border of the first should match the bottom border of the second. Now I created those textures using Photoshop and fixed their size to 500x500. They fit together seamlessly, I double checked with Photoshop.

Now if I grab those two textures from a bitmap using
Get Image image number,0,0,bitmap width(bitmap number)-1,bitmap height(bitmap number)
for each texture.
Then fit them on to two matrixes which are positionned one next to the other using
Prepare Matrix Texture

Now I noticed that the two textures don't fit together anymore, it looks like a couple of pixels are missing at the border of the texture. Now you can see the transition between the two textures/matrixes.

Anyone able to help?


This is how I set up my matrixes
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 14th Feb 2003 01:25
First off, with get image you have to add 1 to width and height as it only grabs 'upto' bottom right.

so to grab a 256*256, you need to grab 0,0,256,256

This is REALLY stupid and is not a natural way to grab.

Also try experimenting with an extra ,1 on end of get image commands as it stops the anti-aliasing.

I love it when a plan comes together
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 14th Feb 2003 02:32
Forgive me for being utterly bemused as to why "get image i,0,0,256,256" should do anything other than getting a 256x256 image? If DB was an art package then perhaps I could understand it, but to use a zero-based offset for image grabbing would confuse the hell outta people.

The way it's setup at the moment I can load Photoshop, create a 256x256 image, save it and use it without worrying I've got my pixels cropped anyway.

Gilfalas - don't use "load bitmap" and then "grab image". Just use "load image" and save yourself the hassle, it will then get rid of the "missing pixel border" problem as well.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 14th Feb 2003 10:27
Thanks Rich

Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 14th Feb 2003 10:47
Hmmm.. I tried but it still doesn't fit.
Still looks as if some pixels were missing. The trouble is I am using a satellite image as texture for my matrix. In order to make it look as if my plane is flying over a continous surface, the textures have to fit exactly together. Otherwise it looks fake.

It sems to me, after takeing your advice, that the problem comes from mapping the texture to the matrix, not from loading the picture actually.

Got any more advice please?

Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 14th Feb 2003 10:48
My pictures are 500x500
Should I go for something like 640x640 in size?

Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 14th Feb 2003 11:37
my bad... texture should be 256x256

sorry for asking stupid questions

Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 14th Feb 2003 16:21
Yes, 256x256 or you could try 512x512 as well, but sometimes a video card won't like this. Try it and see!

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming

Login to post a reply

Server time is: 2026-07-21 21:27:15
Your offset time is: 2026-07-21 21:27:15