wxywxy.ji Posted November 28, 2012 Posted November 28, 2012 when terrain has hole. cave was blocked by WorldOccluderTerrain. not use WorldOccluderTerrain when exist cave. how to solved?
manguste Posted November 28, 2012 Posted November 28, 2012 If you've got a hole and a cave, you can black out this place in the height map used for WorldOccluderTerrain. It should do the trick.
ulf.schroeter Posted November 28, 2012 Posted November 28, 2012 Just as an example of this approach where WorldOccluderTerrain height map texels have been set to 0 (black areas) at regions where no occlusion should take place. WorldOccluderTerraion height map visualization done with this script code. 1
wxywxy.ji Posted November 29, 2012 Author Posted November 29, 2012 you said that i can not get that compute image. how to paint black color on cave positioning? how to process that a lot of cave? other solution?
ulf.schroeter Posted November 29, 2012 Posted November 29, 2012 It can be done easily via UNIGINE script, simply check each ObjectTerrain heightmap texel for hole flag. If set than set corresponding WorldOccluderTerrain mask image texel to 0. Of course you have to account for different texture sizes between both images.
wxywxy.ji Posted November 29, 2012 Author Posted November 29, 2012 you said that i can not get that compute image. how to paint black color on cave positioning? how to process that a lot of cave? other solution?
ulf.schroeter Posted November 29, 2012 Posted November 29, 2012 There seems to be some endless-loop here...
manguste Posted November 30, 2012 Posted November 30, 2012 You can easily get the heightmap image via occluder.getHeightsImage(). It's like Ulf said: you need to get coordinates of your caves and transform it into WorldOccluderTerrain coordinates. It'd be something like: vec3 point = occluder.getIWorldTransform() * point_coordinate; float x = point.x * image.getWidth() / occluder.getSize().x; float y = point.y * image.getHeight() / occluder.getSize().y; Than you can paint a heightmap black around x,y.
wxywxy.ji Posted December 5, 2012 Author Posted December 5, 2012 thank you for reply nothing , other solution. i will make that automation paint black on cave bound box.
Recommended Posts