CodingMadeEasy Posted June 16, 2016 Share Posted June 16, 2016 I'm trying to get lighting to work on the backface of a mesh, but it doesn't work. After reading through the lighting tutorial, it seems like it's not possible due to the normals. I was wondering if there was any trick I could use in order to get light to reflect off the opposite sides of a mesh. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted June 16, 2016 Share Posted June 16, 2016 Hey i saw your previous Question on the Clone Light maybe this will help you, i also use backface culling Video:https://a4acc9b70392159f933adb66ef2d77dccf170c21.googledrive.com/host/0BwTQLXGKzDbZYVR5RHc5NGVvU00/ Playground:http://babylonjs-playground.com/#27G647#1 Good Luck Quote Link to comment Share on other sites More sharing options...
jerome Posted June 16, 2016 Share Posted June 16, 2016 http://doc.babylonjs.com/classes/2.4/Mesh#flipfaces-flipnormals-rarr-void Quote Link to comment Share on other sites More sharing options...
CodingMadeEasy Posted June 16, 2016 Author Share Posted June 16, 2016 Hi. Thanks for the reply. I figured out the problem with the cone problem. Now I just want to know how to get light to reflect off back faces. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted June 16, 2016 Share Posted June 16, 2016 Hello im no fully understand what you are trying to achieve. if i lean back for a secound and think about back and front faces, backfaces are normaly (unseen, skipped) in graphic engines to get more resourceses for stuff that matters - what is visibel for the user, the frontfaces. If you want to do in the hard coding way you have to duplicate and flip the faces (from my logic point of view) this can be done by babylon - easy, its made for this. here is a link, i found using a popular search enige, for blenderhttp://www.katsbits.com/tutorials/blender/double-sided-faces-different-materials.php unity codehttp://answers.unity3d.com/questions/280741/how-make-visible-the-back-face-of-a-mesh.html Quote Link to comment Share on other sites More sharing options...
Kesshi Posted June 17, 2016 Share Posted June 17, 2016 In the the old days of fixed function OpenGL you could enable two sided lighting ( glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE) ). If you want to have two sided lighting now, you have to duplicate your faces and change the face-winding and normal of the duplicates. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted June 17, 2016 Share Posted June 17, 2016 You can do the tips that Nobroski linked, but i don't like this, due to overlapping faces. it's much more simple if you just model faces that you want. If you want to set a thickness to a plane, in blender apply a solidify modifier, in 3dsmax apply a shell modifier. Quote Link to comment Share on other sites More sharing options...
CodingMadeEasy Posted June 19, 2016 Author Share Posted June 19, 2016 Thank you all for the help. It's greatly appreciated! :). Edit: One more question. I've attempted to apply the method of duplication then flipping the faces. I used the mesh.clone method to do so, but it seems as though the vertex data is shared and therefore when mesh.flipFaces is called, it flips the faces of the source mesh as well. Is there a way to do a deep copy of a mesh? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 Hello you can deep copy a mesh with mesh.makeGeometryUnique() Quote Link to comment Share on other sites More sharing options...
CodingMadeEasy Posted June 20, 2016 Author Share Posted June 20, 2016 Awesome! Thanks 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.