Jump to content

BABYLON.Texture coverage uScale,vScale


PavolHejný
 Share

Recommended Posts

Hi,
I have some questions about BABYLON.Texture.

I have a bricks texture, a big house and a small chimney. I want one brick to be the same size on a house and on a chimney.
I can set size of the texture by uScale,vScale, but I would not like to create a special texture for every mesh as I suppose it would be very inefficient.

Can a Babylon texture cover the area by size instead of percentage?

http://www.babylonjs-playground.com/#2TJ5MI


Best comparsion of my problem is comparing with css background-size:

CSS background-size: 100% 100%; is like uScale=1 and vScale=1 in Babylon.
Is there anything like background-size:100px 100px; in Babylon?

Thanks a lot for your advice.


Screenshot from 2017-10-24 16-18-24.png

Link to comment
Share on other sites

Hello!

If you want to set different uScale per face then you should not use the texture uScale/vScale as it will be shared by all meshes.

Instead, you can define the UVs of your meshes to accommodate your needs

I think this doc could help you: http://doc.babylonjs.com/tutorials/createbox_per_face_textures_and_colors

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...