Jump to content

Dirty looking shading


ozRocker
 Share

Recommended Posts

I seem to get dirty looking areas on surfaces facing at an angle from the light source.  It literally looks like dirt or grease has been smeared on the model.  I've attached an image which shows it on the top of the arms, forehead and bridge of the nose.  I've never seen this kind of effect in any other 3D editor.  I've been playing around with lighting trying to fix this problem.  I'm not sure what I'm doing wrong.

I've put up a playground here http://www.babylonjs-playground.com/#19K1J2#10 (for some reason I cannot move the camera in the playground)

dirty_surface.jpg

Link to comment
Share on other sites

This comes from the way the ambient is managed in the shader. The greasy looking area should be in shadow but only enhance by ambient. I can also notice that you already have shades in your diffuse so the light is almost not usefull in your model as it it is like a fully baked one. you can then push only the diffuse and disable the light to speed up the rendering.

http://www.babylonjs-playground.com/#19K1J2#11

 

Link to comment
Share on other sites

3 minutes ago, Sebavan said:

This comes from the way the ambient is managed in the shader. The greasy looking area should be in shadow but only enhance by ambient. I can also notice that you already have shades in your diffuse so the light is almost not usefull in your model as it it is like a fully baked one. you can then push only the diffuse and disable the light to speed up the rendering.

http://www.babylonjs-playground.com/#19K1J2#11

 

isn't this the same as making emissiveColor (1,1,1) ?  That means there is no lighting effect at all.  Yes there is some light baked into the texture from a light source from above going down.  You can see it on the neck and between the legs.  But I still wanted to add some dynamic lighting so you can see the topology.  But anyway, I don't think those baked shadows are related to the grease/dirt effect

Link to comment
Share on other sites

yep same as making emissive white.

Nope the issue does not come from the baked shadow, nor the lighting but the mix of baked information and lighting.

The issue is also more visible with the use of the bump map. Without it, it still looks weird:

http://www.babylonjs-playground.com/#19K1J2#12

The shaded area seems pretty blue like the top of the forearm for instance but this is also in the diffuse texture itself.

You would need to add lighting on top of it either to extract the information and split the textures or use some color curves setup and at last a post process if the rest is not in your plans.

Link to comment
Share on other sites

3 minutes ago, Sebavan said:

yep same as making emissive white.

Nope the issue does not come from the baked shadow, nor the lighting but the mix of baked information and lighting.

The issue is also more visible with the use of the bump map. Without it, it still looks weird:

http://www.babylonjs-playground.com/#19K1J2#12

The shaded area seems pretty blue like the top of the forearm for instance but this is also in the diffuse texture itself.

You would need to add lighting on top of it either to extract the information and split the textures or use some color curves setup and at last a post process if the rest is not in your plans.

That sounds about right.  Thanks for the tip!  I'll have a play with some extra lights.  @Nabroski made a cool playground for me to try out so hopefully that will help.  I noticed that Blender also has the same dirty effect when using a point light.  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...