wxywxy.ji Posted November 28, 2012 Share Posted November 28, 2012 when terrain has hole. cave was blocked by WorldOccluderTerrain. not use WorldOccluderTerrain when exist cave. how to solved? Link to comment
manguste Posted November 28, 2012 Share 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. Link to comment
ulf.schroeter Posted November 28, 2012 Share 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 Link to comment
wxywxy.ji Posted November 29, 2012 Author Share 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? Link to comment
ulf.schroeter Posted November 29, 2012 Share 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. Link to comment
wxywxy.ji Posted November 29, 2012 Author Share 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? Link to comment
ulf.schroeter Posted November 29, 2012 Share Posted November 29, 2012 There seems to be some endless-loop here... Link to comment
manguste Posted November 30, 2012 Share 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. Link to comment
wxywxy.ji Posted December 5, 2012 Author Share Posted December 5, 2012 thank you for reply nothing , other solution. i will make that automation paint black on cave bound box. Link to comment
Recommended Posts