Jump to content

Search the Community

Showing results for tags 'uv'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 21 results

  1. Hello everybody, At first,many thanks for all BJS devs and team behind this great framework! Q: How can be "irregular" ribbon textured,that texture is not stretched? (per example- simple leaf shape made of Quadratic bezier curves;texture is squashed on its tips..) Tried to find answer on my own; but had no luck till now, it could be cause of me and my capabilities; so,if one exist please do redirect me and I do apologize for asking it again.. Thanks in advance!
  2. Hi, have question regarding 3d max export. I created rectangle plane in 3d max. Than tried to add custom shader material to it, and realised that uv.y is out of [0-1] range. void main(void) { if(vUV.y > 0.5) { gl_FragColor = vec4( 1.0, 1.0, 0.0, 1.0); } else { gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0); } } After checking exported babylon file saw that uv.x is from 0-1 but uv.y 1-2 [0,1,1,1,1,2,1,2,0,2,0,1] Some scaling could be applied? Is that desired behaviour ? Thanks.
  3. Hi, I'm new to BabylonJS and 3D. I created a scene in Blender with a character. It has a single material, UV Map and texture. It works fine in BabylonJS but when I replace the texture with new BABYLON.Texture or new BABYLON.DynamicTexture (in my case), the new texture does not take into account the UV Map. I think I forgot something, but I don't know where to watch. (Sorry for my English ^^')
  4. Hello, When I view a model exported from Blender with textures applied I have darkening to the UV seams / borders when you view closer to a tangent. Example is here: https://imgur.com/a/SLgda My textures are power of 2 (1024 x 2048 px). Does anyone have suggestions how to avoid this? The problem disappears when I remove the .ambientTexture (AO / lightmap). Thank you.
  5. hello everybody i have two textures for a mesh that import form 3dsmax, one texture is for uv0 ,the other is for uv1 how to use 2nd uv channel in babylonjs ? thanks very much (sorry for my English)
  6. Are there any examples of how to apply a texture to an individual vertex as is described in this tutorial: http://babylonjsguide.github.io/advanced/Facets
  7. I want to draw a texture on the line that user draws on the screen. Like a mouse trail, so I follow this tutorial. . The only thing that doesn't answer me is sending the custom uv to the shaders. I vaguely remember that in C++, I can create struct or something and the shader will know how to handle it. It seems that is not the case here. I can't even figure out how does "index" property in vertex shader gets there. Even so, I can't use the "index" approach as the line won't be full rectangle as in the example. Right now, I copied & pasted the entire lines2d classes and try to customiz
  8. Hi, I am not able to get the normals on an extruded surface right. In this playground http://www.babylonjs-playground.com/#53YWDR try clicking on the extruded shape. The normals on the cap are right. But the normals on the side faces are irregular. Also the reflection of light on the surface is a bit weird. Probably wrong uv. Any ideas on how to fix this? I want to have the normals and the light reflection behave like it would do on a regular cube created with Mesh.CreateBox Thanks
  9. Hello guys, I was wondering if there is a way to keep using a mesh's UV map after changing it's material. My game currently uses a cell shader, so I have been giving meshes ShaderMaterials and then calling ShaderMaterial.setTexture() to give it the same texture as before. This successfully applies the cell shader and texture, but the UV map is lost in the process so the texture no longer lines up. I've looked through the mesh, material, submaterials, and texture's attributes and all i can find are u/v offset, scale, and Ang (which are 0, 1, 0 respectively), but in the .babylon f
  10. Hello, I have noticed that there is a problem with UV mapping, if I use a dynamicTexture on my mesh, imported from .babylon file. I am sure that my mesh has proper UV mapping, I have checked it by using standard texture. If I use normal texture on this mesh, everything is ok. If I use dynamic texture on BABYLON.Mesh, everything is ok. If I use dynamic texture on my mesh, I have seen something like that: I can't find an example on the playground with a mesh with proper UV mapping, so I have chosen the skull Playground: http://www.babylonjs-playground.com/#1NQC5D#3
  11. Hello! I am trying to apply a texture to my simple character. The character is made up of multiple boxes, so I am using a Solid Particle System. Until there all is good but when I try to apply my texture with UV mapping, each face of the box seem to have its own orientation. I couldn't find a way to rotate the face, so I researched on how to rotate the UV mapping but I could only rotate it by 180 degrees (by switching the values of x,y,z,w). Here is the playground: http://www.babylonjs-playground.com/#1ALQPZ#20 Any help? I would like to avoid using multimaterials and submes
  12. I'm using fabric.js to create a dynamic texture over a mesh. It works well except when the dynamic texture is moved through a UV seam. Does anyone know how I can get this working over a seam? Here's the playground http://www.babylonjs-playground.com/#9U086#118 If you drag the "webGL" text or rectangle around the cylinder you'll see it break when it hits the seam. I've attached a photo to demonstrate
  13. Try to generate a custom mesh with material. this is what I did so far ~ http://www.babylonjs-playground.com/#1WGFZV#2 Appreciate if anyone could answer or correct my issue 1. How to create a double sided face ? tried backFaceCulling but don't seem to work. 2. I would like the triangle to display custom uv position, a image explain what I am trying to accomplish. I search on the forum and found out a similar problem here , but still uncertain the correct way to do it. thanks for the help ~ update : I think I posted this on the wrong se
  14. Hi people, I just added a new optional parameter, called invertUV (boolean, default false) to every ribbon based shapes : ribbon, tube, lathe, standard and custom extrusion. var rib = BABYLON.MeshBuilder.CreateRibbon("r", {pathArray: paths, invertUV: true}, scene); This swaps the U and V coordinates at geometry construction time. What is this for ? Imagine you've got two different meshes, say, a tube and a sphere and they share, for performance reasons, the same material/texture. You notice then that the texture is applied on to the tube the wrong way (horizontally, for i
  15. Hi guys! Recently I converted my .png textures to .dds using nvcompress and dxt1 as compression (don't need the alpha). For some reason the textures came out flipped on the horizontal axis. Setting the texture uAng property to PI fixes the issue, but I'm wondering where did I go wrong...? Cheers
  16. I'm trying out the .OBJ loader and comparing it with the standard .babylon loader. I noticed that the .OBJ will show the UV seams. Does anyone know how to prevent this happening? I also get a bunch of console errors with .OBJ: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. Unable to compile effect with current defines. Trying next fallback. Vertex shader:default Fragment shader:default This is the .babylon loader (no seams) http://www.punkoffice.co
  17. Hi Everyone, I'm looking into this mesh = BABYLON.MeshBuilder.CreatePlane("mesh", { width: 10, height: 10, sideOrientation: BABYLON.Mesh.DOUBLESIDE }, scene); mesh.material = new BABYLON.StandardMaterial(null, scene); texture = new BABYLON.DynamicTexture("texture", { width: 10, height: 10 }, scene, false, BABYLON.Texture.NEAREST_SAMPLINGMODE); mesh.material.diffuseTexture = texture; context = texture.getContext(); context.fillStyle = '#F00'; context.fillRect(0, 0, 100, 100); context.fillStyle = '#00F'; context.fillRect(0, 0, 15, 5); texture.update(); // Trying to fix it
  18. I am trying to make a prism generator using BABYLON.CreatePolyhedron. Everything seemed ok until I applied a texture to it. http://www.babylonjs-playground.com/#AVCC8#6 Babylon is splitting the mesh into triangles like you would expect, but then it is failing to map the new UV points in a sane way. I was able to manually set the new UV values to make it work, and can just automate the process, but It is a bit of a hack. Is there an easier fix to this? Thanks in advance for any help
  19. Hello! I'm having trouble figuring out the how to map specific parts of a larger image to specific polygons forming a complex shape created by through the PolygonMeshBuilder. After hours of researching the problem and finding only similar answers that either don't, or I can't figure out how to, apply to my specific situation, I'm turning to asking directly for help. I was given code that generates a map of the US, where each state is a separate object generated from an XML file using the PolygonMeshBuilder class. The assignment is to take a provided image displaying a map of the entire US,
  20. Hello to all.I created an object in Blender and I applied the texture using UV coordinates. This is the result of the render in Blender: http://postimg.org/image/5tbxbzk1l/ Unfortunately, when I go to upload the files in the sandbox of Babylonjs this is the output: http://postimg.org/image/4gu8a3mm1/ This is the log export file .babylon in Blender: http://postimg.org/image/d8194d5x5/ Can someone please help me? Where am I wrong? Can you give me some suggestions. Files that I put in the sandbox are these: - casa_geografia.babylon - casa_geografia.log - layout_diffuse_texture.png I atta
  21. Hi, I'm somewhat confused about how the UV coordinates are allocated for sprites - my understanding is they should be ranging from 0.0 to 1.0 in both x and y directions. However, with the code below: this.wavetest = this.game.add.sprite(this.game.width * 0.5,this.game.height * 0.5,'wave_test'); var fragmentSrc = [ "precision mediump float;", "uniform sampler2D uSampler;", "varying vec2 vTextureCoord;", "void main(void) {", "vec4 texColor = texture2D(uSampler, vTextureCoord);", "if(vTextureCoord.x < 0.1){", "texColor = vec4(1.0, 0.0,
  • Create New...