Welcome, Guest! Login | Register

Cropping technique... [Print this Article]
Posted by: -+Arcadian+-
Date posted: Jun 25 2003
User Rating: 4.7 out of 5.0
Number of views: 7257
Number of comments: 2
Description: apply images to brushes with no seams
In this article we will:
Take a 768x768 image, cut it up into nine pieces and apply those images to nine brushes in hammer with no seams. This tutorial is semi-advanced, and I'm not a great writer so I hope you understand.

This is sorta the same idea they use in Battlefield 1942 where they take one big image and cut it into 512x512 textures and apply it to the land, but we will be doing it in Half-Life .. sorta

This technique works great for land.. but can be used anywhere you need it. If you take a picture (for example) 768x768 and cut it into nine 256x256 images, create a .wad file, go into Hammer and apply the textures (using fit) and you will notice that the images will not be seamless.. half-life blurs the outer edges or adds weird stuff to the image. This does not look good, and we don't want that. This is how you get around that.

1. Go into your photoshop and set your grid preferance up. Gridlines every: 256, subdivisions 1.

user posted image

2. Turn on your grid - View/Show/Grid

user posted image

3. I'll be using this 768x768 image for this tutorial (this could be a top down view of your land). I'm only using this image to show how this technique works.
Right click and "save as" if you want to use this image to follow along.

user posted image

4. Next we need to cut up our images. We will be using the marque tool and selecting each piece. The image below shows the exact sizes you need to select to make the textures perfect... load it up in photoshop with the gridlines turned on to see it better.

user posted image

Notice that the outer edges will be smaller and any images in the middle will be 288x288. In this example of course, we only have one middle image... but if you made a bigger image you would have more.

Select the marque tool like so...

user posted image

Set it to fixed size.

user posted image

Enter in 272x272 for your width & height. Select it like in the image below, overlapping the 256 grid by 16 pixels. I've found it easier if you let it snap to the grid for the top and a side, then use the cursor keys (hitting it 16 times) to move it into place.

user posted image

5. Go to Edit/Copy and copy your image. Then click on File/New and click ok. Next go to Edit/Paste. Next we will need to make it 256 colors for half-life, so go to Image/Mode/Indexed Color. Select local adaptive, 256 colors hit ok, and save it as 1.bmp.

'user

6. Repeat steps 4 & 5 until you have done all nine images entering in the correct sizes, and making your selections .. heres another image to go by, it shows the middle texture being selected.

user posted image

NOTE: I'm saving my images 1, 2, 3 starting at the top left and going right, so the next row will be 4, 5, 6 , and the row after that will be 7, 8, 9. You will need to do the same so you can apply the textures later in Worldcraft/Hammer.

7. Take your images into wally and make a wad file. I've included a wad file here. And the .rmf for Worldcraft/Hammer here.

8. Go into Worldcraft/Hammer and load up the wad then create a new file.

9. Create nine 256x256 brushes like so:

user posted image

[B}10. [/B]Scale the first brush (the same size as in photoshop) 272x272, overlapping just like your selection overlaped in photoshop. See image below.

user posted image

Apply the "1" texture (I named the textures 1-9 in wally) to the top of your brush, and justify it with fit.

11. Note: Before scaling the brush .. remember how the selections in photoshop overlapped 16 pixels? We will now cut off those 16 pixels on each brush that we make. You must be sure to scale the correct sides, or the textures wont be seamless. For brush #1 scale the bottom and right side (the overlapped areas in photoshop) ... so your brush is 256x256. Setting grid snap to 16 makes this much easier. Just crop off the overlapping areas. See image below.

user posted image

12. Repeat those steps, scaling up the rest of the brushes, applying the correct textures, justify with fit, and then scaling the brush back to 256x256 cropping the correct sides. When your finished it should look like the image below.

user posted image

Well that should give you a perfect image with no seams.

You can use this same idea and make the brushes bigger or smaller depending on what you need.

Any questions?
Find me in #wavelength on gamesnet

-+Arcadian+-

Rate This Article
This article is currently rated: 4.7 out of 5.0 (3 Votes)

You have to register to rate this article.
User Comments Showing comments 1-2

Posted By: -+Arcadian+- on Dec 26 2003 at 06:33:39
This method could also be used to allow u to use a 1024x1024 texture on one wall .. by cutting your image into two 512x512 textures and use two seperate brushes. Then set up the rest like in the tutorial, and you should have a pretty 1024x1024 textured wall.

Posted By: jinxd on Jun 23 2005 at 05:13:08
Err, two textures? :P More like 4. :D


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
knock knock
General | News
By: omega | Dec 22 2016
 
knock knock
General | News
By: MIFUNE | Oct 10 2015
 
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
 
knock knock
General | News
By: Whistler | Nov 05 2011
 
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
 
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Persuter | Aug 02 2009
 

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (7 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!