Tuesday 13 August 2013

UDK/UNREAL ENGINE

IMPORTING MODEL FROM SKETCHUP INTO UDK\

IMPORTING TRANSPARENT MATERIAL

trying to write game and hence importing models from sketch up , these are low quality textures
                                  This was my first trail importing model into the sketch up.
Its a bridge and skyscaper.



The lighting is default,
The hardest thing is importing materials
sizes need to be 256*256 and to their powers

The Difference Between Texture and Material

If you’ve used UDK before, you may have noticed that you do not really use textures, or rather, you do not directly apply them to anything in your level. It seems somewhat strange at first, but materials are what you apply to your in-game assets, not textures. Materials are comprised of one or more 2D textures, which include the normal texture, normalmaps, specularity, etc. By combining several different texture files, a material is created that can now be applied to all of your assets and BSP. I will discuss how to create a material in UDK a little later on, but you will need to first create a texture that you will use. If you’d like to learn a bit more about materials and textures

Photoshop Is Your Friend

Unless you are perfectly happy with the texture you’ve found, it probably could use some tweaking to make it fit better into your level. My texture creation process begins with finding a base texture, one that I particularly like but might look too realistic or clean. I open up the base texture in Photoshop (a similar program will work just fine) and test it out to make sure that it tiles properly and fits the power of 2 restriction. If it doesn’t check out, you might want to find a new texture, or you can edit it until it checks out. Next, I find a few other textures to layer on top of the base texture. These include grunge or other textures that make the base texture look more worn. Usually the textures I find aren’t quite the right color I’m looking for, so I either create a new layer with the desired color or use the hue/saturation tool to get the right color. Tweaking textures to look perfect is going to take some time, especially if you’re a beginner, but by doing these fairly simple steps, you can quickly get better looking textures for your levels.

Importing into UDK

Before you import your new texture into UDK, be sure that it fits within the power of 2 rule, or it won’t even import. It should also be saved as a .png, .bmp, .psd, or .tga  file type. To import, open up UDK and the content browser, and click the Import button at the bottom of the content browser. Find your texture and click open, which will bring up the import options window. There are a lot of different options you can select, but I won’t go into all of them this time. You do want to make sure the Package field is the same name as the package you want to import into, and when naming the texture, make sure that there are no spaces. There are a lot of different options you can select, but I won’t go into all of them this time. The two I usually select are “Create Material,” which will create a new material of the texture once imported, and “RGB to Diffuse,” which links the texture to the material’s diffuse color. After you’ve selected all of the desired options, click the OK button to import. Once imported, the content browser will open up the package you selected and show the new texture and the new material. The material will probably be the standard checkerboard right now, so to fix this, simply right click on the material and click “Recompile Material.” And you have now successfully imported your first texture and material into UDK! This is an easy way to import new textures, but if you’d like to learn some more in-depth tricks, I’d recommend checking out the UDN’s Content Creation guides; just scroll down to the Textures and Materials section.
I’m certainly no expert in creating textures, but this process is a quick way of getting a more fitting look for your levels. There are a lot of great texture artists out there, so if you’d like to learn more on creating your own textures, try checking them out for inspiration or find yourself some good tutorials. Texturing is an art itself, but it can be a useful skill to have as a level designer, especially for solo projects and prototypes. If you have any questions or have something you’d like to add, feel free!

 In Photoshop:

1) Delete the Background layer (or set it to Transparent) – if you have texture info here, just copy it to a new layer first and then kill the background.

2) Setup your texture however you like on one or more layers like you would any other texture

3) Go to the Channels tab, and add a new alpha channel – this is where you’ll create a Mask which controls what parts to see or hide. Anything black is 100% see thru / anything white is 100% visible – obviously greyscales inbetween are semi-transparent. [A helpful trick is to Ctrl-click a layer to do a quick selection around anything drawn there - then back on the alpha channel you can do a quick flood fill]

4) Save the file as a 32-bit whatever … I myself prefer to use .TGA instead of .PNG but in the end it’s all going to be converted to DXT in the editor later anyway. The important part is that a 32-bit file will retain the alpha mask you made where others will not.

In UDK:

1) When you import your texture, just verify that "Compress No Alpha" is NOT checked. This is not checked by default – but if you accidently click it then you will again lose your alpha mask.

2) OK – here’s the iffy part. You can either import this as a texture sample for use in your own Material, and change all these settings in the Material itself. Or, you can use this as a raw texture asset called by code or maybe as a hud component etc which is NOT used in a Material – but then you have to set these settings in the Import dialog when you bring it into UDK. I wouldn’t recommend changing these at Import if you are going to also change them for the Material though.

- Blend Mode: The default is BLEND_Opaque … you’ll want to change this to something that supports transparency, such as BLEND_Masked. I’ve used BLEND_Translucent for my water and BLEND_Additive for our decals but couldn’t exactly say why those work … you may have to experiment.

- Lighting Model: The default is MLM_Phong … you probably dont want your HUD component to be affected by the map’s lighting (that’s kind of a cool idea though actually) – so set this to MLM_Unlit.

- Opacity: In the Material setup, connect the white tab on your texture sample (your alpha mask) to the Opacity tab. In the Import dialog, I think the option for "Alpha to Opacity Mask" does the same thing.

BTW – if you’re working on a material and can’t find these properties – click on the giant block everything connects into and check the properties window. They are in the Material sub-group.

 




 

No comments:

Popular Posts

OTHER POSTS