PDA

View Full Version : Complex Material Questions / Tips



Zach Lehman
12-19-2010, 01:58 AM
Warm Gun is looking to "mobilize" our game and naturally we're running into all sorts of fun combinations of material setups. While running through our UPKs I've noticed a few issues. The title of this thread says 'Complex' but I don't think all our issues will be considered very complicated or unique. It also says 'Tips' but it's 2am and I'm too tired to add our tips into this thread tonight. I'll be updating the thread with things we've found to work well though.

In the mean time, here are some fun problems/oddities we've encountered and haven't (in the past 48 hours) found the solution for:

1. Opacity maps. Fixed: Suck it up and export the diffuse so you can add your opacity map to the alpha and re-import.
It looks like the opacity works if you have it built into the alpha of the diffuse texture, but what if you have a separate opacity map? Does it have to be built into the diffuse to work on mobile?



https://dl.dropbox.com/u/11781734/Img01.jpg

2. If statements for AO Fixed: Use switch statements instead. Also don't forget to check the mobile info on the material instances as well as the material itself.
The image shows we have an AO map with three separate bakes (one in each of the RGB slots). This is a single material built to handle three different types of junk pile meshes. When we load the first junk pile mesh onto the iPad it renders fine but piles 2 and 3 render out like an acid trip (they look like the RGB texture sample in the image). Any thoughts on this?


https://dl.dropbox.com/u/11781734/Img02.jpg

3. Materials showing on iPad but not hooked up
We have materials that are applied to BSP that show up (and look amazing) on the iPad, but when you look at them in the material editor they have nothing set up in the mobile tab. It's set up in the expression window, but we were under the impression if you didn't hook up the textures in the mobile tab it wouldn't show. A lot of materials are like this.


https://dl.dropbox.com/u/11781734/Img03.jpg

4. Specular Fixed: "Spec is turned off on the iPad in the ini, you can tun it back on but be careful about performance." - Taken from a post by ShaneC (Post #8 in this thread).
We can't seem to get specular to work at all. It looks great in editor but once transferred to iPad it loses all spec. The image shows the setup for this rock wall, and in the Mobile tab we've tried a ton of different combinations. We opened Citadel for a reference check and we noticed that bronze statue had a bump offset combo very similar to this setup. They applied the offset texture in the Masking tab, the Diffuse and the Normal in their respective tabs, and checked the Bump Offset tab and set values. Additionally for the spec they checked Use Mobile Specular and Use Mobile Pixel Specular and set the MSM to be MaskTextureRGB. We've tested with a spotlight and a directional light.

Edit: We have gotten specular to work on a much simpler asset. Oddly enough it's now even more confusing. We did some tests and found that we could hook a diffuse texture up to the diffuse slot and break all other connections in the expression editor. We then removed everything from the Mobile tab and just enabled spec ('Use Mobile Specular' AND 'Use Mobile Pixel Specular') and set it as MSM_DiffuseRed. We were under the impression this couldn't work without a normal map, but somehow this setup works and my setup in the above image doesn't.


https://dl.dropbox.com/u/11781734/Img04.jpg

We welcome anyone who brings answers, but help from Epic guys or Chair/Trendy guys would be hugely appreciated. These issues are only a snippet of all the problems we're having with our materials, but if we can better understand these concepts I think we can apply them to a lot of other similar occurrences. I'll follow up later with tips and more questions as we get them.

Thanks!

cubedude89
12-19-2010, 12:42 PM
For #2, I changed the IF statement into static switches and it worked.

EDIT: So the problem was not that of IF vs static switches. Just needed to have the diffuse plugged into the mobile base texture within the material instance. I missed it the first time too. http://screencast.com/t/otMVVrkTlOdc

I believe Static switches are much more efficient to use then IF statements for PC so I'll stick with using that anyway.

Zach Lehman
12-19-2010, 02:36 PM
Additionally, we had to hook up the material instance files as well with the mobile texture. There's a mobile tab in the instance itself that I originally overlooked.

Zach Lehman
12-20-2010, 10:20 AM
Bump for Monday :)

I think we've started to test the iPad limits as well. One of our maps has a little over 2500 static meshes (among various other things such as emitters, kismet, path nodes, etc) and the map wouldn't display an error on iPad but it would just load for a bit then revert back to desktop. I found through some crude gutting of assets that once we got the total static mesh count down to around 500 it started playing.

I'm still not positive if it's a specific asset or group of assets that's killing the game or if it's sheer map size. After I finish converting the rest of our UPKs to mobile I'll have a better idea. Hopefully it isn't the size that's the problem, but I'm pretty sure that's wishful thinking.

Zach Lehman
12-22-2010, 12:04 PM
Bump. We still haven't found solutions to some of these issues.

TOP-Proto
12-22-2010, 02:37 PM
Bump for Monday :)

I think we've started to test the iPad limits as well. One of our maps has a little over 2500 static meshes (among various other things such as emitters, kismet, path nodes, etc) and the map wouldn't display an error on iPad but it would just load for a bit then revert back to desktop. I found through some crude gutting of assets that once we got the total static mesh count down to around 500 it started playing.

I'm still not positive if it's a specific asset or group of assets that's killing the game or if it's sheer map size. After I finish converting the rest of our UPKs to mobile I'll have a better idea. Hopefully it isn't the size that's the problem, but I'm pretty sure that's wishful thinking.

if the idevice runs out of memory in any app it will quit out of the app. check your memory usage to confirm this.

in apps a mem warning will popup but the udk probably needs to add this as a custom dialog and be watched via scripting.

dalewb
12-24-2010, 01:02 AM
A treasure trove of information. I will be referring (and hopefully contributing) to this in the near future. But it's almost Christmas - it'll have to wait a bit :-)

ShaneC
12-24-2010, 02:45 AM
Zach, currently the only way the complex shader setup using the node system is going to work, is if you are using the flattened texture, and that is just used in the diffuse channel on mobile. If your not using flattened textures, you need to set the stuff up in the mobile section of the shader properties.

Spec is turned off on the iPad in the ini, you can tun it back on but be carful about performance.

It is best to put your alpha map in your diffuse textures alpha channel, or in the mask texture's if you are using one. This reduces the number of texture look ups.

Shane Caudle

Zach Lehman
12-24-2010, 02:55 PM
Thanks for the helpful responses Proto and Shane - I'll be finishing off our UPK optimization on the 26th and will be able to start coding some functionality into the game in a couple days. I know we're getting Allar an iPad soon so he'll be able to help me (and the rest of the forums) get into some of the more complicated functions. I'll have the memory issues addressed for several of our maps by the end of next week and at that time I'll have a lot more to contribute. I'll probably figure out exactly how much memory certain things require so people can plan accordingly when making future maps.

Happy Holidays guys!