## material problem issue

Discussions about LuxRender's materials, and how to make the most of them.

Moderator: coordinators

### Re: material problem issue

It wont be a problem on high density mesh.
PerPixel

Posts: 107
Joined: Fri Jul 03, 2009 7:13 am

### Re: material problem issue

PerPixel wrote:It wont be a problem on high density mesh.

sorry... but I have just this problem, with some imported geometries! I will try to quadrangulate this one...hope that this could help!
I think that the best solution would be just a simple 2-sided function to add to all LrMaterial.
anyway thank for your help and time.
patro

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: material problem issue

Hi,

Most probably having the material 2 sided won't help (actually most materials are 2 sided). What happens with shading normals is that your ray can hit the surface from above if you consider the geometric normal, but from below if you consider the shading normal. In such a case the ray will be reflected below the surface and be rejected.

Jeanphi
jeanphi

Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

### Re: material problem issue

Hi Jeanphi
PerPixel wrote:I can confirm the normal do point at the right place and the issues seems to be that you have a large flat surface followed by an angle. Your smoothing group in max by default would set a chamfer box to have all surface smoothing together so the vertices sharing the flat surface and the chamfer edge create the bug. Adding move segments or setting a different smoothing group on the flat surface solve this.

I'm not sure if this is the expected behavior in Luxrender but I dont know what else I can do with the normals.

jeanphi wrote:Hi,

Most probably having the material 2 sided won't help (actually most materials are 2 sided). What happens with shading normals is that your ray can hit the surface from above if you consider the geometric normal, but from below if you consider the shading normal. In such a case the ray will be reflected below the surface and be rejected.

Jeanphi

don't worry about the other post.
my request was crossed since no one answered about the matter.. and PerPixel couldn't fix the issue.... so I though that Lux materials are one sided.

anyway are the materials 2 sided by default? if no... please could you write the code part to add to materials in a lxs file?...
as I just say in the cross post: all faces will be rendered correctly shaded even if it does not solve the normal issue.
this is my experience with the 2sided materials in all other renderer.
I want to try/experiment this solution... I want to see if this at time could fix my problem. isn't a real solution... but probably it could work.
Code: Select all
# Plane001AttributeBeginMaterial "matte" "color Kd" [0.352941 0.352941 0.352941]# ChamferBox002AttributeBegin#Nk Data path :   Material "metal" #Not using NKData    "string name" ["copper"]"float vroughness" [0.100000]"float uroughness" [0.100000]

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: material problem issue

Hi,

Maybe I wasn't clear enough. Here is what's happening:
black patch situation
shading.png (8.43 KiB) Viewed 280 times

So when you increase the tesselation you obviously decrease the effect because the shading and geometric normals are closer. A matte material scattering in all directions is able to compensate for this situation while a polished metal is not.

Jeanphi
jeanphi

Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

### Re: material problem issue

nope,
you were just clear enough like Perpixel and like zsouthboy in his post.
viewtopic.php?f=36&t=4534&start=40#p48310.

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: material problem issue

Hi,

So why do you insist that two sided materials will solve the issue while it clearly doesn't (as demonstrated by my schematic and as you've experienced in practice)?
The only way to make things better is to have more faces.

Jeanphi
jeanphi

Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

### Re: material problem issue

I'm not saying that you are wrong... or do you read something like this?

my experience is that other rendering engine like maxwell, fryrender had this kind of problem in the past... and using the flagging 2sided function... will not solve the normal issue... but don't show the black patch issue in the rendered image.
this function were requested from user. this is not my opinion but what happens!
obviously I'm not here to teach you how to write Luxrender.. I can only make some requests

I asked only for the code part to add to the material definition in the lxs... to activate the 2sided function in my materials... if it's not just activated by default in Luxrender. that's all.

naturally I followed the advice of perpixel to add smoothing group and/or to increase tessellation... but this require a lot of new faces to solve the issue.... and it's manageable with a simple max geometry... but is very difficult to do that with a lots of imported dense mesh.
I will have export time increasing.. with probably hanging and so on............

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: material problem issue

patro wrote:I'm not saying that you are wrong... or do you read something like this?

my experience is that other rendering engine like maxwell, fryrender had this kind of problem in the past... and using the flagging 2sided function... will not solve the normal issue... but don't show the black patch issue in the rendered image.
this function were requested from user. this is not my opinion but what happens!
obviously I'm not here to teach you how to write Luxrender.. I can only make some requests

I asked only for the code part to add to the material definition in the lxs... to activate the 2sided function in my materials... if it's not just activated by default in Luxrender. that's all.

naturally I followed the advice of perpixel to add smoothing group and/or to increase tessellation... but this require a lot of new faces to solve the issue.... and it's manageable with a simple max geometry... but is very difficult to do that with a lots of imported dense mesh.
I will have export time increasing.. with probably hanging and so on............

A dense mesh will usually - by just being dense - not have such a big difference between interpolated (shading) normals and the geometric normals, and as such will not have this problem. The problem is a very well known problem in CG and is most noticeable when turning on smoothing on a mesh with too few triangles and/or has a high curvature (i.e. abrupt changes in the geometric normals between faces).

Tom

tomb

Posts: 1919
Joined: Thu Oct 11, 2007 4:23 pm
Location: Oslo, Norway

### Re: material problem issue

tomb wrote:A dense mesh will usually - by just being dense - not have such a big difference between interpolated (shading) normals and the geometric normals, and as such will not have this problem. The problem is a very well known problem in CG and is most noticeable when turning on smoothing on a mesh with too few triangles and/or has a high curvature (i.e. abrupt changes in the geometric normals between faces).

Tom

I have this problem on dense watch hands.... the upper faces are planar like the chamferbox and the lateral faces are smoothed like the chamfer surface of the box.
by the way.....
what to do if a dense mesh have also a lot of flipped faces/normals.... very difficult and bothering to select and to flip on a high number of complicated dense mesh. the 2-sided will solve the problem on the rendered image. this is another way to use the 2-sided function.

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

PreviousNext