Author Topic: Displacement Mapping issues  (Read 1169 times)

2018-12-03, 09:32:38

telnoi

  • Users
  • *
  • Posts: 2
    • View Profile
Have a demo coming up for a big client/was hoping to use Corona Render, but I ran into an issue with displacement mapping.
Using Corona B2. Polygons are always visibly rendered:
-happens with a regular noise shader and a highly subdivided sphere
-happens with maps that render fine using Cinema 4D's standard render engines
-screen size influences outcome, but lines are always visible
-adding a subdivision surface object does NOT resolve the issues

Regarding the displacement map:
-intensity centered
-round geometry turned OFF

Scene file
https://we.tl/t-cCMQCRsLRA

2018-12-03, 11:21:33
Reply #1

fabio81

  • Active Users
  • **
  • Posts: 275
    • View Profile
they should have fixed the displacement with version 3. Right Corona team?

2018-12-03, 11:35:12
Reply #2

tennet

  • Active Users
  • **
  • Posts: 49
    • View Profile
    • Good Monday
Not sure if there is a problem with your 32-bit displacement map? If I open it in Photoshop and increase the gamma on your map (Exposure/gamma) then it looks like there is lots of things going on in the map where the artifacts are. Could this be the case?

I also tried to create a C4D native shader using the same displacement map and then I get the same weird result, so it's not only Corona.. looks the same with C4D.

2018-12-03, 12:13:01
Reply #3

beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 1265
  • Bengamin
    • View Profile
    • Cormats
It seems it's your disp map that is the cause. Even applied to a sphere generates the same bad looking poly's.


2018-12-03, 15:09:03
Reply #4

beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 1265
  • Bengamin
    • View Profile
    • Cormats
Looking at it in PS with some levels adjustments shows it's imperfections. :(


2018-12-04, 11:13:31
Reply #5

telnoi

  • Users
  • *
  • Posts: 2
    • View Profile
Yes, I noticed the imperfections.
Still strange that Cinema 4D's physical and standard render engine knows how to deal with the input. Zero artefacts as shown in the example image in the first post.

I'll see if baking within Cinema 4D can produce something that is better suitable.

2018-12-04, 14:03:28
Reply #6

tennet

  • Active Users
  • **
  • Posts: 49
    • View Profile
    • Good Monday
Maybe the texture map you uploaded became corrupt then, because I tried to render it using 'C4D standard' and it looks exactly the same as your Corona test render. See image in my post above.

2018-12-04, 14:46:01
Reply #7

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 5787
  • Let's move this topic, shall we?
    • View Profile
    • My Models
There are displacement maps and there are height maps. What is shown in screenshots, is height map. Some renderers can render both types correctly. some can render only one type. Corona needs displacement, you have to rebake your map.
I'm not Corona Team member. Everything i say, is my personal opinion only.

2018-12-04, 19:23:08
Reply #8

houska

  • Corona Team
  • Active Users
  • ****
  • Posts: 1306
  • Cestmir Houska
    • View Profile
There are displacement maps and there are height maps. What is shown in screenshots, is height map. Some renderers can render both types correctly. some can render only one type. Corona needs displacement, you have to rebake your map.

I am not sure I know where the difference between a displacement map and a height map is, romullus. I always thought they are the same thing (provided that the displacement is only displacing along the shading normal).

2018-12-04, 19:33:29
Reply #9

houska

  • Corona Team
  • Active Users
  • ****
  • Posts: 1306
  • Cestmir Houska
    • View Profile
As for your issue, telnoi, I am not sure that the problem is in Corona (but it doesn't mean it can't be!)...

I tried your scene and could not find good settings for the displacement effect, indeed. Actually, the model looked best without the displacement. I then tried to verify the displacement is working by making a black-to-white gradient and applying it to one side of a 5cm large cube. I added another 5cm cube for scale. The gradient was then used as displacement with min value 0 and max value 5 and by looking at the other cube, I could see that the displacement is working as expected. See the attached image.

I even verified the normals to make sure that the problem doesn't lie there. But they were all looking as expected.

I am sorry I cannot help you more at the moment, but to be able to debug the issue (if there is any), we'd need a more simple scene than a chair with super-tiny displacement, which is not easily quantifiable. If you could make such a simple scene in the software, from which the chair model originates, that would be much better.

2018-12-04, 20:00:16
Reply #10

BigAl3D

  • Active Users
  • **
  • Posts: 201
    • View Profile
I was interested in seeing what the difference is between Height Maps and Displacement Mas too so I did a search. Some interesting things in this thread, granted it's from a game dev site, but the info still applies I believe.

https://gamedev.stackexchange.com/questions/65755/whats-the-difference-between-displacement-mapping-and-height-mapping

2018-12-04, 21:03:55
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 5787
  • Let's move this topic, shall we?
    • View Profile
    • My Models
There are displacement maps and there are height maps. What is shown in screenshots, is height map. Some renderers can render both types correctly. some can render only one type. Corona needs displacement, you have to rebake your map.

I am not sure I know where the difference between a displacement map and a height map is, romullus. I always thought they are the same thing (provided that the displacement is only displacing along the shading normal).

To be honest, i know very little about the difference tetween those two. There's very little information about that available and most of it is contradicting and confusing. I know that mental ray in 3ds max has had checkbox, called "smoothing", which would let render either displacement or height maps. Here's quote from 3ds max help about it:

Quote
Smoothing
    Turn off to have the mental ray renderer correctly render height maps. Height maps can be generated by normal mapping; see Creating and Using Normal Bump Maps .

    When using only height maps in the scene, make sure this option is off. If some objects in the scene use height maps while others use standard displacement, apply smoothing on a per-object basis (see mental ray Panel (Object Properties Dialog) ).

    When on, mental ray simply smoothes the geometry using the interpolated normals, making the geometry look better. This result, however, cannot be used for height map displacement because smoothing affects geometry in a way that is incompatible with height mapping.

As for authoring displacement vs height map - the baking technique is almost identical, but you have to pre-subdivide low-poly mesh before baking displacement. That's basically is all that i know :]

Edit: by the way, i asked once Ondra to implement such checkbox in Corona, but failed to prove its necessity, so my request was dismissed :]
« Last Edit: 2018-12-04, 21:08:58 by romullus »
I'm not Corona Team member. Everything i say, is my personal opinion only.