## scaling of textures

Member
Posts: 321
Joined: 2004.10
Post: #1
I want to represent two objects in my application. One needs to be
38 feet and the other 809 feet. The 38 feet texture is 512x512 whereas
the 809 feet is a 1024x1024. I'm using a game scale of 12 pixels / foot.

809 * 12 = 9,715 pixels; 38 * 12 = 456 pixels

809/38 ~ 21 (feet)

9,715/456 ~ 21 (pixels)

I've got a function which calculates the following scale multipliers

1024 * 9.4875 = 9,715 pixels

512 x * .890625 = 456

However, when I use 9.4875 and .890625 scaling, and display the textures,
the smaller texture is too big relative to the bigger one: by a factor of 2.

Right now, I just use the magic number 2, but I feel like I'm not really
getting to the root of the issue. And I want to start using textures of
256 and 128.

Is the problem resulting because I'm starting out with different sized
textures? Maybe need a texture bias or something?
Moderator
Posts: 365
Joined: 2002.04
Post: #2
WhatMeWorry Wrote:Is the problem resulting because I'm starting out with different sized textures?
Yes, that's why it's different.

That magic number 2 is simply the ratio between the texture size you're using and your 'base' texture size: 1024 / 512 == 2. You could substitute any other number for the 512 to calculate an appropriate ratio for a given object.

Neil Carter
Nether - Mac games and comic art