I’m having a problem lightmapping a large low poly exterior with a directional light. I’ve tried every conceivable combination as far as I can tell, and nothing gives the terrain any character.
Like I’ve said, I’ve pushed the lightmapping controls and settings on the directional light all over the place. and there just doesn’t seem to be enough detail in the geometry to get a viable lightmap for anything other than the trees.
Problem is it’s a very empty terrain, so there’s little to create variations in light, it’s mostly just a flat shade, few shadows aside from tree’s.
Yup, do some edits by hand in Photoshop on the lightmap itself, discoloration, randomness etc. Using different shaped brushes and such, just to break it up a little and give it some chaos. Things you -could- do inside Unity with Beast and adding various things to give some life to it, but in this case would be easier in Photoshop.
Part of what I’m discovering, as I continue shooting into the dark, is that the directional light is “too strong” for Beast. If I drop the intensity of the main light down to 0.2, there starts to be some definition in the map - not just blown out flat texture:
I guess I want beast to treat the terrain more softly… and round some of the hard edges like the basic Unity lighting does.
I’ve played with tangents and smoothing angles, and I’ve played with the angle error and area error to see if I could generate some softening… but no dice. And I’m still getting these rock hard black patches… (and some seaming… but bigger fish first)
Well by details I mean things like… well grass for example, it’s got a lot of discoloration to it, patches of dead grass, healthy, dark, sparse and so on. Normally you’d use textures to deal with that, but in your case it looks like you don’t go over to the sides, so you can ‘cheat’ and use lightmaps to give it those colors.
Something else you could do is give it a shader that has a faint blurry cloud like texture that slowly scrolls across it, to fake shadows from clouds high above, nothing well defined, just a hint of it. Could look nice.
If possible though I’d also suggest adding actual detail too. If you can’t ever get near any of it, and depending on the angle of the players view, you could fake most of it with billboards, bales of hay, stone walls, gates, bushes, cows, sheep, the works, depending on the location its set in of course. Do the same kind of thing going off into the distance, have it look really high detailed but with barely a few hundred tri’s extra.
Yes, there will be more environmental detail… but it’s targeting mobile devices, so I need to be efficient about it. I plan on simple rivers and bridges and other eye candy - leaving the main road for dust dirt tracks, etc., but it’s also a very simple style of game and most of the eye candy will be at the margins of the camera. I’m just trying to give it one bit of feeling above a flat texture.
Hmm. These really do act like splat maps… Now I wish we could paint on them directly.
I also feel that if I can prove to myself that I’m not going to get good variation on the terrain, and it looks flat no matter what I do under these circumstances, I might as well just save the polys and make it a danged blammit plane and walk away from it!
I removed the smoothing from the terrain, which gave far more definition, but clear chunky triangles, then popped the lightmap into Photoshop and gave it 3 whacks with Gaussian Blur * 1 pixel and that returned this:
An update of sorts. The most detail I’ve been able to get out of the terrain is using the blurring example above, but to effectively contain this, and only blur the terrain, not the rest of the scene, I’d have to build and map the terrain separately.
This example is back tracking and setting the smoothing on the terrain to calculate and setting the angle to 180* (so presumably every thing is smooth), and then importing the lightmap into photoshop and monkeying with the “Exposure” adjustment tool giving this result. http://new.tinygrab.com/089646c39b9a76b395c07ad4fd922456.png
My frustration, I believe, when editing the lightmap, is that I don’t fully understand the details of .exr files. I simply want control over the exposure curve or the contrast, two adjustment tools that are disabled when dealing with .exr files. They seem to be in some special sort of color space, even tho’ the “mode” appears to be “rgb32”.
But I find that if I increase the strength of the light, it washes the detail away from the original lightmap. And if I drop the intensity of the directional light down to 1.0 (as in these images), I get the detail, but that’s just too dark. The photophop work brightens it a bit, but if I raise the brightness up enough that the highlights are good, it washes the detail away again…
I need more contrast…
Little Angel loads another clip and prepares to shoot into the darkness…
The lightmaps are high dynamic range (HDR) to ensure they contain as much lighting information as possible. You can edit the brightness within Photoshop and save it back without having to re-bake it to make it lighter.
Could be that I’m running into the age of my version of PS… CS3, which is 3-4 years old? As this is (as you’ve pointed out) an HDR image [I was unclear what this was - log space - , but it clearly had a non-standard range], I’m only allowed a limited set of tools: http://new.tinygrab.com/ce817772ac1b624bc8d1db83d8b082cf.png
This in complicated by the fact that Unity/Beast must be functionally adding this to the terrain texture… so it’s - what - blurring and add-mixing the image over the texture? So it’s at least one step removed from just editing the diffuse image. One has to predict, when looking at the image in Photoshop, what this could do to the scene once it’s imported and overlaid. I’m finding it difficult just grabbing the map the way I grabbed the screenshot, and cranking the “contrast” button (or Levels or Curves) until the image is bright enough.
I use CS3 and have no trouble editing HDR images. I don’t remember though if the openexr loader/saver was bundled with it or not. That might be the problem?
Mmmm… Let me investigate that. I’m simply loading the file into Photoshop with a double click in Unity … Do you have a full toolset when editing .exr’s in PS-CS3?
You can duplicate the terrain, greatly increase the terrain resolution and smooth it out, and then light map it- and then apply that light map to the low resolution terrain, which has the same lightmap UVs.