Baking Bevel in Cycles

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

I've created a series of comparison renderings between Cycles and Luxcore both using Normal Maps and Bump Maps. I've used some rock pebble maps from CC0 with lots of details. There are versions with just the sphere and the HDRI in the background and there are versions with a ground plane below the sphere. Especially the versions with the ground plane show the issue with the black areas rather well. As mentioned before, there's also something going on with the bump maps. They look quite different and there are issues with dark areas and hard edges as well. Maybe this helps to find the culprit of the issue.

Here's a layered Photoshop file which is great to compare the renderings ... http://www.argfx.at/upload/NormalBump_Comparison_01.zip

And here are the side-by-side JPG's for viewing the images in the forum.

NORMAL MAP
Image

NORMAL MAP WITH GROUND PLANE
Image

BUMP MAP
Image

BUMP MAP WITH GROUND PLANE
Image
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Baking Bevel in Cycles

Post by Dade »

Actually, the lighting of Cycles looks totally wrong to me, the bright border of the sphere edges doesn't make sense, it is pulling light out of nowhere :?:
Support LuxCoreRender project with salts and bounties
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Baking Bevel in Cycles

Post by kintuX »

AndreasResch wrote: Thu Mar 04, 2021 10:02 am
kintuX wrote: Wed Mar 03, 2021 1:57 pm 2. edit: indeed, after further testing it looks like there's discrepancy in one of the axes(?)
Thanks for confirming this. Maybe this could be investigated. If you need any assets, let me know.

Cheers.
Well, I ran out of time to investigate it further.
But very nice to see it solved.

About the latest, "darkening" so to speak, I guess it's the lack of Microfacet Based Normal Mapping feature in LuxCore.
e.g.
Image

ps
another great reference is appleseed's "Google Summer of Code 2020 Report - Microfacet Based Normal Mapping" by Lovro Bosnar
Last edited by kintuX on Fri Mar 05, 2021 9:27 am, edited 1 time in total.
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

Dade wrote: Fri Mar 05, 2021 8:59 am Actually, the lighting of Cycles looks totally wrong to me, the bright border of the sphere edges doesn't make sense, it is pulling light out of nowhere :?:
It's just a single environment HDRI. Here's the comparison without the normal/bump maps enabled.

Image
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Baking Bevel in Cycles

Post by Dade »

BTW, very first rendering of a bevel cube with v2.6 code:

bevel.jpg

Notice as it is true geometry (it is done with "capsules": https://www.shadertoy.com/view/Xt3SzX), not fake shading normal tricks (not even triangles). It also doesn't require to trace additional rays.
Based on paper: "Efficient Rendering of Rounded Corners and Edges for Convex Objects" (Simon Courtin, Sébastien Horna, Mickaël Ribardière Pierre Poulin and Daniel Meneveaux) https://simoncourtin.github.io/publicat ... vex-object
Support LuxCoreRender project with salts and bounties
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: Baking Bevel in Cycles

Post by TAO »

Dade wrote: Tue Mar 09, 2021 10:20 am BTW, very first rendering of a bevel cube with v2.6 code:


bevel.jpg


Notice as it is true geometry (it is done with "capsules": https://www.shadertoy.com/view/Xt3SzX), not fake shading normal tricks. It also doesn't require to trace additional rays.
Based on paper: "Efficient Rendering of Rounded Corners and Edges for Convex Objects" (Simon Courtin, Sébastien Horna, Mickaël Ribardière Pierre Poulin and Daniel Meneveaux) https://simoncourtin.github.io/publicat ... vex-object
Amazing as i can see many users ask for it. nice to see bevel features in LuxCore.
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

Dade wrote: Tue Mar 09, 2021 10:20 am BTW, very first rendering of a bevel cube with v2.6 code:
Damn it. We ask for a Toyota and get a Lamborghini. I hope this works well on subtle bevels as well. If it does, I will skip 2.5 and head for 2.6 Alpha straight away.

Will the normal/bump issue be investigated nonetheless?
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Baking Bevel in Cycles

Post by Sharlybg »

Fantastic :ugeek:
I hope this works well on subtle bevels as well
There is no reason why it shouldn't (in the paper the method seem to be just fine )
Bevel_Shader.jpg
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

Yeah. I've checked the papers and the video after I have written it. Looks really impressive. Can't wait to test it.
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Baking Bevel in Cycles

Post by kintuX »

Capsule for edges is just f***ing ingenious :mrgreen:

That's why I love you Dade, always delivering amazing surprises!

PS
BTW, have you considered how to tackle and represent concave edges then?
Post Reply