• Content count

  • Joined

  • Last visited

About yorke

  • Rank
    Advanced Member

Profile Information

  • Location
  1. Woah finally I got it working... I got crazy because I was using BABYLON.Mesh.CreateRibbon instead of BABYLON.MeshBuilder.CreateRibbon and I couldn't figure why pathArray[0] was undefined, what a n00b Many thanks jerome, that did the trick, tnx for your time
  2. Tnx for your suggestion Jerome. I tried to use those options (I didn't know them), but they seem to work for BABYLON.MeshBuilder.CreatePolygon but not for BABYLON.MeshBuilder.CreateRibbon. Here are two PGs in which I tried to set UVs to repeat texture on a 10x10 grid: For Polygons it works: http://playground.babylonjs.com/#4G18GY#8 For Ribbons, it seems to not work, grid still appears to be 1x1: http://www.babylonjs-playground.com/#165IV6#83 Am I missing something?
  3. First of all thanks to both of you for your quick replies The problem is just here: I don't know how to use the same material for all road segments, so I'm using a material per segment. Basically all roads would have to use the same material (texture is the same for them all), but I don't know how to let segment A use a different uScale than segment B, in order to not stretch or shrink texture appearance according to segment length. E.g. if segment A is longer 10 times than segment B, and they use the same material and so the same uScale, texture results larger 10 times on segment A than on segment B. Is there another way to draw repeated textures on a surface not using uScale/vScale?
  4. Ok for 2 materials, but 7k materials really don't affect performances? On another thread i read a user having problems with 2k materials, and he was told of decreasing their amount. Otherwise, what could cause the performance problem, based on the numbers I posted and your experience? Too many meshes? Vertices? Meshes are basically Ribbons for streets and ExtrudePolygon for buildings. It's impossible for me to replicate this in a PG (it also would crosspost on open street map site), so I try to paste a screenshot of the scene in wireframe. No other computations are done, after having built the scene. 6 fps in wireframe, fps decrease at 3-4 with solid rendering
  5. Hi all, in order to improve the performance of a scene built dinamically, I'm facing this problem: is it possible to have one material, to which is applied one texture, using different uScale e vScale depending on the mesh to which that material is applied? I need this because I have a 3d model of a city with many street segments, each segment having quite different length from each others. Now, those segments are textured: if I use the same uScale for them all, the road texture would appear "stretched" or "shrinked" depending on the length of the segment on which the material is applied, while I want it to appear uniform. I can bypass this problem assigning one different material for every street segment and setting uScale according to its length, but in the end the amount of materials and textures grows dramatically and scene performance falls down at 3 - 4 fps. Any ideas of how reducing the number of materials? Those are the actual stats for a mid-sized city: Total meshes 7309 - Total vertices 170688 - Total materials 7309 - Total textures 3834 Any ideas on how to solve this? Thanks in advance, cheers
  6. yorke

    Desktop - Online 3D Golf Game Simulation

    ogcopen has been the best awesome browser game for years imho, even being written on an (now) old platform. I spent a ton of hours on it and i'd like to thank you for such a piece of software, it was the ogame of browser sports games New version is really slow on my quite dated laptop, graphics are nice but I can't really give you a feedback because of this, game is unpalyable. However I hope you'll keep up the awesome work you did with old (actual) version, still thanks
  7. yorke

    Is cel shading supported?

    Woah tnx Luaacro, awesome! I like BJS's community reactivity I'm experiencing the same error posted by dad72 on the PG, will this feature be avalaible in BJS v3 stable release?
  8. yorke

    Is cel shading supported?

    Up. I tried to mix cel shader from the link posted by adam with raggar's code but meshes are now rendered totally black, here is what I did: <script type="application/vertexShader" id="vertexShaderCode"> [...] <script type="application/fragmentShader" id="fragmentShaderCode"> [...] mesh.material.subMaterials[0]=createCellShader(mesh.material.subMaterials[0].clone("CLONEMAT"),scene); [...] function createCellShader (material,scene) { var cMaterial = new BABYLON.ShaderMaterial ( "amiga", scene, { vertexElement: "vertexShaderCode", fragmentElement: "fragmentShaderCode", }, { attributes: ["position", "normal", "uv"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"] } ); if(material) { if(material.diffuseColor) cMaterial.diffuseColor = material.diffuseColor; if(material.diffuseTexture) cMaterial.diffuseTexture = material.diffuseTexture; } return cMaterial; } Any ideas? I also tried to change light position in shaders but nothing changed. I don't know how to investigate this
  9. yorke

    Is cel shading supported?

    Thank you raggar. That could be a nice solution, i'll give a try
  10. yorke

    Is cel shading supported?

    Many tnx for your link adam. Shader's code is clear, but it's not clear to me how to apply the shader on materials exported form blender. If I apply this code: var amigaMaterial = new BABYLON.ShaderMaterial(...custom vertex and pixel shader ) scene.materials[n] = amigaMaterial; every material in the scene would be overwitten (I think), so it would loose what i've defined in blender for that material (texture, diffuseColor etc). On the opposite, I'd like every material to preserve its original properties and change only the shader. Is it possible to achieve this in some way or I have to create every time a new ShaderMaterial and "manually" append the properties from the original material to it? Tnx in advance
  11. Hi all. I'd like to know if BJS supports cel (toon) shading? Didn't find anything about that. My scene is exported from Blender, the goal would be to apply cel shading on all meshes. Lurking the code i saw that there's a mesh.convertToFlatShadedMesh() function, but nothing similar about cel shading. Any ideas? Tnx, cheers
  12. yorke

    STL binary parser

    Hi, I never used STL format but three.js has an ASCII .stl importer, you can try reverse engineering that: https://threejs.org/examples/js/loaders/STLLoader.js There are also converters for binary <--> ascii STL formats, you can search on the internet. By example I found this: https://github.com/cmpolis/convertSTL/blob/master/convertSTL.rb
  13. yorke

    Composition of rotations on bone

    Really strange, I can't see the old dropdown to select BJS version nor in firefox 48 nor in chrome 56
  14. yorke

    Composition of rotations on bone

    Thanks raggar, I saw your PG and I'm investigating what's wrong in my scene or models, that's really strange. At least you confirmed me that both functions use the same conventions for eulers, that's a good starting point. In previous PGs there was the option to run the PG on an older version of BJS, was this feature removed on PGs from BJS3? I can't see that option. For what concerns upgrading to v3, you're right but I saw that v3 is not marked as stable yet. I'm surely planning to upgrade and wasting some time to let my code compatible with it, but I'll first wait for the stable version
  15. yorke

    Composition of rotations on bone

    Sorry I've still another question on this topic, I couldn't find an answer to this on the forum and official docs on rotations didn't help me. The question is: is there a way to get yaw, roll and pitch of a bone? Let me explain: I can rotate a bone using eulers: mesh.skeleton.bone.setYawPitchRoll(y,x,z) But how do I read those Eulers from the bone? if I try to read them using mesh.skeleton.bones.getRotation() I would have expected to obtain exactly x,y and z passed to setYawPitchRoll() function, but results are quite different. Lurking BJ'S code, I saw that getRotation() gets bone's RotQuaternion and calculates toEulers() on it, so I can't understand why results are different. By example: getRotation() output (x,y,z) coincide with values passed to setYawPitchRoll(y,x,z) only if x=z=0 and y in [0 , 3.14]. I tried both in local and world spaces but with no result, also tryed with quaternions but didn't arrive to anything... Am I missing something or babylon uses different euler conventions in those two functions?