Author Topic: Triplanar- and displacement mapping inconsistency  (Read 2810 times)

2018-03-20, 11:15:04

matsu

  • Active Users
  • **
  • Posts: 56
    • View Profile
I was setting up a brick material using triplanar mapping in the texture slots, and noticed something funny. (Not funny, really.)

Displacement is calculated first, then the other mapping is applied to the displaced geometry, resulting in mapping mismatch.

Attaching images. First with triplanar, and then without (using ordinary UVW mapping).



2018-03-20, 19:32:40
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 9822
  • Marcin
    • View Profile

2018-03-20, 19:41:07
Reply #2

PROH

  • Active Users
  • **
  • Posts: 1097
    • View Profile
hmm... logical or not, it isn't very useful.

BTW this isn't the only situation where displacement f*cks up UVW. When using different mat ID's in a Corona multimap the UVW is distroyed too. And when using displacement in a multimaterial shit happens too :(

I really hope displacement will have a major update in next release.

2018-03-20, 19:58:16
Reply #3

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 9822
  • Marcin
    • View Profile
Imagine you are texturing some kind of terrain. You apply displacement like noise or some kind of fractal, and then texture it using triplanar. It makes sense to displace first, and then texture.

Also, if the texturing was done first, and then displacement, then you could easily end up with stretched textures - which triplanar is supposed to prevent.

Last point - it does not make much sense to talk about UVWs with triplanar, as triplanar is designed to make UVWs obsolete. :)

2018-03-20, 20:00:20
Reply #4

PROH

  • Active Users
  • **
  • Posts: 1097
    • View Profile
Get your points. But that means that displacement won't work with triplanar map, and that displacement should be avoided with "normal" UVW mapping, since this will give you "stretched textures".

« Last Edit: 2018-03-20, 20:08:08 by PROH »

2018-03-20, 22:26:40
Reply #5

Juraj Talcik

  • Active Users
  • **
  • Posts: 4050
    • View Profile
    • studio website
The theoretical scenario where this would be preferred method is in my opinion outside of common usage.
Displacement always stretches existing mapped texture, after all the map is driving it in first place, why should other map be applied afterwards in different order ?

Possible solution to this would be that material displacement always acts on existing UVWs, as expected, not as shown in this thread, and geometry displacement modifier being given option to take precedence.

talcikdemovicova.com  Website and blog
be.net/jurajtalcik   Our studio Behance portfolio
Instagram   Our studio Instagram, managed by Veronika

2018-03-20, 22:51:01
Reply #6

PROH

  • Active Users
  • **
  • Posts: 1097
    • View Profile

2018-03-21, 10:42:29
Reply #7

matsu

  • Active Users
  • **
  • Posts: 56
    • View Profile
The theoretical scenario where this would be preferred method is in my opinion outside of common usage.

Quoted for emphasis. In 99.999% of the cases, I want triplanar mapping to behave the way normal UVWmapping does.

Option (even though I'm genereally opposed to adding more and more buttons/checkboxes) would be to add a switch that lets you decide the mapping behaviour - if you want mapping applied before or after displacement.

2018-07-22, 16:31:24
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6529
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Is there any consensus about this issue? Will it be addressed? I'm creating my own material library and to my dismay i found that i can't use triplanar with materials that have displacement :[
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2018-07-23, 19:56:55
Reply #9

steyin

  • Active Users
  • **
  • Posts: 362
  • BALLS
    • View Profile
    • Instagram Page
Why would you use triplanar for bricks/tiles? Doesn't seem like the type of material to benefit from it.

2018-07-23, 20:33:26
Reply #10

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6529
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Brick here are only because that material very clearly shows the issue, but any material with displacement is affected.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2018-07-24, 10:56:32
Reply #11

Fluss

  • Active Users
  • **
  • Posts: 544
    • View Profile
Displacement and UVs have always been a struggle for me... I came across another issue recently. I tried to mix two textures and plugged them in the displacement slot. One texture was UV channel 1 and the other was UV channel 2 ( Tried to mix decals (no tiling) over road surface (tiled)). The result was calculated only with UV channel 1. The workaround is to set everything UV1 and play with tiling values in the maps which introduce some cumbersome workflow for decals placement.

That's probably what happened here, displacement is calculated on UV channel 1, not on triplanar projected UVs. -> mismatch

IDK if making displacement working with multiple UV sets is hard to do but if we're discussing displacement behavior, This has to be taken into account I guess.
« Last Edit: 2018-07-24, 11:36:19 by Fluss »

2018-07-24, 11:24:46
Reply #12

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6529
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I highly doubt that, because in 99,9% of cases, mismatch would be too severe to ignore. Anyway that's easy to check...
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2018-07-24, 11:35:32
Reply #13

Fluss

  • Active Users
  • **
  • Posts: 544
    • View Profile
I highly doubt that, because in 99,9% of cases, mismatch would be too severe to ignore. Anyway that's easy to check...

Just checked you are right, that's not what happened with triplanar. Was just a random assumption.

Anyway, even if it's not the issue in your case, I think the point I highlighted above has to be addressed too.

2018-07-24, 11:47:15
Reply #14

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 6529
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Of course it should, just make sure that there is bug report about that. If not, then please create separate report, so it won't be lost.

As for my case, i just found that i made big mistake by plugging normal texture in to triplanar first and then in Corona normal node. Apparently triplanar always has to go last (first in to material). That didn't solve displacement mismatch though. Now i will have to fix all the materials i made during weekend *sigh*
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures