Importing Textures
by Andrew Ziemba · in Torque Game Engine · 12/04/2007 (9:52 am) · 6 replies
I found a bunch of textures that I want to use for my game from a website that claims that they can be used for commercial use without any penalties and it is free. I was very careful not to get textures and use them illegally. Now that I found these precious textures I want to put them onto my world map. I tried to open them so paint the terrain in a rocky texture but it comes up all wierd and blurred and distorted with lines going through everything and it looks nothing like the picture.
Can someone please tell me how to save the texture or how to edit the texture so that it will be compatible? I have a photoshop type program if thats what I need.
Can someone please tell me how to save the texture or how to edit the texture so that it will be compatible? I have a photoshop type program if thats what I need.
About the author
#2
12/04/2007 (10:58 am)
Thanks I'll try it out!
#3
The only information I find related to this, is the same thing over and over again:
"You need to make terrain textures 256x256, save as .png or .jpg"
or
"256x256 .png or .jpg with alpha channel"
I can add textures I've made to these specs all day long, and painting them on a terrain yields nothing but bright white, where my lovely texture should appear. I have one theory- it's a long shot, but I'll try it anyhow and report back here.
My theory in case your wondering, is that my color profile in Photoshop is slightly modified. While I have no trouble doing texture work for any other apps, I'm wondering if this color profile messes with my saved textures showing up on terrain in TGE. Though, this shouldn't be, as I use PNGCrush on all my files before putting them to work... Which removes said profiles. So I don't actually need to test this theory...
So in the end, can someone with deeper specifics point out what format details (for PNG) we should know? IE
- Size is known, 256x256
- Bit-depth seems to be optional between 8-bit and 24-bit... Any benefits to either? I compared file sizes between the two, and it was minimal... Of course more detailed textures may benefit more.
- The alpha channel requirement has been stated a couple times, but not others. Not sure on this one. I thought PNG automatically saved with an alpha channel (when using Photoshop). I've tried with and without, white alpha and black alpha. Still no go on my texture showing correctly.
Any more info would be greatly appreciated. So much so, that I'll be sure to make a TDN page or update an existing one, that holds texture format details.
02/21/2008 (3:30 am)
Hate to revive a dead thread, but after looking around a bit for a solution to my problem, including the TDN, the forums here, and the internet in general a-la Google, no luck.The only information I find related to this, is the same thing over and over again:
"You need to make terrain textures 256x256, save as .png or .jpg"
or
"256x256 .png or .jpg with alpha channel"
I can add textures I've made to these specs all day long, and painting them on a terrain yields nothing but bright white, where my lovely texture should appear. I have one theory- it's a long shot, but I'll try it anyhow and report back here.
My theory in case your wondering, is that my color profile in Photoshop is slightly modified. While I have no trouble doing texture work for any other apps, I'm wondering if this color profile messes with my saved textures showing up on terrain in TGE. Though, this shouldn't be, as I use PNGCrush on all my files before putting them to work... Which removes said profiles. So I don't actually need to test this theory...
So in the end, can someone with deeper specifics point out what format details (for PNG) we should know? IE
- Size is known, 256x256
- Bit-depth seems to be optional between 8-bit and 24-bit... Any benefits to either? I compared file sizes between the two, and it was minimal... Of course more detailed textures may benefit more.
- The alpha channel requirement has been stated a couple times, but not others. Not sure on this one. I thought PNG automatically saved with an alpha channel (when using Photoshop). I've tried with and without, white alpha and black alpha. Still no go on my texture showing correctly.
Any more info would be greatly appreciated. So much so, that I'll be sure to make a TDN page or update an existing one, that holds texture format details.
#4
PNGCrush and OptiPNG are also great tools to clear any munged header information.
Here's what I did using Paint.Net (free and simple to use for demo purposes) to create a terrain texture for TGE.
Open Paint.Net. Created a new document, resized it to 256x256 and painted it blue. Then I created a text element (Arial, 48pt) that reads "Texture". Rough-centered it on the texture and flattened it. Then I saved it as texture.png in tutorial.base/data/terrains. I then ran it through optiPNG to strip any potential header problems (I believe GiMP does this step automatically, but am not sure since optiPNG doesn't seem to do much to GiMP PNG's).
I got into TGE using tutorial.base, pressed F11 to open the world editor, and then F8 to get to the texture editor. I selected Add Material and navigated to where I saved it. I selected "texture.png" and loaded it.
It changed the default texture to my new one.
Have you tried it with a JPG to see if it works?
02/21/2008 (7:12 am)
I believe you should use SuperPNG for correct alpha generation on PNG's from Photoshop. I don't know if it is still an issue but it has been for a couple of versions.PNGCrush and OptiPNG are also great tools to clear any munged header information.
Here's what I did using Paint.Net (free and simple to use for demo purposes) to create a terrain texture for TGE.
Open Paint.Net. Created a new document, resized it to 256x256 and painted it blue. Then I created a text element (Arial, 48pt) that reads "Texture". Rough-centered it on the texture and flattened it. Then I saved it as texture.png in tutorial.base/data/terrains. I then ran it through optiPNG to strip any potential header problems (I believe GiMP does this step automatically, but am not sure since optiPNG doesn't seem to do much to GiMP PNG's).
I got into TGE using tutorial.base, pressed F11 to open the world editor, and then F8 to get to the texture editor. I selected Add Material and navigated to where I saved it. I selected "texture.png" and loaded it.
It changed the default texture to my new one.
Have you tried it with a JPG to see if it works?
#5
I forgot to state, but I used SuperPNG as well, same result with the "white" texture problem. Upon closer examination, it actually looks like my texture at certain angles where you can see the blended points (between the layer below, and the layer with my texture). I dunno if that helps any, though it seems more likely it's a problem with alpha now.
I forgot whether it worked with JPG before or not, so I tried again- same thing. And what's even weirder, is that I changed the base texture layer (in the world editor mind you) to the JPG version of my "default" texture, and added the PNG version of the same texture on another. Upon painting the PNG layer on the JPG layer, a strange effect happened... Strange swirly, almost circuit-board like effects appeared, almost as a sort of texture effect. Not intended obviously, but still interesting.
[edit]
Actually, it was only the JPG texture causing the above mentioned effect...
[/edit]
Before I was using a grey image (not in greyscale, RGB color mode), but this second run I changed it to blue, thinking maybe Photoshop was saving it in greyscale mode and that was the problem. Which it wasn't- now I know for sure my texture is there, just brightened like... 5-6x, about the same as if I did a Brightness/Contrast on the texture in PS, and slid it up to 100%, then another time at 50%.
I've only made one minor engine modification, having made the app window use WS_POPUP in windowed mode to get rid of the titlebar and border. No script changes, the whole "package" I'm working on is basically a modified tutorial.base, only mod being name changes and GUI visual modification.
So I'm at a loss here... One last thing I'm going to try before I go mad- I'll try modifying and saving an existing texture I know works, and see what happens. I know I tried that before, but my memory is pretty lame lately with everything going on around here (ie my house, life, kitchen sink, etc).
One last note, I thought perhaps the ambient level in the world might have been affecting this, but I turned it to black/off, and still the same. Just in case you were going to suggest that...
Anyhow, thanks for the help. Hope to get this solved!
[final edit]
Okay... Don't know how, but everything is working fine now. I seriously didn't do anything, I just added a subdivided grid onto the texture and re-saved under the same specs as used before, and voila. Strange, and discomforting... If I was sure I did something different to make it work, I'd re-trace my steps several times, but I am absolutely sure. Sure because, I've had Photoshop open and have been saving and testing with it open this whole time. I guess I'll not worry about it until it pops again, if it pops again that is.
Well, thanks again for the help.
[/final edit]
[final final edit... really!]
I'm an idiot, and I probably shouldn't be admitting this early in the community experience... Although, I'm not sure this has been specifically pointed out: I didn't flatten the layers down... This seems to be what did it, but I'm still experiencing odd results at random when creating new textures... It seems certain colors aren't cool- I'm working in RGB 8-Bit mode, which is perfectly fine I assume. When I use a creamy green color for example, the texture goes white. If I change that green to a mid-gray, no problems at all. Each time I think I've figured it out...
[/final final edit]
02/21/2008 (8:19 am)
David,I forgot to state, but I used SuperPNG as well, same result with the "white" texture problem. Upon closer examination, it actually looks like my texture at certain angles where you can see the blended points (between the layer below, and the layer with my texture). I dunno if that helps any, though it seems more likely it's a problem with alpha now.
I forgot whether it worked with JPG before or not, so I tried again- same thing. And what's even weirder, is that I changed the base texture layer (in the world editor mind you) to the JPG version of my "default" texture, and added the PNG version of the same texture on another. Upon painting the PNG layer on the JPG layer, a strange effect happened... Strange swirly, almost circuit-board like effects appeared, almost as a sort of texture effect. Not intended obviously, but still interesting.
[edit]
Actually, it was only the JPG texture causing the above mentioned effect...
[/edit]
Before I was using a grey image (not in greyscale, RGB color mode), but this second run I changed it to blue, thinking maybe Photoshop was saving it in greyscale mode and that was the problem. Which it wasn't- now I know for sure my texture is there, just brightened like... 5-6x, about the same as if I did a Brightness/Contrast on the texture in PS, and slid it up to 100%, then another time at 50%.
I've only made one minor engine modification, having made the app window use WS_POPUP in windowed mode to get rid of the titlebar and border. No script changes, the whole "package" I'm working on is basically a modified tutorial.base, only mod being name changes and GUI visual modification.
So I'm at a loss here... One last thing I'm going to try before I go mad- I'll try modifying and saving an existing texture I know works, and see what happens. I know I tried that before, but my memory is pretty lame lately with everything going on around here (ie my house, life, kitchen sink, etc).
One last note, I thought perhaps the ambient level in the world might have been affecting this, but I turned it to black/off, and still the same. Just in case you were going to suggest that...
Anyhow, thanks for the help. Hope to get this solved!
[final edit]
Okay... Don't know how, but everything is working fine now. I seriously didn't do anything, I just added a subdivided grid onto the texture and re-saved under the same specs as used before, and voila. Strange, and discomforting... If I was sure I did something different to make it work, I'd re-trace my steps several times, but I am absolutely sure. Sure because, I've had Photoshop open and have been saving and testing with it open this whole time. I guess I'll not worry about it until it pops again, if it pops again that is.
Well, thanks again for the help.
[/final edit]
[final final edit... really!]
I'm an idiot, and I probably shouldn't be admitting this early in the community experience... Although, I'm not sure this has been specifically pointed out: I didn't flatten the layers down... This seems to be what did it, but I'm still experiencing odd results at random when creating new textures... It seems certain colors aren't cool- I'm working in RGB 8-Bit mode, which is perfectly fine I assume. When I use a creamy green color for example, the texture goes white. If I change that green to a mid-gray, no problems at all. Each time I think I've figured it out...
[/final final edit]
#6
02/21/2008 (12:23 pm)
Heh. That was actually my first question, but I didn't want to ask it! Not sure on the strange coloration issue, though.
Torque Owner Thak
Yes open the file in a photoshop like app and make the image exactly 256 pixels wide and 256 pixels high. Then save the image as a .png or jpg