DavidRoss@Posted: Wed Aug 11, 2004 5:53 pm :
Note: This tutorial is to make a basic sky, it won’t move or do anything fancy, as I myself don’t know how to do that yet. However I wanted to write this basic tutorial because when I was trying to find out how to do it I had to look at a few different threads, and peace together the information.

A bit about skyboxes-All a “skybox” is, is a texture with a shader that points to 6 .tga files. It does not actually need to be a box. If you have a window, all you need to do is put a brush on the outside of it, and apply the texture. Basically the brush with the texture applied to it will act like the “window” into your skybox. So no matter how far or close the brush is to your position, the image on it always looks the same to you.


Getting the 6 .tga files-You could create your own from a program called Terragen ( http://www.planetside.co.uk/terragen/ ) the site says its free for non-commercial use. Or you could go to this site http://www.scentednectar.com/skyboxes/ and download some that are already made.

Convert them to .tga format, and naming them-You will notice that these files are in .jpg format. This will not work with Doom3, so you need to convert them into .tga files. Using Photoshop this is very simple, just paste the image into a file, and then save it as a .tga file.

Save them with “_possition” at the end… so if you want to call your skybox “cloudyday” you would name the six images as follows “cloudyday_left” “cloudyday_forward” “cloudyday_right” “cloudyday_back” “cloudyday_up” “cloudyday_down”

If you get your images from the website above they are already named in such a way that they are easily identifiable, if you have images that are not identified, be careful to get them in the right order, or your sky will have seems.

Putting your images in the right place-
You do not put your images in the texture directory. This is a bit counter intuitive, and it confused me, till I found out were to put them. In your Doom base directory create a directory called “env” inside make another directory called “custom” and put your 6 .tga files in there.

Pick one image (does not matter what one) and put it into base/textures/custom/skies name is simply cloudyday.tga. This is the image you will see in the editor.

Getting your shader ready-

You will need to have a shader to tell Doom3 what to do with your 6 .tga files. The easiest way is to cut N paste what I have into a Text doc. And save it as Customskies.mtr, then place it in your base/materials directory.

Code:
/////////////////////////////////////
textures/skies/custom/cloudyday
{
      qer_editorimage   textures/custom/skies/cloudyday.tga
   noFragment
   noshadows
   nooverlays
   forceOpaque            // so transparent windows can draw on top of it
   {
      blend      add      // so transparent windows can draw on top of it
      cameraCubeMap   env/custom/cloudyday
      texgen      skybox
      texgen         wobblesky .0 .0 .0
   }
}
/////////////////////////////////////////


When you want to create another sky, you do not need another .mrt file, you simple make another instance of the script inside the .mrt file and change the variables on it.



BNA!@Posted: Wed Aug 11, 2004 7:38 pm :
Nice one - thanks!



HaZarD@Posted: Thu Aug 12, 2004 3:54 am :
Ive been doin this for the past hour or so and it still doesnt work. The qer_editorimage will show up just fine but it always turns out black ingame or in render mode. If I save the map and open it again it gives a warning sayin Size Mismatch cant load cubemap. I have no idea what that means. All the images are .tga 24bit all 512x512 including the qer_editorimage one. I have no idea what the deal is! Any ideas?



DavidRoss@Posted: Thu Aug 12, 2004 4:01 am :
HaZarD wrote:
Ive been doin this for the past hour or so and it still doesnt work. The qer_editorimage will show up just fine but it always turns out black ingame or in render mode. If I save the map and open it again it gives a warning sayin Size Mismatch cant load cubemap. I have no idea what that means. All the images are .tga 24bit all 512x512 including the qer_editorimage one. I have no idea what the deal is! Any ideas?


I know that i got it showing black when i dident have the .tga's in the "env" directory, so make sure your path in your script is setup right.

Also be sure when you refrance them in the script line "env/custom/cloudyday" you do NOT put a file extention at the end. it should just be the name of all your textures without anything else.

Hope this helps.



HaZarD@Posted: Thu Aug 12, 2004 7:42 pm :
Ok my env folder in the base folder (<doom3>/base/env) and in that folder is:
Code:
cloudyday_back.tga
cloudyday_front.tga
cloudyday_left.tga
cloudyday_right.tga
cloudyday_up.tga
cloudyday_down.tga


my materials folder is in the base folder too. And inside it is customskies.mtr and this is exactly what it has inside it:
Code:
textures/skies/cloudyday
{
      qer_editorimage   textures/skies/cloudyday.tga
   noFragment
   noshadows
   nooverlays
   forceOpaque            // so transparent windows can draw on top of it
   {
      blend      add      // so transparent windows can draw on top of it
      cameraCubeMap   env/cloudyday
      texgen      skybox
      texgen         wobblesky .0 .0 .0
   }
}


the textures folder is in the base folder as well and the skies folder is in it.

Everything checks out like it should all the paths match up and like I said the qer image shows up just fine and is on the brush in normal mode (not render mode) but it still shows up black ingame or render mode.

When I open the map in the editor I get these warnings:
Quote:
WARNING: Mismatched sizes on cube map 'env/cloudyday'
WARNING: Couldn't load cube image: env/cloudyday


And I have no idea why. All the textures are 24bit .tga files all sized 512x512

/shrug



Mr-Gibs@Posted: Thu Aug 12, 2004 10:04 pm :
We have almost 500 skies (environment maps) in various themes at the Wadfather, come check them out! :)



DavidRoss@Posted: Thu Aug 12, 2004 11:00 pm :
My next idea would be to try another sky...? it would seem your script it right, and the game is reading it right, but that there is a problem with the .tga files. the sky i used was 768x768 from http://www.scentednectar.com/skyboxes/ but i dont know if that would make a diffrance.



HaZarD@Posted: Fri Aug 13, 2004 2:17 am :
Thats where mine came from too. The terragen link with all the skies. I did it at first with it unresized cause I forgot about it and it didnt work then I resized em all and it still didnt work so then I added the alpha channel to em all and saved em as 32bit and they STILL didnt work so now Im back to the 24bit ones. I have nfc why the qer image would show up and not the rest their all the same images from the same site /shrug. Its the same way with some of the ones in the editor already. Some show up black some work fine. I dunno wtf the problem is but its fuckin annoyin



DavidRoss@Posted: Fri Aug 13, 2004 2:23 am :
What's your Email? Will send you a .Rar with exactly what i have, and the file strucer, so all you have to do is unrar it into your base directory, if it still does not work, then its a problem with your game somehow, and if it works, then its somehow a problem with your files.


PS, not all the game skies seem to work for me eaither



HaZarD@Posted: Fri Aug 13, 2004 3:12 am :
I PMed you my email addy. I read somewhere about a console command to stop texture caching that it doesnt reload the textures after theyve been cached once. If I can find the command again Im gonna try it and see if maybe thats the problem Ive been havin.



DavidRoss@Posted: Fri Aug 13, 2004 3:21 am :
From what i can tell, the command is only usefull if you want to not restart. but every time you restart it reloads everything.



HaZarD@Posted: Fri Aug 13, 2004 3:32 am :
Well yours works fine for me. The only difference between mine and yours is the tabulation of the .mtr file. When I extracted yours everything went into the same folders with my files but for some reason mine does work. Can I zip mine up and let you DL it and you try it out?



DavidRoss@Posted: Fri Aug 13, 2004 3:41 am :
sure... just send me the link, or send it though e-mail. i have a theory that its something to do with your .tga files. maybe your program is saveing it strangly, are you useing photoshop?



HaZarD@Posted: Fri Aug 13, 2004 3:52 am :
Yeah Im usin photoshop 6. Heres the zip everything should be intact once youve got it lemme know so I can remove it from my guild webspace.



DavidRoss@Posted: Fri Aug 13, 2004 4:19 am :
I figured it out! you have one of your .tga's misnamed... you have "cloudyday_foward.tga" and it should be "cloudyday_forward.tga"



HaZarD@Posted: Fri Aug 13, 2004 4:40 am :
...

well Ill be damned

Yeah... yeah... it works now...

Somethin so simple... I never woulda figured it out either. I woulda made a new set and probably got it right and never even looked for that 1 letter difference =/

I had _front before so that must be why it wasnt workin then either.

I gotta ty for figurin it out I know I never woulda lol.



DavidRoss@Posted: Fri Aug 13, 2004 4:43 am :
Ya i had _front in the tut :oops: , but i changed it now.



Elminster@Posted: Sat Aug 14, 2004 2:46 am :
The skies I have tried all display, they just never display in the proper order. I have tried about 8 different skies and not a single one lines up properly. All of the supplies skies with the game function properly. Here is a shot of the problem I am having.

Image

All of these skies have came already labeled with front, left, right and so on. Tried ones from The Wadfather page.

Post Edit: After testing skies from the Skybox Textures instead of Wadfather they appear correctly. It looks like the people submitting at Wadfather just don't know how to label properly. At least not on any of the skies I downloaded.



SeriousMite@Posted: Sat Aug 14, 2004 5:55 pm :
What size should skybox textures be? 1024 by 1024 alright?



DavidRoss@Posted: Sat Aug 14, 2004 8:44 pm :
i have only tired 768x768 but it would be intersting to see how big they can get.