Jump to content

[SOLVED] how to use WorldOccluderTerrain?


photo

Recommended Posts

Posted

when terrain has hole.

 

cave was blocked by WorldOccluderTerrain.

 

not use WorldOccluderTerrain when exist cave.

 

how to solved?

Posted

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.

Posted

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
Posted

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?

Posted

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.

Posted

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?

Posted

There seems to be some endless-loop here...

Posted

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.

Posted

thank you for reply

 

nothing , other solution.

 

i will make that automation paint black on cave bound box.

×
×
  • Create New...