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 / What's with the lines?

Author
Message
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Mar 2010 03:12
I'm trying to use a matrix to make my terrain.


I get these lines between my tiles. I know that there is a certain amount of "bleedover" that occurs, but how do I get rid of it? Any suggestions?

The fastest code is the code never written.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Mar 2010 03:15 Edited at: 26th Mar 2010 03:16
Here's the image I used. I have tried .bmp, .jpg, .dds with no difference in result.

The fastest code is the code never written.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 26th Mar 2010 03:18
please upload as a jpg or png or something not a 6mb bmp!

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 26th Mar 2010 03:32
All images loaded are prepared with mipmaps if they do not already have them.
load image "C:\Textures\tiles.dds",1,1
This will load the image without adding mipmaps

Hope it helps.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Mar 2010 03:33
Sorry. I was wanting to preserve it as much as possible. Sorry for the post, I figured it out about 20 seconds after I posted. I needed to use:

It's not perfect, but there are no lines now.

The fastest code is the code never written.
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 26th Mar 2010 04:27
thats just what i was gunna suggest trying

Development & Editting
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 26th Mar 2010 06:03
I must say, I was intrigued by your solution. I tried it on a project I am working on. It looks a little better but I still get lines. I don’t understand theoretically it should work.

Quote: "I was wanting to preserve it as much as possible"


load image "C:\Textures\tiles.dds",1,1

Adding a value of one will preserve the image without adding mipmaps.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Mar 2010 14:23
Well, I think the diminsions "should" be 1/imagewidth,1/imageheight....? That's what worked for me. Though it still isn't perfect, the lines are gone.

The fastest code is the code never written.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 26th Mar 2010 20:17
My texture image is 512x512. The first trim values I tried was,

SET MATRIX TRIM 1,1.0/512.0,1.0/512.0

Then I tried it with the tile size 256x256. I have tried every trim value up and down the spectrum. I have set the matrix transparency flag. It did produce some cool effects but I still get lines.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Mar 2010 22:44
Make a simple example code. Try it out. If you still have the same problem, post a screenshot and the code so we can look at it. It may be worth your time to upload your tile image.

The fastest code is the code never written.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 27th Mar 2010 02:29
I have simplified my project into a simple example. Attached is the source code and files. It seems when I added it to my project it looked better because matrix transparency was set. The example has that line commented. It looks even worse. Also in the example are included a snapshot with and without transparency. This doesn’t make sense.

Thank you.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 02:45


Notice the first line to set the display mode. The 5th parameter is for multisampling-- I used a value of 3.
Also, when you load the image, you have to have the 3rd parameter as a 1 to preserve the quality.... Not sure why DBP doesn't do that anyway..?

That change made it work for me. Try it out.

The fastest code is the code never written.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 27th Mar 2010 03:05
I finally understand. This looks so much better. Good job.

Thanks again.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 03:39
No problem.

The fastest code is the code never written.

Login to post a reply

Server time is: 2026-07-26 21:12:20
Your offset time is: 2026-07-26 21:12:20