How to fix Displacement Map Issues on Hard Edges?

Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderators: ChrisHekman, aoktar

Pires
Licensed Customer
Posts: 35
Joined: Fri Nov 13, 2015 5:27 pm

For testing I made a simple cube in C4D, generated auto UVs in 3D Coat, then applied a displacement material in C4D and rendered with Octane. Unfortunately the displacement breaks at the edges. The gap can be reduced by tweaking the 'mid-point' level however the edges still wont line up properly:

Image

Image


I realise this is a common problem in 3D. I cant think how you could ever make a UV map where there wouldnt be gaps between some of the edges :| I believe there are easy ways to solve this in Maya and 3Ds Max, so I wondered if theres a simple way to fix this in C4D/Octane?? I believe Phantom is working on a some clever software to fix this but unfortunately isnt released yet and not sure if it will work in Cinema.

Thanks for any help :geek:
Last edited by Pires on Sun Jul 17, 2016 12:07 pm, edited 3 times in total.
User avatar
Terryvfx
Licensed Customer
Posts: 377
Joined: Tue Dec 30, 2014 12:43 am

Bump for interest.
User avatar
jayroth
Licensed Customer
Posts: 393
Joined: Fri May 28, 2010 7:29 pm
Location: Orange County, CA, USA
Contact:

Make sure you convert the cube to a poly object and optimize to remove the extra points at the corners. I have found that doing so will often resolve issues like these with deformations. Cinema does not automatically weld the verts of primitives for some reason.
CaseLabs Mercury S8 / ASUS Z10PE-D8 WS / Crucial 64GB 2133 DDR4 / 2 XEON E5-2687W v3 3.1 GHz / EVGA 1600 P2 / 2 EVGA RTX 2080Ti FTW3 Hybrid/ Cinema 4D

Is it fast? Oh, yeah!
User avatar
Phantom107
Licensed Customer
Posts: 686
Joined: Tue Jul 24, 2012 11:31 am
Location: The Netherlands

jayroth, that will not fix this problem because the normals are not entirely correct then, displacement expects a different kind of approach.

So Pires contacted me through PM (and with his permission:)
Hi Phantom,

I saw your posts about your amazing new software - looks really good! I have a problem with displacement maps on edges in Cinema 4D with an Octane displacement material and posted about it in the forums here: viewtopic.php?f=30&t=55306

I was wondering how Phantom Architecture works exactly as it sounds like the perfect solution? Could I export a model in OBJ format from Cinema 4D, run it through Architecture to fix the displacement issue, export new OBJ, import new OBJ back into Cinema 4D then render with Octane plugin?? Sorry Im a bit confused what it does! :|

Finally, when do you think Architecture will be released roughly? I cant wait to try it out if its as good as it sounds :D

Thanks.
You got the workflow concept entirely right! Pop it in, select which materials you need fixed, optionally save, hit export and then use in Octane Standalone or another program...

Pic:

Image

I did have to import it at sclae 1% cause this cube was so insanely big. Phantom Architecture is geared towards architecture (surprise surprise) so it works best when your surfaces have real life sizes.

Download link: http://guusthissen.nl/downloads_archite ... NT_FIX.obj

Okay so what is important is that you handle the displacement correctly in Octane. There are some rules you must follow, I've not written the manual yet but in a nutshell:
- Make sure your displacement map has correct color balance, that means the colors should range from full black to full white. Use Photoshop or GIMP to do this.
- In the Octane displacement node, set the Height you want covered
- Play with the Offset until you are happy with the result

Note: In your screenshot above you are trying to get displacement connected on all 3 sides of the cube, that is impossible since we use 2D textures here. (!)
You can get 2 out of the 3 to match, but unless your displacement map has specifically mirrored elements it can physically never match up, regardless how you work the UV or the mesh. Simply impossible with 2D textures. Think of it ;)

Then I popped in the new OBJ in Octane and applied a displacement you will see that the displacement correctly follows the surfaces now. BUT there are still gaps between the stones because your UV does not match up the right way (could be because of the scale) (Google Sketchup is amazing at doing this right with ease).


Image
Pires
Licensed Customer
Posts: 35
Joined: Fri Nov 13, 2015 5:27 pm

Thanks Phantom. I dont want to sound rude or ungrateful, Im sure its great software, but the results are a bit disappointing. Sorry maybe I was expecting too much from it :oops:

As noted in my first post - "I cant think how you could ever make a UV map where there wouldnt be gaps between some of the edges" so I already knew this was a limitation! However in MentalRay renderer I believe there is a option to help eliminate this problem, so wondered if there was perhaps something similar in Octane.

I was thinking how else to solve this problem, so instead I tried using the Displacement deformer inside C4D:

Image

As can be seen the displacement works perfectly and seamlessly. However Im not sure how you could apply a useful texture to it and one that matched the bump and normals in the material on top? :?

I also tried using Tri-Planar Projection inside Substance Painter which does allows the texture to all match at the corners (although I havent tried with displacement yet and does warp the edges slightly):

Image

Anyone got any other ideas? Will investigate further tomorrow...
User avatar
Phantom107
Licensed Customer
Posts: 686
Joined: Tue Jul 24, 2012 11:31 am
Location: The Netherlands

Well, I think the result is disappointing because your cube did not have correct UV. The program cannot magically fix everything, it needs a base model that complies with properly made UV (I'm not even sure C4D has a tool to map UV around corner with absolute precision. If it can't, this will never work...). Even if it looks right from the eye in C4D, if the UV has the slightest offset, that will result in problems with the displacement. Results can be great when you set everything up correctly, let me show you one of my projects where I've applied it:

1. Model in SketchUp, very basic

Image

2. Octane with displacement fix:

Image


As good as it's gonna get (in an automated way anyway).
User avatar
Terryvfx
Licensed Customer
Posts: 377
Joined: Tue Dec 30, 2014 12:43 am

Well personally I just want to have a way that is simple and that just works I wish the render itself could have a way to deal with this if I use the default displacement in Cinema 4D on a default cube I don't get a perfect result but it's at least very very usable and when I see the results that you Phatom get using your software I get mixed feelings about Octane not having something like that.

I know GPU rendering is far more different that CPU rendering but still I wish I could use displacement in something more than a flat plane.
Attachments
Clipboard02.png
User avatar
Phantom107
Licensed Customer
Posts: 686
Joined: Tue Jul 24, 2012 11:31 am
Location: The Netherlands

Essentially what my algorithm does is re-work the geometry in a way that the displacement expects. Cause the way the displacement behaves is totally predictable, thus can be fixed. The entire problem is that the way you would model architecture is entirely different from the way the displacement expects the model to be.

Please my explanation/analysis in my topic here: viewtopic.php?f=9&t=53541#p274509

You can model your geometry in a way that the displacment system likes, but that takes a ton of time, better automate it all and focus on the design/results IMO.
User avatar
Terryvfx
Licensed Customer
Posts: 377
Joined: Tue Dec 30, 2014 12:43 am

I've visited your thread my friend and I know the work you have put in your software (it's great!) I just wish Octane had something like that built in, I don't really do architecture but for example last time I had to give up on displacing a rock model because of the damn problem with the floating geometry. I mean if it can be automated It would be really nice to have a checkbox in the Octane Object Tag that does this sort of operation on the fly or something like that.
User avatar
Phantom107
Licensed Customer
Posts: 686
Joined: Tue Jul 24, 2012 11:31 am
Location: The Netherlands

Could I have a look at this rock model? (and displacement texture?)

If Octane had it I wouldn't be making this... so from my point of view it's nice that Octane doesn't have certain essential features... :twisted:
Post Reply

Return to “Maxon Cinema 4D”