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.
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 »

AndreasResch wrote: Wed Mar 03, 2021 5:34 pm
Dade wrote: Wed Mar 03, 2021 3:20 pm Can you bake a cube with bevel edges and post the the texture image you are using for the LuxCore rendering ?
Here's a normal map for a beveled cube, baked in Cycles.
http://www.argfx.at/upload/BevelBake_Normal_02.zip
The normal map seems to work as expected if applied to a plane. The UV unwrap looks a bit strange: it is not the default way Blender unwrap a cube. Are you sure it is correct ?
Support LuxCoreRender project with salts and bounties
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

The cube was unwrapped with Smart Unwrap in Blender - pretty normal stuff. It's hard to provide you with anything else if you don't use Blender. Otherwise I would sent you a file containing the cube.
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

Dade wrote: Thu Mar 04, 2021 10:20 am The normal map seems to work as expected if applied to a plane. The UV unwrap looks a bit strange: it is not the default way Blender unwrap a cube. Are you sure it is correct ?
I applied the provided normal map to a plane as well - both in Cycles and in Luxcore. While in Cycles the overall reflection of the plane stays intact, in Luxcore it has changed completely. That's the same result that can be seen on the more complex model.

Here's the comparison ...
Image
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

I think, that I found the problem. I need to bake the normal maps in the "Non-Color" color space in Cycles. I baked them in "Linear" color space before, which Luxcore doesn't seem to use and can't be chosen as an option (as in Cycles).

Here's a comparison of the two bakes ...
Image

I'll do some more tests to have this confirmed. I'm a bit surprised that it worked for you though. Did you use any specific settings that can handle linear normal maps?
JulianoLisboa
Posts: 146
Joined: Sat Feb 22, 2020 3:29 am

Re: Baking Bevel in Cycles

Post by JulianoLisboa »

Dade wrote: Thu Mar 04, 2021 9:39 am
JulianoLisboa wrote: Wed Mar 03, 2021 5:23 pm I intrude into the discussion, wasn't the shader bevel expected to come in version 2.5?Bevel Shader.png
The work is going on this (v2.6) branch: https://github.com/LuxCoreRender/LuxCor ... geom_bevel
Already have how to download to test?
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

Here's the model from before now working perfectly fine with the properly baked normal map (using Non-Color color space).

Image

This is a nice workaround for now until the bevel shader makes it into Luxcore.
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 »

AndreasResch wrote: Thu Mar 04, 2021 11:49 am I think, that I found the problem. I need to bake the normal maps in the "Non-Color" color space in Cycles. I baked them in "Linear" color space before, which Luxcore doesn't seem to use and can't be chosen as an option (as in Cycles).
You have probably gamma correction applied to the normal map or some kind of color space transformation (both will mangle the normal map).
Support LuxCoreRender project with salts and bounties
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 »

AndreasResch wrote: Thu Mar 04, 2021 11:49 am I'll do some more tests to have this confirmed. I'm a bit surprised that it worked for you though. Did you use any specific settings that can handle linear normal maps?
I have probably used the correct gamma value (so LuxCore does reverse the gamma correction and fix the problem): gamma + reverse gamma = original unmodified image (rounding errors aside).
Support LuxCoreRender project with salts and bounties
AndreasResch
Posts: 135
Joined: Fri Jul 06, 2018 9:32 am

Re: Baking Bevel in Cycles

Post by AndreasResch »

Dade wrote: Thu Mar 04, 2021 12:46 pm
AndreasResch wrote: Thu Mar 04, 2021 11:49 am I think, that I found the problem. I need to bake the normal maps in the "Non-Color" color space in Cycles. I baked them in "Linear" color space before, which Luxcore doesn't seem to use and can't be chosen as an option (as in Cycles).
You have probably gamma correction applied to the normal map or some kind of color space transformation (both will mangle the normal map).
Nothing applied. Straight from the image texture node into the Disney shader. See the screenshot on page 1.
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 »

AndreasResch wrote: Thu Mar 04, 2021 12:49 pm
Dade wrote: Thu Mar 04, 2021 12:46 pm
AndreasResch wrote: Thu Mar 04, 2021 11:49 am I think, that I found the problem. I need to bake the normal maps in the "Non-Color" color space in Cycles. I baked them in "Linear" color space before, which Luxcore doesn't seem to use and can't be chosen as an option (as in Cycles).
You have probably gamma correction applied to the normal map or some kind of color space transformation (both will mangle the normal map).
Nothing applied. Straight from the image texture node into the Disney shader. See the screenshot on page 1.
Yes but I write the scene in text format by hand: I can set the expected gamma of the image (1.0 or 2.2).
Support LuxCoreRender project with salts and bounties
Post Reply