Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

prims & pixels

Cybin Monde
Resident Moderator (?)
Join date: 27 Jan 2004
Posts: 2,468
04-25-2004 17:10
does anyone know the ratio of 'meter to pixel'?

1 meter = ? pixels

thanks :D
_____________________
"We, as developers, are doing the easy part – building the scaffolding for a new world. You, as the engines of creation, must breathe life into it."
- Philip Linden

"There is no life I know to compare with pure imagination. Living there, you'll be free if you truly wish to be."
- Willy Wonka (circa 1971)

SecondSpace (http://groups.myspace.com/secondspace) : MySpace group for SLers.
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
04-25-2004 20:15
There is no such number except for maybe the ground textures. For everything else it depends on the resolution of the texture map, your viewing distance, and your screen resolution.
_____________________

My other hobby:
www.live365.com/stations/chip_midnight
Cybin Monde
Resident Moderator (?)
Join date: 27 Jan 2004
Posts: 2,468
hmm..
04-25-2004 20:28
thanks Chip, that seems to make sense.. pretty much. i'm still thinking there may be a way to match up these numbers.

as in, in concern of Photoshop, i make a 100 x 100 px texture. i upload it and apply that to a prim.. would it 'fit right' on a 1w x 1h prim? or better on a 5w x 5h prim?

you know, i should probably just try it out, heheh...

but thanks, the resolution and viewing distance are points well taken.
_____________________
"We, as developers, are doing the easy part – building the scaffolding for a new world. You, as the engines of creation, must breathe life into it."
- Philip Linden

"There is no life I know to compare with pure imagination. Living there, you'll be free if you truly wish to be."
- Willy Wonka (circa 1971)

SecondSpace (http://groups.myspace.com/secondspace) : MySpace group for SLers.
Cybin Monde
Resident Moderator (?)
Join date: 27 Jan 2004
Posts: 2,468
by the way..
04-27-2004 08:25
i tested this out yesterday, it appears that a texture that is 512 x 512 px will 'fit' a 10w x 10h prim to size.

maybe i should have posted this in the Builders forum?
_____________________
"We, as developers, are doing the easy part – building the scaffolding for a new world. You, as the engines of creation, must breathe life into it."
- Philip Linden

"There is no life I know to compare with pure imagination. Living there, you'll be free if you truly wish to be."
- Willy Wonka (circa 1971)

SecondSpace (http://groups.myspace.com/secondspace) : MySpace group for SLers.
Shadow Weaver
Ancient
Join date: 13 Jan 2003
Posts: 2,808
04-27-2004 08:31
Actually Cybin there was a discussion about this previously I cannot remember where but primarly its in sets of like 32,64,128,256,512 but most stuff is resized back down the the 512 range.

Before I was making clothing at 1024 x 1024 unfortunately when I would upload in game the resize would mess up the mask and we ended up with a lot of ghosting but thats another story entirely.

Shadow
_____________________
Everyone here is an adult. This ain't DisneyLand, and Mickey Mouse isn't going to swat you with a stick if you say "holy crapola."<Pathfinder Linden>

New Worlds new Adventures
Formerly known as Jade Wolf my business name has now changed to Dragon Shadow.

Im me in world for Locations of my apparrel

Online Authorized Trademark Licensed Apparel
http://www.cafepress.com/slvisions
OR Visit The Website @
www.slvisions.com
Corf Few
Junior Member
Join date: 2 Apr 2004
Posts: 9
05-03-2004 16:50
(bump to great info, and I needed it too, thanks!)

Set me straight if I have this wrong,

512 pixels fit a 10m prim, more or less based on the above post.

Ergo if I put a picture in a 1m prim, with a graphic that is exactly 51.2 pixels wide, it should fill the entire 1m prim without having to move it around, scale it, etc, as long as the adjustments are all at 0(zero), or 1(one) (meaning base setting for a new object).

Working on a rule that a 1x1m prim is made up of 2621.44 pixels, or 51.2(squared).

It might still need some jockeying around, but is the theory/math basically the right idea?


Corf
Cybin Monde
Resident Moderator (?)
Join date: 27 Jan 2004
Posts: 2,468
to make a long answer short..
05-03-2004 18:36
yes.


a little longer answer: i've tried it a couple times with a 10m x 10m prim, using a 512px2 texture. works out to be a 'perfect' fit. gets a little more complicated when using an Alpha texture. especially when the 'blank/invisable' section is on an edge.

so, it stands to reason that a 1m x 1m prim would require a 5.12px x 5.12px texture for a 'perfect' fit.

so, as i said, yes. :D
_____________________
"We, as developers, are doing the easy part – building the scaffolding for a new world. You, as the engines of creation, must breathe life into it."
- Philip Linden

"There is no life I know to compare with pure imagination. Living there, you'll be free if you truly wish to be."
- Willy Wonka (circa 1971)

SecondSpace (http://groups.myspace.com/secondspace) : MySpace group for SLers.
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
05-03-2004 19:03
No, Corf, that's not correct.

Any texture can fit on any prim. You can specify the number of repeats per face using the editor tools. A 512px^2 texture can tile dozens of times on any face, regardless of the dimensions of the object, just as a 64px^2 texture could. There is no correlation between texture size and prim size.

Texture mapping applies a raster or bitmap image to a vector-based object. You can zoom in towards the surface of a prim infinitely, but bitmaps' level of detail is tied to their resolution. Once you zoom in too far, you can't tell what it's supposed to be.

Prims are not made up of textures, nor are textures made up of prims. You can map any texture to any prim, regardless of either's size.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Corf Few
Junior Member
Join date: 2 Apr 2004
Posts: 9
05-04-2004 08:45
And right there, in those last two answers is what I love about Second Life, there just are no 'absolutes' :)

Thanks for the replies.

I tried it last night using 512x512 upload, where the graphic was utilizing only the area that 'should' have fit into two 1x1 prims side by side. The pixel mapping worked, more or less, but it also didn't. You are both 'absolutely' correct.

There still seemed to be some scaling required to fit square graphics into square prims, BUT the overall resolution wasn't affected as badly as some past attempts. So, long and short, it works, but it didn't come out perfect. I had to scale the data to almost .3 instead of being able to leave it at 1.


<< Cybin >>

I'm assuming that it was the way I put the graphic together in the 512x512 area, maybe I need to put it in the center, rather than offset. perhaps SL automatically centers, and when you move it around, thats when the fun starts?

<< Catherine >>

At a setting of 1 repeat, scaling it to fit 1 metre, I had assumed that the area of my graphic should have fit in the 2x1 metre cube face. But I had to scale to .3 to get it to fit. It looked great! But, I am still scratching my head about the scaling numbers I had to use.

--------------------

Think of my texture as a 10x10 grid, assuming each grid square is 51.2x51.2 pixels. I made the area with graphic in it to fit into two of those squares, on the bottom right hand corner. I uploaded, and applied it. The texture is mapped by SL to a face, with the center point of the entire texture being shown centered on the face of my 2x1metre prim. That area is, of course, blank, so I had to move it to the bottom right of the texture to show the graphic on the prim face. Utilizing vertical and horizontal offsets.

Once I got there, I soon saw that the graphic didn't fit, although it should have....so I scaled it...ending up at like .3 vertical and horizontal repeats per face. Assuming my graphic scaled during translation on upload, it should still roughly have been around 1 repeat, or not needing hardly any scaling, to fit. But it didn't.

But! Once I scaled it to fit with repeats per face, it looked better than any graphic I had applied to date using any other method.

I'm still sort of scratching my head, someone must know what the 'absolute' is, eitherwise in game items created by LL wouldn't look as good. The only difference here, there is no internet to look it up, like in first life.

</longwind off>

Again, thanks for the great replies.

Corf
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
05-04-2004 09:01
From: someone
Originally posted by Corf Few
I'm still sort of scratching my head, someone must know what the 'absolute' is, eitherwise in game items created by LL wouldn't look as good. The only difference here, there is no internet to look it up, like in first life.


There is no absolute Corf. What Cat Said is absolutely correct. That said, there is some common sense rules you can use. If you're making a texture to fit a prim face that has an aspect ratio of 2 to 1 then you should create a texture for it with the same aspect ratio (512x256, or 256x128). That will result in the minimum amount of stretching required for the texture to be scaled to the prim and result in a sharper image when applied. If the aspect ration of the texture is not the same as that of the surface it's applied to SL has to inerpolate it which will introduce artifacting, stretching, or blur. Keep your texture dimenisons in multiples of 128.
_____________________

My other hobby:
www.live365.com/stations/chip_midnight
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
05-04-2004 09:06
There are no absolutes in texture mapping. A texture is resized to fit a face 1:1 by default.

If your texture is a square 512x512 in size, and you put it onto a face that's twice as wide as it is tall, the texture will appear squashed.

To balance that, you need to play with the settings, so that vertical repeats per face is 0.5 (if you want half the texture cut off), or horizontal repeats per face is 2 (if you want the whole texture to appear twice).

If you opt for the first option, you might want to change your offset as well if you don't want it centered on the middle half of the texture (minus the top and bottom quarters).

BTW, 512x512 is a bit on the large size. 256x256 should suffice for nearly all situations.
Corf Few
Junior Member
Join date: 2 Apr 2004
Posts: 9
05-04-2004 09:21
I want to get very precise after all that air I wasted above. I like SL because because it is what you make it. But, even in a world you can do anything you want, there are 'constants'.

In any system, there must be a way to map a certain size graphic, onto a certain size object, so that the when you have object of size 'X', it will accept an 'unscaled' texture of size 'Y'.

We use 1m prims as our basis, or a multiple higher or lower, thereof (.1m .5m etc). 1m prims, are 1m prims.

At a repeats per face of 1, and a metre setting of 1, how many pixels map to a 1mx1m prim.

There has to be an absolute, otherwise nothing could be reliably put onto the face of a a building block, and have it work the same way twice.

That, I think, is the what a lot of folks want to know, without having to spend several weeks futzing with textures.

What size texture, fits a 1m or 10m prim, without changing any setting from the standard of 1. (1 repeat, no offset, 1 scaling, etc)

--

I've spent more time trying to figure out this texture system, than I have creating working scripting. Scripting is easier by far....it's more or less 'absolute'. Functions do certain things.

If someone has a system, with a working example, please share it and win worldwide acclaim! I'll erect a billboard and hand out help notes to your lot(s) on my own land, if you can explain this to anyone with a working knowledge of graphics editing software. (We are not counting those folks who have never touched paint shop, or photoshop. You give me the info, I'll make a tutorial for THEM).
Corf Few
Junior Member
Join date: 2 Apr 2004
Posts: 9
05-04-2004 09:37
Boy, in the middle of writing that last message, two more came in! Saying the same thing about absolutes.


So let me boil down what I learned.

(Yes, my profs hated me, but more people understood the topic after we were done beating on it like this)

(I'm using 512x512 just for reference, any square size graphic could be used)

If I make my graphics 512x512, and put it on a 1mx1m, it compresses down to fit into that square. We know that constant. The image should actually appear quite detailed, because compression is less 'lossy' than expansion.

If I make my graphic 512x512 but put only data in the bottom last right hand 51x51pixel square, I need to use offsets to bring it up, and over, to fit onto the 1mx1m square.

If I take my 512x512 with the data in the bottom right, I need to both offset it, and scale the area it fits in to fit into a 10mx10 square, because the graphic is more or less only in the area that roughly fits a 1mx1m square.

following everything I have read, if I take my data, position it dead center of my 512x512 graphic, filling the area side to side so that the image is actualy 512 pixels wide, and whatever height it is, as long as I use a matching ratio, the image should both look good, and fit into any area that is 1:1, 2:1, etc, depending on width:height of my original graphic.

So my 512x512 pixel texture, with data that fills the one third the height, but three thirds the width, should scale perfectly onto a 3m wide prim, 1m high. Disregarding pixel<->metres entirely.

In that case.....what resolution should I set the texture to when I make it? 72dpi....600...1600? Or does it make any difference when it is converted and uploaded in SL? I know in RL, when I want something done finer, I increase the resolution. Does it work that way here?


I am going to take all info provided, and compile it into easily understood instructions. If you can make ME understand it, Joe/Jane Q Public should have a much easier time of it. It's the least I can do for all your great replies.
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
05-04-2004 13:39
Bottomline: It's all relative. Sorry, but it is. If you have a 10m wide prim and you put a 512px wide texture on it, that texture will now be 10m wide or 51.2px/m. Whether it looks stretched or squashed largely depends on your viewing position and eyesight.

You can ignore dpi. If you increase a graphic's dpi you really only increase its dimensions, not its inherent clarity. Think only in terms of dimensions since when you upload the whole "per inch" component of dpi will be meaningless anyway.

The confusion here is that pixels are not constant. The number of pixels across a 1m cube face will be different for someone running at 800x600 and someone running at 1280x1024. You can think of graphics as having no absolute scale of their own; they gain their scale from the objects we apply them to.

Anyway, even if you had a holy grail formula where X pixels equals X meters, you should probably use a smaller graphic and accept a little image loss for the sake of everyone's bandwidth and VRAM. ;)

It might help to study the work of Magritte. Keep reminding yourself when you look at a texture in SL, "This is not a texture. This is a picture of a render of a picture of a texture."
Corf Few
Junior Member
Join date: 2 Apr 2004
Posts: 9
05-04-2004 19:44
First thing I'd like to say, Thanks!

The different viewpoints and ideas put forth help clarify immensely, and contrasting positions of thought should give anyone with an open mind a different perspective on how to learn the material presented.

You are correct, there is no absolute for the size of the graphic, beyond the fact that you are uploading a 'square'. If it wasn't a square when you started, it will be when you've got it on the server. The only caveat is that your graphic is scaled to fit into said square.


My reply was going to be huge, and I don't want to trouble you folks any more. Today I spent six hours playing with textures, cubes and graphics programs.

I will write it all up, and put it into the public domain in-game, and anywhere else anyone wants it. Hopefully my perspective as someone who's only been here a few weeks will help others avoid asking _really_ stupid questions.....

like mine :)

I have (in the past few weeks) made clothes, vehicle textures, and some really cute kittens I give to whoever wants one. All textured and designed with info gotten here. Thanks to the community.


Corf

(Views presented are mine, spelling mistakes are my cats fault)
_____________________
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

You know you're not a newb anymore, when people don't roll their eyes when you ask a question.

A 'Mentor' is someone who will never roll their eyes in the first place.

(Applies to both RL & SL)
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
05-04-2004 21:10
From: someone
Originally posted by Corf Few
In that case.....what resolution should I set the texture to when I make it? 72dpi....600...1600?


dpi is meaningless unless you're printing an image. dpi is simply an instruction to the printer about how many pixels of the image to put per square inch of paper. If you had an image with a pixel dimension of 600x600 and printed it at 100dpi the resulting print would be 6"x6" If instead you printed it at 300dpi the resulting print would be 2"x2" The pixel data in the image is fixed. The difference is in how a printer interprets it. When doing things for SL you only need to worry about pixel dimensions. The reason you should keep your image sizes in multiples of 128 is because it's what graphics cards prefer. If you upload an image that isn't sized in multiples of 128 SL would scale it to the closest multiple on upload which will cause artifacting. Hope that helps :)
_____________________

My other hobby:
www.live365.com/stations/chip_midnight
Davo Greenstein
Dag from Oz
Join date: 22 Dec 2003
Posts: 150
05-05-2004 00:14
I'm just wondering how he makes an image 51.2 pixels wide ??

So to summarize ?

Keep your image dimensions at powers of 2

2,4,8,16,32,64,128,256,512.

Up to max of 512pixels

??
Corf Few
Junior Member
Join date: 2 Apr 2004
Posts: 9
05-05-2004 08:28
I was speaking about 51.2 pixels in the mind set of 'absolutes', making a point, being precise.

The DPI thing kinda gets you after working with some graphics that require high counts to scale well, giving you more to work with. The explanation of DPI being meaningless gave me a avenue to try out, prove useless, and discard worrying about DPI. Which is exactly what I was trying for.

I'll do some more practicing today.

Corf
_____________________
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

You know you're not a newb anymore, when people don't roll their eyes when you ask a question.

A 'Mentor' is someone who will never roll their eyes in the first place.

(Applies to both RL & SL)