• Content Count

  • Joined

  • Last visited

  1. It could be that your textures are being smoothed before they are used as the height map. Try some code similar to the following... var convertToFlat = function () { for (var index = 0; index < scene.textures.length; index++) { scene.textures[index].updateSamplingMode(BABYLON.Texture.NEAREST_LINEAR); } } scene.executeWhenReady(function() { convertToFlat(); }); return scene; I had an issue with textures being smoothed and solved it this way. See lines 21-31 on
  2. TheSkrapper

    Textures for Terrain painting in Unity

    Try removing that seventh texture in case it is causing issues. See if the others render.
  3. I've stripped things down. Now you can only see the intersection problem which is now very minor. I think it is now just an issue where different texture pixels are occupying the same point and its a render ordering problem. I'm not sure if there is a fix.
  4. I do believe the issue may have to do with the following code that I got from another issue/post that I can't find it now: var convertToFlat = function () { for (var index = 0; index < scene.textures.length; index++) { scene.textures[index].updateSamplingMode(BABYLON.Texture.NEAREST_SAMPLINGMODE); } } scene.executeWhenReady(function() { convertToFlat(); }); I used that code because my textures were being ??smoothed?? and not looking square but when that code is removed the alpha glitches seem to go away or at least minimize. Although, my textures get messed up again and are not square. It also produces a similar boxed built look but that has to do with the smoothing I think. So updating the sampling mode seems to mess with the alpha? Using BABYLON.Texture.NEAREST_LINEAR seems to clean it up the most but there are still issues. Does that point to anything? I'll try to get an example with less planes.
  5. I recreated the textures first filling the canvas with an actual full alpha rect before drawing on my other rects. I also minimized my textures down to the 8 unique ones. There still seems to be the problem but it might not be as bad???? I can't tell. . It's also published with github pages and has the same problem which rules out any possible playground issues.
  6. Possibly, but I wouldn't know why. The textures are created by starting with an empty 2D canvas and only drawing rects where I need texture. Maybe I need to actually fill the empty spaces with an actual alpa rect. I will give that a shot. Thanks for the idea.
  7. Thanks for the reply Jerome. I definitely have too many materials because they were auto generated with an x,y,z loop. Most of them repeat but I ran into this rendering issue first and haven't taken the time to optimize them. I will work on removing the repeated materials and it will probably drop to 10 or so. Then I will map each layer to the correct material. That was just the first basic programatic implementation for proof of concept. Thank you for the particle idea. I will look into that when I optimize my materials. It almost sounds like dealing with sprites.
  8. Thanks for the reply Deltakosh, The planes are spaced from each other to simulate the edges of the boxes. They only overlap/intersect perpendicularly. Looking through the center is looking through 81*3 alpha textures which I think may be related to the problem. I'm playing around with the material alpha types and rendering order options but it is all so new to me. It really would be cool to solve the issue though. As far as float issues, I've tried to design it so that each plane is on a whole number.
  9. Hello, (working better in Chrome than Safari) <edit> I have changed the background to white and it seems that the issue is not just the seems but that the transparent portions seem to show when viewed on edge.</edit> I'm new to BabylonJS and have been working on different implementations of the Menger Sponge fractal to learn the framework. I'm on my third implementation now which allows me to quickly generate an L4 Menger sponge using only 984 vertices!!!! I accomplish this by using 81 planes in each dimension that have different parts of the Sierpinski carpet as materials. I'm having issues with artifacts/seams where perpendicular planes are intersecting and I'm not sure where to go with it. (artifact may be the wrong term) I've Googled but may not be using the best search terms. I've tried re-creating my textures in case the images were off by a few pixels but that doesn't seem to be the problem. Moving the camera show the artifacts/seams blinking in and out, specifically around the hollow center. It makes it look like it is assembled with small blocks but it isn't. That is where the planes intersect. At certain angles with certain lighting they seem to disappear which leads me to believe they are artifact related and not due to the texture images. My goal is to make this into a single multi-material object that I can instance to get really intricate sponges utilizing very little resources. Thanks for your time and any ideas/advice. -mc
  10. TheSkrapper

    Resetting base scale

    I was able to scale a larger merged object down 1/3 and then set that as its base 1x scale by using the following code.. let mergedBoxes = BABYLON.Mesh.MergeMeshes([xbox, ybox, zbox], false, true); var matrix = BABYLON.Matrix.Scaling(1/3, 1/3, 1/3); mergedBoxes.bakeTransformIntoVertices(matrix);
  11. TheSkrapper

    Resetting base scale

    Thanks for replying Deltakosh, It looks like that link may be what I am looking for but just to clarify my understanding of scale with merging and burning... I'm working on an implementation of a Menger Sponge. If I build a 3x3x3 cube with 27 cubes of scale 1 and merge them then I get a new mesh that at scale 1 is 3x3x3 units large. I then want to scale it down 1/3 to take up a 1x1x1 unit space. Then I want to change its ?'identity'? so that when I clone it and set it's scale to 1 it takes up 1x1x1 instead of 3x3x3. So I will scale the new merged shape down 1/3 and then bake it with the new vertices so that will then be their locations at scale 1 when I clone it. Am I understanding things correctly? Sorry for my noobness.
  12. TheSkrapper

    Resetting base scale

    Hello, I'm new to BabylonJS. Is it possible to scale an object down but then have it think that its new scale is now 1? I am building an object out of unit cubes (scale 1 base cubes). I then merge the objects into a new mesh. Then I want to scale it down to be a new unit sized cube with scale 1. I will be using this in a recursive fractal routine that resizes the base cube but it expects it to be scale 1. I hope that makes sense. I've tried googling but perhaps I don't know the proper terminology. Thanks for any feedback. Skrapper