hw3web Posted January 20, 2014 Share Posted January 20, 2014 Hi there is there any chance for Flat shading appear soon in babylon Blender exporter as it will improve a lot of possibilities, I know is there lot of other " more important" things to focus on but I believe that flat shading is very important to people who deal with graphic not just a scripring side. Thank you. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 20, 2014 Share Posted January 20, 2014 Please see the Roadmap. it's on their list of TODOs. https://github.com/BabylonJS/Babylon.js/wiki/Roadmap Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 20, 2014 Share Posted January 20, 2014 Yes it is, and it is one of our top priority for next version Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 21, 2014 Author Share Posted January 21, 2014 I know. Thank you make it . I put this message as I did talk about it from 1.5 version . But I am very happy that you have in agenda with high priority. Thank you very much for all work you do to making BabylonJS . It is my favourite js framework. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 24, 2014 Share Posted January 24, 2014 Your word is my command I've just checked in the draft version of this new API: BABYLON.Mesh.prototype.convertToFlatShadedMesh = function() { /// <summary>Update normals and vertices to get a flat shading rendering.</summary> /// <summary>Warning: This may imply adding vertices to the mesh in order to get exactly 3 vertices per face</summary> gwenael 1 Quote Link to comment Share on other sites More sharing options...
gwenael Posted January 24, 2014 Share Posted January 24, 2014 Awesome. Thank you. Deltakosh, I read your changes and I'm wondering if the following lines insure you that the normal is not flipped:var p1p2 = p1.subtract(p2);var p3p2 = p3.subtract(p2);var normal = BABYLON.Vector3.Normalize(BABYLON.Vector3.Cross(p1p2, p3p2));What is the order of indices? Is it - counter clockwise +1 +2 +3 or clockwise +1 +3 +2 ? Counter clockwise should give a normal from the screen to the viewer whereas clockwise should give a normal from the viewer to the screen (back face). So I suppose it's counter clockwise: +1 +2 +3 the normal should be the cross product (in this order) between p3p2 (from p2 to p3 if I keep the convention you use: p3.subtract(p2)) and p1p2 (or p2p1 and p3p1) but NOT p1p2 and p3p2. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 24, 2014 Share Posted January 24, 2014 Indices are CCW Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 25, 2014 Author Share Posted January 25, 2014 is there any chance Flat shading will be automaticly apply in flat mesh from Blender ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 25, 2014 Share Posted January 25, 2014 Where is this option in Blender? Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 26, 2014 Author Share Posted January 26, 2014 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 26, 2014 Share Posted January 26, 2014 It is a property of the mesh or do you have to go to edit mode? Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 26, 2014 Author Share Posted January 26, 2014 it is in the Edit mode that what Blender doc say :http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Smoothing I found this as well , that may help , from Objects to the X-Plane exporter , I don't know python but that how they fix it :https://github.com/der-On/XPlane2Blender/commit/b04599f7f973f77931051b8dbc4442235cacfe99 That someway connected to threeJS:http://stackoverflow.com/questions/21061100/three-js-r64-blender-json-export-miss-normals-for-smooth-shading hope it could be made easy and soon Thank you. Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 27, 2014 Author Share Posted January 27, 2014 that other place I believe could be helpful in building new version of exporter with Flat / Smooth shading http://wiki.theprovingground.org/blender-py-modifiers Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 27, 2014 Share Posted January 27, 2014 My problem is this is not related to the entire object but only for specific faces Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 27, 2014 Author Share Posted January 27, 2014 that reasons in exporter need to be I believe like in this X-Plane exporter https://github.com/der-On/XPlane2Blender/commit/b04599f7f973f77931051b8dbc4442235cacfe99 each vertice Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2014 Share Posted January 28, 2014 yes but I cannot do that per vertices. Only per mesh Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 29, 2014 Author Share Posted January 29, 2014 is not just reversing normal of the vertices in exporter for flat one ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2014 Share Posted January 29, 2014 Alas not. Because if a vertex is member of more than one face the game get more complex Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 29, 2014 Author Share Posted January 29, 2014 What about flat / smooth shading for all object/mesh , to able export from blender for example 2 meshs one flat second smooth !? , then if someone need flat just split mesh in two or more and dedicate what is what . ? Sorry to make it such a fuss about it but for me as I believe for many who want present model in best as they can accuracy is very important. Thank you very much for looking in to this matter. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2014 Share Posted January 29, 2014 This will be too much data. The best idea for you is to write a small bunch of code to manually active flat shading on your object Other idea: a custom property for babylon into blender to activate it. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2014 Share Posted January 29, 2014 Here is what I did for next version: Metalx1000 and gwenael 2 Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 29, 2014 Author Share Posted January 29, 2014 next version !? exporter ? , when it will be available and compatibile with blender JS? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2014 Share Posted January 29, 2014 Blender JS? What do you mean?Here is the new exporter just for you: http://www.babylonjs.com/forumpics/flat.zip gwenael 1 Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 29, 2014 Author Share Posted January 29, 2014 thank you very much . I hope changes will be include on public exporter so everyone could enjoy it my mistake , I meant Babylon JS , thank you again , will test right now Quote Link to comment Share on other sites More sharing options...
hw3web Posted January 29, 2014 Author Share Posted January 29, 2014 did you test it as using this babyln js I got [23:38:56.060] TypeError: vertexBuffer is undefined @ http://office-pc/en/yacht/js/babylon.js:1 but is can be related to water I will check again later 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.