ozRocker

Members
  • Content count

    576
  • Joined

  • Last visited

  • Days Won

    3

ozRocker last won the day on January 28

ozRocker had the most liked content!

1 Follower

About ozRocker

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://www.punkoffice.com

Profile Information

  • Gender
    Male
  • Location
    Melbourne, Australia

Recent Profile Visitors

1,298 profile views
  1. Sorry for my comment. I guess I was just thinking out loud.
  2. I wish there was a dedicated chip for hair, also for pixel perfect collision. Hair and collision are always the most problematic and processor intensive areas.
  3. Do you think it'd be possible to morph using a target that only contains the vertices that are different? So if I have a person and the only thing that is changing is their face then I could just store the points for their face, instead of having to store all vertices for the whole body. I don't know too much about morphing so I'm not sure if this is possible
  4. We have resolved the "undefined materials" problem here in this thread:
  5. Thank you for that. Now I know how it works I found where I can insert a little hack. in babylon.objFileLoader.ts I changed calls: return new BABYLON.Texture(url, scene); to return new BABYLON.Texture(url, scene, true, true, 1, textureLoad); then in my OBJ loading code I have this: texturesLoaded = 0; var newMesh; //Callback function textureLoad = function() { texturesLoaded++; if (texturesLoaded == 2) { var material = newMesh.material; material.backFaceCulling = false; material.emissiveColor = new BABYLON.Color3(0.7, 0.7, 0.7); } } //.OBJ loading BABYLON.SceneLoader.ImportMesh("", "uploads/models/" + directory + "/", objFile, Assets.scene, (meshes) => { Tools.debug(1, "Mesh imported"); newMesh = meshes[0]; }, () => { Tools.debug(1, "Progress"); }, (scene, message, exception) => { Tools.debug(1, "Error: " + message); }); texturesLoaded and textureLoad are global variables. Of course this is assuming there are only 2 textures I like to use the callback function instead of polling because polling will make asynchronous back to synchronous
  6. I've made a playground here http://www.babylonjs-playground.com/#28YUR5#209 What you can see from the console output is that the textures get loaded after a slight delay. If I try to access materials straight away its undefined. I have to wait until the textures are fully loaded to access materials. Is there a callback function I can use to access the material after the textures have been loaded?
  7. I found the problem with my coding. I did this to check if webGL is supported: function webgl_detect(return_context) { if (!!window.WebGLRenderingContext) { var names = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"], context = false; for(var i=0;i<4;i++) { try { context = canvas.getContext(names[i]); if (context && typeof context.getParameter == "function") { // WebGL is enabled return true; } } catch(e) {} } // WebGL is supported, but disabled return false; } // WebGL not supported return false; } which is stupid because I can just use BABYLON.Engine.isSupported() instead. But that code above gave all those errors with the preview release of babylon.js So now if you go to http://punkoffice.com/weight you'll see that it works on desktop and mobile
  8. I'm testing out the preview release of babylon.js When I run this line on desktop and mobile browsers: diffuseTexture1 = BABYLON.Texture.LoadFromDataString("diffuse",data,scene); I get the errors shown in the image below. It works fine in current version of babylon.js
  9. I figured out what's wrong. I get this crash on everything when I use the latest preview version of babylon.js (I downloaded it from GIThub 10 minutes ago). I've applied that preview version to my old stuff that just displays a mesh from a .babylon file and it crashes at executeWhenReady(). They all do. Fine in desktop browsers but crashes in iOS. So its nothing to do with the morphing code that I'm using. However, I don't get any errors when morphing in the playground. Is the playground using a different version of babylon.js? I've attached the output
  10. Do you know why material doesn't work? Am I meant to do something to set it up? console output tells me its undefined http://www.babylonjs-playground.com/#28YUR5#207
  11. ah ok, thank you! It works http://www.babylonjs-playground.com/#28YUR5#205
  12. I'm using the .OBJ file here http://preview.punkoffice.com/morph/weight.obj In that .OBJ there are 2 meshes. There's the normal girl. Then what I did was simply "duplicate" her so I have a copy with exact same vertices, then I made her fat. In Blender and when using SceneLoader it properly shows that they both have 7,405 vertices, but in the method I'm using in the playground one has 7,405 and the other has 14,810 (exactly double). You can see in the console output
  13. I'm trying to load an OBJ in the playground. There are 2 meshes in the OBJ with exact same number of vertices. This works in normal code when I use BABYLON.SceneLoader.Load() but when I use this special playground technique I get funny side-effects. One of the meshes is twice the number of vertices as the other one: http://www.babylonjs-playground.com/#28YUR5#202 You can see it in the console output. Is there another way to load an OBJ in the playground?
  14. I think I need to wait for an upgrade to the Blender exporter and OBJ loader cos at the moment none of them are supporting mesh duplicates properly
  15. Yes that works. I've made a playground here using my mesh: http://www.babylonjs-playground.com/#28YUR5#201 I can't get it to compile. I have to use an OBJ loader but this OBJ loader loads one of the meshes as twice the number of vertices as the first mesh. I don't know any other way to load an OBJ in the playground