Jump to content

HighlightLayer or mesh.enableEdgesRendering


oschakravarthi
 Share

Recommended Posts

Hi, I want to highlight walls and floors in my model so that the separation of walls and floors will be very realistic. So, I am using HighlightLayer for this. 

The problem I am facing is, in my model, all the four walls of my room are defined as a single mesh. So, the joints of two walls are not highlighted. 

 

What I need is, the edges should be highlighted if the angle between these edges is 90 degrees.  

 

It looks like,  mesh.enableEdgesRendering is the solution for this problem. So what is the argument I need to supply for epsilon? I could not understand this concept clearly. how to convert my 90 degrees to epsilon?

What other settings I need to set to achieve highlight effect?

 

Thanks in advance

Link to comment
Share on other sites

Hi guys!  Also, you might wish perform:  yourmesh.convertToFlatShadedMesh();

Then, play-around with a few directional lights.  You might see different coloring/lighting on walls... enough for user eyes to "feel" wall delineation/separation.

.convertToFlatShadedMesh() tends to add quite a few extra vertices to your mesh, but the wall-shading goodness... might be worth it.

Remember... after the convert... play with lighting angles.  Use the handy directionLight/spotlight .setDirectionToTarget(anytarget.position)... for help aiming directional lights.

The actual .position of directional lights... is not important, UNLESS you want to cast shadows with them.  In that case, the light's .position is used in creating the shadowMap, and so, it's very important, then.  (at least I THINK that's how it all works).  :)

Also, I have seen folks use a linesMesh... to simply draw lines where walls/floors intersect.  Might work, might not.

This is a common problem.  Lack of "definition" for smooth-shaded mesh. 

Keep us posted and/or mark as solved when satisfied.  Meantime... stay tuned... more comments coming, likely.

Link to comment
Share on other sites

3 hours ago, Wingnut said:

Hi guys!  Also, you might wish perform:  yourmesh.convertToFlatShadedMesh();

Then, play-around with a few directional lights.  You might see different coloring/lighting on walls... enough for user eyes to "feel" wall delineation/separation.

.convertToFlatShadedMesh() tends to add quite a few extra vertices to your mesh, but the wall-shading goodness... might be worth it.

Remember... after the convert... play with lighting angles.  Use the handy directionLight/spotlight .setDirectionToTarget(anytarget.position)... for help aiming directional lights.

The actual .position of directional lights... is not important, UNLESS you want to cast shadows with them.  In that case, the light's .position is used in creating the shadowMap, and so, it's very important, then.  (at least I THINK that's how it all works).  :)

Also, I have seen folks use a linesMesh... to simply draw lines where walls/floors intersect.  Might work, might not.

This is a common problem.  Lack of "definition" for smooth-shaded mesh. 

Keep us posted and/or mark as solved when satisfied.  Meantime... stay tuned... more comments coming, likely.

Hi, Thanks for the suggestion. Unfortunately, I cannot use convertToFlatShadedMesh because, all my textures are emisive textures and all those meshes are excluded from existing lights. When I use convertToFlatShadedMesh , it appears like this (screenshot attached)

Untitled.png

Link to comment
Share on other sites

On 11/19/2018 at 3:56 PM, Sebavan said:

epsilon is the value compared against the dot product between vectors of both faces -> cosine of the angle. 

The default value should work with floor and walls so you do not even need to set it.

Thank you @Sebavan

what should be the value of epsilon if the angle between two edges is 90 degrees?

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