oschakravarthi Posted November 19, 2018 Share Posted November 19, 2018 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 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 19, 2018 Share Posted November 19, 2018 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. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 19, 2018 Share Posted November 19, 2018 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. Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted November 19, 2018 Author Share Posted November 19, 2018 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) Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted November 20, 2018 Author Share Posted November 20, 2018 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? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 20, 2018 Share Posted November 20, 2018 The default one will work, so mesh.enableEdgesRendering() will be sufficient. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.