nittrus

Members
  • Content Count

    88
  • Joined

  • Last visited

About nittrus

  • Rank
    Advanced Member
  • Birthday November 2

Contact Methods

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

Profile Information

  • Location
    Vermont, USA
  • Interests
    Programming, game development, everything HTML5, web development, cycling, kayaking

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Just a follow up, I had to set the terrain tri-planar mapping material needDepthPrePass to true. trimaterial.needDepthPrePass=true; This resolves the issue, just in case anyone needs to know.
  2. Found the issue and I haven't a clue what the line of coding causing it was for but it had to do with clamping Z quaternion, I'm going based on memory now as I had to leave after I had fixed the issue and came back to see your reply. I still have no idea why that would have caused the issue but it seems it was something that got added for a reason that is no longer valid so yeah, all fixed, not a bug in Babylon after all just my code!
  3. I may have spoke to soon.. this is odd, I create objects then give them imposter and they are fine, but for some reason my actor model falls through the ground and it uses boxImposter so it's not complex, it only happens with certain imported meshes though.. is there anything known that could cause one imported mesh to behave like that but not another all using boxImposter? Something is going on but not what I initially thought.
  4. Sadly physics with heightmap no longer works in versions > 3.0 objects sink through terrain This is a rather important and critical feature and it was working fine until 3.0...
  5. I found that this issues is the same for trying to receive shadows on the built in watermaterial, so maybe it is related? waterMesh.receiveShadows=true true babylon.2.5.js:3 BJS - [17:26:31]: Unable to compile effect: t._ErrorEnabled @ babylon.2.5.js:3t._prepareEffect @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._processIncludes @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._loadFragmentShader @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._processIncludes @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._loadVertexShader @ babylon.2.5.js:15t @ babylon.2.5.js:15s.createEffect @ babylon.2.5.js:5n.isReady @ water.min.js:1r.render @ babylon.2.5.js:13t.render @ babylon.2.5.js:14t.renderUnsorted @ babylon.2.5.js:11t.render @ babylon.2.5.js:11t.render @ babylon.2.5.js:10i._renderForCamera @ babylon.2.5.js:12i._processSubCameras @ babylon.2.5.js:12i.render @ babylon.2.5.js:12dorender @ index.html:410(anonymous function) @ index.html:334s._renderLoop @ babylon.2.5.js:4 babylon.2.5.js:3 BJS - [17:26:31]: Defines: #define BUMP #define REFLECTION #define FOG #define NORMAL #define UV1 #define NUM_BONE_INFLUENCERS 0 #define BonesPerMesh 0 #define SPECULARTERM #define LIGHT0 #define DIRLIGHT0 #define LIGHT1 #define DIRLIGHT1 #define LIGHT2 #define DIRLIGHT2 #define SHADOW0 #define SHADOWS #define SHADOWPCF0 #define SHADOW1 #define SHADOWPCF1 #define SHADOWFULLFLOAT t._ErrorEnabled @ babylon.2.5.js:3t._prepareEffect @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._processIncludes @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._loadFragmentShader @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._processIncludes @ babylon.2.5.js:15(anonymous function) @ babylon.2.5.js:15t._loadVertexShader @ babylon.2.5.js:15t @ babylon.2.5.js:15s.createEffect @ babylon.2.5.js:5n.isReady @ water.min.js:1r.render @ babylon.2.5.js:13t.render @ babylon.2.5.js:14t.renderUnsorted @ babylon.2.5.js:11t.render @ babylon.2.5.js:11t.render @ babylon.2.5.js:10i._renderForCamera @ babylon.2.5.js:12i._processSubCameras @ babylon.2.5.js:12i.render @ babylon.2.5.js:12dorender @ index.html:410(anonymous function) @ index.html:334s._renderLoop @ babylon.2.5.js:4 babylon.2.5.js:3 BJS - [17:26:31]: Error: ERROR: 0:81: '{' : unexpected token ERROR: 0:81: 'syntax error' : invalid expression ERROR: 0:81: '{' : unexpected token after conditional expression ERROR: 0:163: '{' : unexpected token ERROR: 0:163: 'syntax error' : invalid expression ERROR: 0:163: '{' : unexpected token after conditional expression
  6. var terratiles = scene.getMeshesByTags("terra"); var meshes = scene.getMeshesByTags("mesh"); for(var index=0; index < terratiles.length; index++){ //remove tiles outside of max range var tt = terratiles[index]; var ttid = tt.id; //Remove if(phys){ if(Math.round(getdist({x: tt.position.x, y: tt.position.y, z: tt.position.z},{x: actor.physicsImpostor.getObjectCenter().x, y: actor.physicsImpostor.getObjectCenter().y, z: actor.physicsImpostor.getObjectCenter().z})/terrasize)*terrasize > terrasize*6){ var ttobs = scene.getMeshesByTags(tt.id+'_mesh'); ttobs.filter(function(e){ var eid = e.id; if(eid.indexOf(ttid) > -1){e.dispose();} }); if(ttobs.length <= 0){tt.dispose();} eid=ttobs=ttid=null; } } tt=ttid=null; } At this point I have discovered for sure it isn't my problem however and it appears to be functioning just fine. But basically what is going on there is it is checking distance from camera to the terrain tile, if it falls outside the max distance it removes all items associated with the tile then it removes the tile. Then I leave all variables used as null for GC. I am still trying to hunt down my draw call / memory leak, so frustrating.. I thought .dispose completely removes the object but it doesn't, I think it leaves the rest to GC, I can simply add tt=null for that, which I do already, so no issue there.
  7. It seems I was wrong in my understanding of the dispose function, it doesn't remove the object it's self only it's data from the scene, the object is still there, I can not find a way to remove the object, I set it to null for garbage collection but I am still having the draw calls going up so must be something else, back to debugging my code.. fun times.. Does BJS have a method for completely destroying an object by chance? Thanks!
  8. This seems to no longer work in 2.5 release, I was having an issue with to many draw calls and tracked it to the call I had to remove meshes no longer working, works fine in 2.5 beta though, so weird.
  9. Any updates on this, I been waiting as it seems to be far better than cannon in efficiency and I looking at the demo's looks great! Noticed the domain http://www.energy-js.com is no more x.x
  10. Here is source code of what I am doing.. //Setup TriPlanarMaterial for terrain trimat = new BABYLON.TriPlanarMaterial("trimat", scene); trimat.diffuseTextureX = new BABYLON.Texture("img/rock.png", scene); trimat.diffuseTextureY = new BABYLON.Texture("img/grass.png", scene); trimat.diffuseTextureZ = new BABYLON.Texture("img/floor.png", scene); trimat.normalTextureX = new BABYLON.Texture("img/rockn.png", scene); trimat.normalTextureY = new BABYLON.Texture("img/grassn.png", scene); trimat.normalTextureZ = new BABYLON.Texture("img/rockn.png", scene); trimat.specularPower = 64; trimat.tileSize = 2; // Add Tile var addtile = function(tileZ,tileX,fog){ if(!fog){var sd=32;} else {var sd = 2;} var mesh2 = BABYLON.Mesh.CreateGround(tileZ+'z'+tileX+'x', terrasize, terrasize, sd, scene); mesh2.material = trimat; //Set default level var ind = mesh2.getIndices(); var posi = mesh2.getVerticesData(BABYLON.VertexBuffer.PositionKind); for(var i=0; i < ind.length; i++){ var ind0 = ind[i*3]; var ind1 = ind[i*3+1]; var ind2 = ind[i*3+2]; posi[ind0*3+1]=posi[ind1*3+1]=posi[ind2*3+1]=dheight; } mesh2.setVerticesData(BABYLON.VertexBuffer.PositionKind, posi); mesh2.position = new BABYLON.Vector3(tileX,0,tileZ); if(wireframemode && !fog){mesh2.material.wireframe = true;} if(!fog){ mesh2.id = mesh2.name = tileZ+'z'+tileX+'x'; //ID based off of coordinates BABYLON.Tags.AddTagsTo(mesh2, "terra"); mesh2.setPhysicsState(BABYLON.PhysicsEngine.HeightmapImpostor, { mass: 0, friction: 1000 }); if(tshadows){terrain_sg.getShadowMap().renderList.push(mesh2);} loadtile(mesh2.id); } mesh2.receiveShadows = true; mesh2.isBlocker = true; mesh2.renderingGroupId=2; }
  11. This issue persists in Babylon v2.5 When setting receiveShadows to true I get all the errors above, if I set to false I do not. Also, when receiveShadows is set to false on my terrain tiles tri-planar material looks like this for some reason.. Keep in mind each tile is using the same material and same exact setup in general, it either has 0 height or what ever the vertices are set to is the only difference between tiles. Notice how many of the tiles are black, these are all negative X and Z coordinates, that is the only thing the black ones have in common, so it seems tri-planar mapping doesn't apply to any mesh that has a negative position.. What's going on here? LOL I would love to use tri-planar mapping as it would solve UV stretching but it simply doesn't work yet, unless I'm doing something wrong.. I see no restrictions or anything I should be doing different in documentation over the regular material.
  12. Also I noticed that the tutorial page doesn't have a link or explanation that one has to include anything, so people may assume it's built into Babylon, I knew otherwise and went to the GitHub to find it. So a little blurb at the top of this page http://doc.babylonjs.com/extensions/Tri_Planar_Mapping pointing to the place to get it would be helpful. Cheers!
  13. OK This is the one I find and am using already: https://github.com/BabylonJS/Babylon.js/blob/master/materialsLibrary/dist/babylon.triPlanarMaterial.min.js I assume this is latest?