|
I am adding a dynamically generated "seafloor" texture to my terrains by adding a new element to the terrainData's splatPrototypes array. I then get the terrain's AlphaMap, populate the new seafloor channel, and call trnDat.SetAlphamaps(0, 0, alphaMap) to update the terrain. It works beautifully! ...Except that the seafloor areas are rendered completely black on areas of the terrain that are grater than the terrain's basemapDistance from the camera. I have tried using trnDat.SetBaseMapDirty(), trnDat.ResetDirtyDetails(), and terrain.Flush() to rebuild the terrain's base map after updating it's AlphaMap, but they either have no effect, or turn all the channels in my terrain's basemap black. What is the correct way to regenerate a terrain's basemap? Thanks, -Aubrey
(comments are locked)
|
|
When I have done this (and it works correctly for me), the only commands I have called after SetAlphamaps look like this:
Maybe simply reassigning the terrainData as I do in the 3rd line above will fix it for you... the other lines, as far as I understand, are unrelated to the splatmaps/basemap, but I included them just in case, because with my project the basemap seems fine and matches the new splatmaps properly. hope this helps. Thanks! Unfortunately, this still isn't working for me. Here's my complete terrain code: http://pastebin.com/m764df6bd Here's a screenshot of the error in my game: http://img96.imageshack.us/img96/2267/screenshot20091224at112.png As you can see, on the minimap camera (which is farther from the terrain than the main camera), the seafloor texture is solid black. What does SetDetailLayer(...) do? Should I be using it instead of directly altering the splatPrototypes array?
Dec 24 '09 at 07:33 PM
Aubrey Falconer
(comments are locked)
|
|
You also need to renormalize the splatmap data. All channels of all splatmaps combined should not exceed 1.0 or you will get weird effects. So if you add something to the alpha channel, you have to reduce all other channels.
(comments are locked)
|
