close dialogue

Hello smile

I'm Siobhan Curran/Kisa Naumova, and this is my weblog. I tend to write about stuff like crossdressing, Macs, code, cats, wine and Second Life, but in general it's just an ongoing conversation about all sorts of stuff. If you'd like to know a little bit more about what this all is, I recommend starting on this page which has a little bit of info on who I am, and what I'm trying to do — or you could dive into my five years worth of archives if you like.

Otherwise, feel free to close this box and explore...

Friday, 20th April, 2007

Auto-Chunking Textures

Very busy today :smile: I'm in the middle of texture-baking the floor of the 6th Floor of my Big Build™ in SL.

One of the reasons I went down the 'using Illustrator to design the build' thing (and the resulting SVG parsing whatsit) was that I wanted to be able to have an accurate copy of a structure in Illustrator to use as a base to map out all the shadows and lights on.

When I did eyefood.Steiger you see, I messed up a couple of places when I copied the coordiantes of the walls :unsure:

Anyways, that's not really important — I just wanted a little preamble to vaguely explain what the purpose of this script is...

for ((i=1;i<=8;i+=1)); do 
let "y=($i-1)*900"
for ((j=1;j<=5;j+=1)); do 
let "x=($j-1)*900"
convert H6.png -crop 1000x1000+$x+$y \
    +repage -resize 256x256 H6-$i-$j.tga 
done 
done

Before, I was manually cropping the whole image down into its overlapping tiles — and it was taking me ages. But ↑ that uses ImageMagick to do it all for me :smile:

Now, I've got 40 textures to upload and place...

(This is a very badly written post, I know. My head's a little frazzled from the maths I've been doing all day.)

...

You know what? I've just realised — having spent a good part of today struggling with texture-offsets and repeats on the small fiddly prims that make the edges of the floor — that I could re-use the data I get from the original SVG, and create perfect glitch-free textures every time.

:smile:

(Like any of you care :tongue:)