Jump to content

Search the Community

Showing results for tags 'vscale'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. Hi All I am experimenting with textures and am having issues with tiling. I have created several complex (well not that compex) shapes that I am wanting to apply a tiled texture to. However, when I apply the texture it appears warped (i.e. stretched) which makes it appear really bad. What I want is for the texture to be applied/tiled using a predefined aspect ratio therefore ensuring the rendered textures appears clear and crisp. NOTE: I am aware of the uScale and vScale properties for a material - I can successfully experiment and configure their values to get the desired effect. However, this requires lots of tweaking (experimentation) and the result is not perfect, furthermore this is not going to work for me because the shapes in my scene will be added at runtime (hence I need an algorithm to set the uScale and vScale values). Here is a code snipplet I have created that illustrates the problem: http://www.babylonjs-playground.com/#RF9W9#398 If you uncomment lines 102 and 103 the rendition looks good - but I need to calculate these field values at runtime. If anyone can help with this issue I would appreciate it. Thanks Rolento
  2. Hi there I've spent a few hours trying to look into changing the uScale and vScale of the texture on an object-by-object and I'm totally stuck. To give you a simplified example of what I'm trying to do: Let's say I have lots of planes that are supposed to represent tiled walls. The planes are all different sizes and shapes, e.g. one might be 1×1, another 1×2, another 4×3, ... and so on. The same tiles are used on all of the walls, and I'd like to use the same repeating texture. The texture needs to have the same relative size everywhere it is used; e.g. it would look weird if the tiles on a 1×2 wall had the same height but were twice as wide as the tiles on a 1×2 wall. This means that I will need to use a different uScale and vScale on each plane. However I have the problem that the uScale and vScale are set on the texture, not the planes they are applied to - changing the scale for one changes the scale for all. After a few hours of Googling, as far as I can tell, if I want to achieve the effect I am going for I have three options, none of them very good: Build all of the bigger walls out of 1×1 walls. Create a different material and a different texture for each combination of uScale and vScale that I need in the scene. Write my own custom shader material that has the options to set uScale and vScale independently for each object. (1) and (2) are doable but I'd worry they're inefficient. (3) would be efficient but I'm struggling to make my own shader material that has all of the features of Babylon's default shader material, and work out how to pass custom variables to it. Googling has uncovered various forum posts and tutorials that cover some of the steps needed to do this, but I can't find all of the documentation I need for the whole process. After being stuck for a few hours I thought I really ought to ask here to see if anyone knows something obvious I'm missing! Thanks for your help!
×
×
  • Create New...