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.

Newcomers DBPro Corner / DBPro - Using a JPG with multiple textures within a Matrix

Author
Message
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 6th Feb 2011 16:42
hello,
I have made a matrix texture that is 256 pixles square,
This texture has two textures in the 1st and 4th texture position

no matter how i alter the border of the texture I still get part of either the other texture or the black areas in my looped texture.

can someone tell me how to create a multi texture jpg and use it successfully within a matrix

I have attached the most recent version of my jpg file.

I have tried this with image sections worked out to be exactly 128 pixels within photoshop. it doesnt matter, i still get a border no matter what I do.

what am I doing wrong?
thankyou
kezzla

Sometimes I like to use words out of contents
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 6th Feb 2011 16:43
here is the Jpg I have resorted to in my last attempt

Sometimes I like to use words out of contents

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 7th Feb 2011 02:59 Edited at: 7th Feb 2011 06:26
Just edit it in a paint program so that your borders are correct. I assume you are dividing the matrix texture into a 2 X 2 grid. Therefore, the middle of 256 X 256 texture is 128,128. The revised one here should work.

Attachments

Login to view attachments
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 7th Feb 2011 05:18
hello,
Thank-you LBFN. Does your revised texture work in a matrix on your machine? I still get borders.

That's why the edges of the textures in my image file were so far over the 128 pxl edge, it was an attempt to get rid of the black border lines.

even when I use photoshop to make absolutly sure there is no overlap, i still get the borders.

I have attatched an image file showing the problem

and here is the code I use to load the textures.


Sometimes I like to use words out of contents

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 7th Feb 2011 06:21 Edited at: 7th Feb 2011 06:30
Here is some code I threw together to test this:


It tiles it with the green one at first. If you press the SPACEBAR, it randomly tiles it with the four images (a revised pic is attached - I colored in the black sections with red and blue).

Attachments

Login to view attachments
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 7th Feb 2011 07:06
Did the code you sent and the texture both work fine on your system?
I still get borders with your code and texture.

Image is attached.

thank-you for taking the time to help.

Sometimes I like to use words out of contents

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 7th Feb 2011 14:54
The issue can be resolved by inserting the following in the code:


Put it right after the prepare matrix texture command.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 8th Feb 2011 02:54
Thankyou LBFN

that has fixed the Issue.

Your help Is greatly apreciated

Kezzla

Sometimes I like to use words out of contents
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th Feb 2011 03:12
You're welcome

Good luck with it.

Crabbages
14
Years of Service
User Offline
Joined: 12th Aug 2010
Location:
Posted: 9th Feb 2011 19:06
I run into problems just trying to get the texture to show up.
either all tiles are tiled with 1 part of the image or its completly black. I'll attatch my latest attempt.


(I read that the size of this is aa bit excessive but when i tried to make it smaller it stops working entirely)



Sorry If the code is all over the place I've been trying everything

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 10th Feb 2011 16:41
Two issues. You tried to redefine image 1 after you loaded it and t=1 needs to be placed before the loop. Try this:



Crabbages
14
Years of Service
User Offline
Joined: 12th Aug 2010
Location:
Posted: 12th Feb 2011 21:32
Thank you so much, that got everything running, can't believe thats what the problem was. I'm writing it all down, never again!
Thanks LBFN.

Login to post a reply

Server time is: 2024-09-29 00:26:14
Your offset time is: 2024-09-29 00:26:14