A few more tests and I will move back to making game happen.


Hmmmmm.. the mroe I look the more I see I think Unity really wants a created level to process not the dynamic stuff I want to do … BUT I am still looking..

It might come down to me self rolling a combiner which is not to difficult…the wild card maybe occlusion culling. Which is not a big deal for me as my doors can perform that for me easily.. open? ok then have both rooms on… not open.. have the room your in on… =)..anywho this is definately something I need to work out now before I dig to deep a hole… =)..

——-

Possible other Item:

What happens is, when something has been lightmapped, and then made not static, its lightmap atlas tiling and offset values change. You need to manually set them to be 1 and 0 again, even though they’re worthless at that point. It’s a horrible bug, but they know about it, judging from that thread.

SO that means if I re-Lightmap I maybe ok… we shall see!…. I have to have batching working right for IOS.. there is no question about it… Hopefully I am through this hurdle soon.

————————-

Update: Solution:

From a post last July…Wow… why is this not included in unity?

Just to let you know, this was a success. I don’t own the code so I can’t post it. Here are the steps:

Renderer.lightmapTililingOffset
to grab the UV scaling and offset into the Lightmap. Then you grab its mesh and rewrite the UV2 so that it takes that tiling offset into account.

Next you want to disable Unity’s lightmapping on that object. To do this, set the lightmapTilingOffset to (1,1,0,0) and thelightmapIndex to -1.

Finally, write a custom shader that takes the UV2 channel and uses it as a look-up into your own texture. Use the level’s lightmap as that texture.

This will ensure your prefab can batch and you are using the lightmapping functionality to achieve better, baked lighting.

————————

Update:

  • Objects with lightmaps have additional (hidden) material parameter: offset/scale in lightmap, so lightmapped objects won’t be batched (unless they point to same portions of lightmap)

Uh o….. thats not so good… sooooo.. I will have to do some creative visibility culling… that is a HUGE weakness… that does make Unreal a more tasty option… argh..

————————–

Once I test a few more batching ideas I will move back to making the game happen. I am told it only builds static meshes at compile time.. .which is not so good. I was hoping prefabs would be the answer. So far I am not seeing batches increase over standard draws in the editor. SO I will do a few more experiments then move on and go through the usual process of getting the game  fully playable and then comeback for optimizations.. Unity has a pretty good profile so that will REALLY help the situation…More later..

Once I get back to the story gen I will go through and answer that great post earlier =)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: