Author Topic: Distortion mode for the triplanar map  (Read 1328 times)

2017-08-23, 06:31:06

3di

  • Active Users
  • **
  • Posts: 128
    • View Profile
I think the triplanar map is really good, but would it be possible to have instead of blending which can cause blurriness, a mode which calculates how far off parallel a face is in relation to the the tri-planes and then modifies each planes texmap so that sections of the plane which are perpendicular to the objects faces are distorted accordingly.

For example, the distortion could be quickly calculated by projecting the rgb planes onto the object with a 100% blend and then calculating the resulting rgb value of each face to then modify the projected input map accordingly by stretching and moving the bitmap for each of the three planes used by the triplanar.  It would need to be calculated linearly from the minimum to the maximum sections of each planes axis so that the map could be moved to compensate for distortion on each axis in order to maintain correct tiling.

so if the triplanar used  x = red (255,0,0), y = green(0,255,0), z = blue(0,0,255)

x shrink = 255 divided by red value
y shrink = 255 divided by green value
z shrink = 255 divided by blue value

If it adds too much to render time to calculate each time, then each distorted plane could be collapsed to a bitmap and re-linked to the relevant texmap input to keep renders quick.

Additionally, by using colour values instead of face normals it would still be usuable on bad cad models, and could possibly be utilised to smooth models at rendertime that have too bad geometry to play nicely with a smooth modifier.

« Last Edit: 2018-10-19, 14:33:59 by maru »