PDA

View Full Version : Texture scaling puzzles me


i_wear_pants
06-07-2007, 03:27 PM
Why did they make the default texture scale 0.25 in Source? If you want to reduce it by 50%, it's rounded into 0.13, which is not exactly half of 0.25. The default texture scale used to be 1.00, which meant that you could reduce your texture precisely by 50% (0.50) or 25% (0.25).

I can't figure out any good reason for this change, since it only causes problems and restricts your texturing options. Does anyone know why they did it?

Angry Beaver
06-07-2007, 03:42 PM
1 unit = 1 pixel on the surface

scaling down to 0.25 allows grater resolution of textures without having to increase the size of the world. If they increased the size of the world they'd have ot deal wiht biggere numbers defining spaces and objects, if that happened the game would probably slow down as large number math is slower.

(i'm speaking form a coding side adding 1+1 to 10+10 is no different but when you start going bigger than an ints defualt is what I'm saying)

zyklus
06-07-2007, 05:36 PM
Tools->Options... : "Default texture scale"

:)

i_wear_pants
06-07-2007, 06:09 PM
1 unit = 1 pixel on the surface

scaling down to 0.25 allows grater resolution of textures without having to increase the size of the world. If they increased the size of the world they'd have ot deal wiht biggere numbers defining spaces and objects, if that happened the game would probably slow down as large number math is slower.

(i'm speaking form a coding side adding 1+1 to 10+10 is no different but when you start going bigger than an ints defualt is what I'm saying)
0.25 is just a number, nothing more. With 1.00 you could precisely downscale textures, which is impossible with 0.25.

Tools->Options... : "Default texture scale"

:)
Doesn't help. If I'm working with a 256x256 wall and want to scale my 512x512 texture into 128x128 (the texture repeats four times), I have to set the texture scale on the brush to 0.25, regardless of what default scale I set in the options. But if I want to make the texture 64x64 (repeats eight times), I can't do it, because I have to scale it by 0.13.

The only way to get around this is to make everything bigger, and that kind of defeats the purpose of what Angry Beaver just talked about.

haymaker
06-07-2007, 08:43 PM
Ive been fooling around with this myself. the best way is to adjust your 256 wall to fit the .13 multiple if you're fussy about margins etc.

i_wear_pants
06-07-2007, 09:27 PM
Well sure, you can do that, but it makes your brushwork more messy and causes all sorts of problems, unless it's just some small object or structure you're texturing, and not an entire building.

If there really isn't any good reason for this "feature," Valve should fix it ASAP.

Angry Beaver
06-07-2007, 11:23 PM
if valve resized the texures for you so that 0.25 right now was equivelant to a 0.25 then the entire game would run slower as there would be an extra multiplication that took place for every single last texture.

The game will accept a scalling of 0.125 and even scale it properly, you just wont be able to use the up and down arrows within hammer. Type it in manually.

i_wear_pants
06-08-2007, 01:08 AM
if valve resized the texures for you so that 0.25 right now was equivelant to a 0.25 then the entire game would run slower as there would be an extra multiplication that took place for every single last texture.
No, I'm not talking about texture resizing. I'm talking about setting the default texture scale to 1.00 so that it's equivalent to what 0.25 is now. Nothing would change, but it would allow you to accurately scale textures.

The game will accept a scalling of 0.125 and even scale it properly, you just wont be able to use the up and down arrows within hammer. Type it in manually.
Huh, it does work. I thought it didn't because it always rounds up the value.

It's still a bad idea, though. 1.00 would be more logical and wouldn't lead to confusion like this. There's really no reason to use 0.25.

Bluestrike
06-08-2007, 09:29 AM
on scale 1, 1 units = 1 pixel, To crack up the texture detail in the world, the 0.25 is used to 128 units = 512 pixels.

As a developer that works fine, instead of scaling a texture in half in hammer (0.125) they can just create a adjusted texture thats scaled in a program like photoshop.

But as support for the community it would have been nice to have more decimals so 0.125 would be possible.
In some cases using 'fit' option in the texture tool you can get better results, as it seeems to have no problem and can scale anything to a perfect fit.

i_wear_pants
06-08-2007, 09:44 PM
But why go with more decimals when 1.00 works perfectly, and always has?

Angry Beaver
06-08-2007, 10:56 PM
deep inside the engine with the way things are drawn 1 pixel will cover 1 units worth of space.

Now to make the texture show details while keeping everything a nice small managable size but big enough for precision your going toscale your textures by 0.25

-if you let the texture's scale remap the texture only 1 thing happens
-if you make 4 pixels cover 1 unit your going to have to adjust any texture scales by 0.25, so its remaped by 0.25 x scale. Thats the same remapping but the ammount to remap by has to be recalculated.

the extra math is going to slow things down.

i_wear_pants
06-08-2007, 11:05 PM
What extra math? It's just a number. It can be anything. If it's 1.00, setting it to 0.50 just makes the texture 50% smaller. Nothing changes. The texture can retain it's 25% size even if the value of the default texture scale is 1.00. It's a number.

Shiny
06-09-2007, 12:31 AM
I see what you are saying. The number is relative. I'm not sure why they chose 0.25 instead.

Maybe so the numbers directly related to the ones in-game. It was probably just easier for them to think about rather than having to think back and forth between values.

Angry Beaver
06-09-2007, 10:19 PM
What extra math? It's just a number. It can be anything. If it's 1.00, setting it to 0.50 just makes the texture 50% smaller. Nothing changes. The texture can retain it's 25% size even if the value of the default texture scale is 1.00. It's a number.

Its not just a number its a representation of the size of the texture in world space. The 3D engine has 1 pixel on a texture representing 1 unit in worldspace, so unless they plan on rebuilding the entire bloody engine a scale of 1.00 indicates 1 pixel.

i_wear_pants
06-10-2007, 09:34 AM
Why is this so difficult to grasp? The number can be anything, it's completely relative. The value can be 1.00 and the texture can still be 25% in size.

lodle
06-10-2007, 08:48 PM
You know you could just type .125 into the box. Works for me.

Angry Beaver
06-10-2007, 11:38 PM
its not completley relative, trust a guy who has two years worth of computer engineering technology under his belt and built a tank game from scracth using direct x

i_wear_pants
06-11-2007, 12:38 AM
Then you're going to have to explain how it's not relative.

If 1.00 = 25% texture size, then 1.75 = 100% texture size. If 0.25 = 25 % texture size, then 1.00 = 100% texture size. Simple.

lodle
06-11-2007, 01:00 AM
^^ that makes no sense.

if 1.00 = 25% then 4 times that would be 100% (i.e. 4 not 1.75)
It is really not that hard to under stand. You dont have to make textures in 1:4 ratio. Make them into 1:8 then use .25 as scaling.

Angry Beaver
06-11-2007, 01:03 AM
yes congratulations thats math. but were talking about the sizing and orientation of textures in a 3D world. There is a DEFAULT relationship between the size of 1 unit in the world and how much area 1 regular pixel will cover. That will always be that way. You can feed a value in that resizes that relationship and thats your textures scale.

Now using the scale from hammer
1.00 fed into the built in relationship gives 1 pixel covers 1 square unit
0.25 fed into the built in relationship gives 16 pixels covers 1 square unit

Now inside of Hammer if you want the scale of 1.00 to make 16 pixels cover 1 square unit your going to have to divide it by 4.
So now using the change
1.00 /4 -> 0.25 fed into the built in relationship gives 16 pixels covers 1 square unit
4.00 /4 -> 1.00 fed into the built in relationship gives 1 pixel covers 1 square unit

The second batch where you rescale your 1.00 into 0.25 has the extra calculation that may slow things down. The built in relationship is something you can't change without redesiging the entire engine which valve isn't going to do especially as source is a hyper adavanced version of goldsource, it wasn't built from scratch. That built in relationship and the need for speed are the reasons texture scalings the way they are.

If your still not getting it give me several grand and 2 years worth of your time to run you through the same education I went through.

i_wear_pants
06-11-2007, 02:38 AM
I give up. Obviously this is too difficult for some people to grasp.

Angry Beaver
06-11-2007, 01:09 PM
I give up. Obviously this is too difficult for some people to grasp.

thats my line

blacksmith123
06-11-2007, 01:41 PM
Pants, I understand what you're getting at, and it puzzles me as well, but can't you just use the "fit" function on a 64x64 face then resize the brush to your wall or whatever?

Shiny
06-12-2007, 01:55 AM
Hehe, this is getting interesting.

Angry Beaver, I understand what you are saying. But I think what i_wear_pants is saying is that they could have configured Hammer so we could type in 1.00 and still have it calculate that as 0.25 in relationship to the game.

i_wear_pants
06-12-2007, 03:16 AM
Pants, I understand what you're getting at, and it puzzles me as well, but can't you just use the "fit" function on a 64x64 face then resize the brush to your wall or whatever?
That's already been covered. I was just arguing why the default texture scale is completely relative.

In any case Valve should have come up with a more intuitive and readily obvious way of reducing 0.25 by 50%.