Jump to content

[SOLVED] how to use WorldOccluderTerrain?


photo

Recommended Posts

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.

post-82-0-21958900-1354117936_thumb.jpg

  • Like 1
Link to comment

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

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
×
×
  • Create New...