yLacaute Posted March 15, 2018 Author Share Posted March 15, 2018 I am stuck. And mad. I don't mange to apply textures on loaded mesh (@Pryme8 I understand nothing to your PG which is too complicated for me to just set a f*#!#g texture, please note I am beginner) I tried to apply 2 repeated textures on Blender : it works "inside blender" but when I export : i lose the repeat option The video shared above show "a way of doing" by adapting textures to a shape : you build one image with all inside. I understand this can be useful for a complete object (a character for example) but I would like the opposite : I have a plane (with 2 faces) and each face should be attached to a texture (with offset and repeat option). As I already have a lot of textures, I want to exploit them and NOT create a new image containing existing texture. If many objects share the same texture, I load it many times, that has no sense for me. A solution could be to put ALL textures in a single image, but same, that is a crazy solution, the single image will become unusable (the hell to edit it). Currently, I fail on the simplest possible export : Blender > new plane Blender > add material > add texture from image > repeat x = 2 Blender rendering : it works Export Babylon > load > I see my texture, but without repeat option I can't find any good tutorial for basic things... please help My objectif is still the same as the first comment here : get a plane with 2 faces with 2 different textures applied (but now textures are directly applied in Blender instead of in babylonjs) Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 15, 2018 Share Posted March 15, 2018 then make two planes... http://www.babylonjs-playground.com/#MLA3FJ Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2018 Share Posted March 15, 2018 So perhaps let's try to go back to the initial goal. You want to edit a mesh to apply two textures. based on faces right? So you need to first build a multimaterial made of 2 materials (one per face) and then create subMeshes (like in the doc I sent you) to split your mesh per face: https://www.babylonjs-playground.com/#4ZTUVS Quote Link to comment Share on other sites More sharing options...
yLacaute Posted March 15, 2018 Author Share Posted March 15, 2018 @Pryme8 I am using physicImpostors so I try to limit the number of mesh for performance, that's why I did not 2 planes I just succeed to import a plane from Blender, with 2 textures on it with repeat option. But there is something strange : the rendering in Blender is not the same than in BabylonJS. I played with the size property to repeat the textures (as explained here http://doc.babylonjs.com/resources/blender#textures) but the result is that the exported file is not exactly the same as the rendered view in Blender. See attached images. @Deltakosh You applied materials on a mesh created with Babylon, and all problems are coming when you applied materials from an imported mesh : you can't do the same as in your PG from what I have understood. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2018 Share Posted March 15, 2018 This is the point here: why is it not working on a mesh imported from blender? does it have more faces? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 15, 2018 Share Posted March 15, 2018 12 minutes ago, yLacaute said: @Pryme8 I am using physicImpostors so I try to limit the number of mesh for performance, that's why I did not 2 planes I just succeed to import a plane from Blender, with 2 textures on it with repeat option. But there is something strange : the rendering in Blender is not the same than in BabylonJS. I played with the size property to repeat the textures (as explained here http://doc.babylonjs.com/resources/blender#textures) but the result is that the exported file is not exactly the same as the rendered view in Blender. See attached images. @Deltakosh You applied materials on a mesh created with Babylon, and all problems are coming when you applied materials from an imported mesh : you can't do the same as in your PG from what I have understood. try mesh.material.diffuseTexture.uOffset = 0.5; Looks like the offsets are different for some reason. Quote Link to comment Share on other sites More sharing options...
yLacaute Posted March 15, 2018 Author Share Posted March 15, 2018 18 minutes ago, Deltakosh said: This is the point here: why is it not working on a mesh imported from blender? does it have more faces? That is exactly why I opened this topic : why ? Here is the PG : https://www.babylonjs-playground.com/#JQDPT6#6 You can see it is easy to put a texture on a Babylon box, not in an imported plane from Blender. Keep in mind I am still speaking with a newbie langage, when i speak about "face" I speak about "face I I can select in blender" not "triangle" (So in the PG above, the plane is composed with 2 rectangular faces, but more triangles) Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2018 Share Posted March 15, 2018 So your wall object does not have uvs so you need to generate one set per vertex so 36 values (I saw that you tried to generate one per index but it is one per vertex) Quote Link to comment Share on other sites More sharing options...
yLacaute Posted March 15, 2018 Author Share Posted March 15, 2018 I tried many many things lol Please give it a try : whatever the length of the uv it changes nothing. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2018 Share Posted March 15, 2018 works for me when using the right size: https://www.babylonjs-playground.com/#JQDPT6#7 Quote Link to comment Share on other sites More sharing options...
yLacaute Posted March 15, 2018 Author Share Posted March 15, 2018 What the... Great !! I must admit I used random 0 or 1 just to try with a length of 36... Have to undertand now and find the good values, I will update the PG with the final result, with exactly what I wanted Thank you !! Quote Link to comment Share on other sites More sharing options...
yLacaute Posted March 15, 2018 Author Share Posted March 15, 2018 I give up. Working with uv coordinates manually is hell. Anyway this topic is solved. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2018 Share Posted March 15, 2018 Yeah I know. You need a visual tool for that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.