Jump to content


creating mips using transparency


  • Please log in to reply
13 replies to this topic

#1 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,163 posts
  • Gender:Male
  • Location:Krautlandia

Posted 25 August 2006 - 09:48 PM

well

it that time of the year again and i've once again picked a track that i feel could use a little graphical update. this time it's laguna seca - beautiful and challenging track. same goes for the texture creation process.
so far i'm done with the asphalt and the grassy bits..
so when i went to do a quick new wiremesh fence texture (2048x1024) - and yes, i know smaller would be better, but the rig can handle it, ... ;). quick being only the part where i created the actual graphics from scratch, like the partly rusted fence poles and then wiremesh. that took an hour or two... so when i was done with all that, i decided ;) that a wiremesh fence would be really nice if it actually was see-through, read transparent. and that's where all the trouble started. creating an alphamap was easy enough. and i chose to do it as a black and white only transparency map - no fancy gradients (yet). so then i fired up mipman.. great tool, but it would not create a usable mip. hmm.. some fiddling around with it - and an actual brief reading session of the readme that came with it made it obvious 256 pixels is the limit. bummer, i would need 8x times, at the least 4x times. well on to the next tool: winmip.
while winmip is a tool i really like and basically use to convert all my textures from .bmp to .mip in, it somehow will not do what i want it once transparency is involved.

here's what happens:
i did my texture in such a way, that i filled the background with a flat green back (rgb: 0,255,0), so that i would have an easy choice for a transparency color. so then i load my 24bit .bmp with the texture in it into winmip, change the type to mip, subimages 7 (as is my custom), mapping to 0. and then there's the choice what type of mip to create - and frankly, i tried them all. say i go for type 4 and via click or shift-click (as it seems to do the same anyway) i select the green background color easily enough. so it shows up in the tiny box and all is well. so then i save the .mip file, copy it into the track directory and start gpl... almost all is fine then. the texture loads, it has a transparency in it - even where i wanted it, BUT what's with the green outline around everything? DOH!
i tried other ways - no go.

so how can i use winmip to that effect? if anyone has pointers, it would be greatly appreciated. same goes for seperate transparency maps - as i already created one, i'd like to use it, but have so far not been able to load both the texture .bmp and the transparencymap .bmp into winmip to create one .mip that includes both. also how would i go about this process if i want to create a texture that has transparency gradients? that is a proper mystery to me. i would like to create a few trees of the like you see in battlefield (if anyone of the racing community even knows that game - the trees really rock! ;) if not the game itself) for this king of racing simulation, but so far.. no deal. always off colors or no transparency at all... i'm clueless as to what i'm missing here. are there other tools out there? i'm using photoshop cs, winmip 2.16.6 and/or mipman.

- i can post pictures of the track as it is right now and off the worrying texture issues as well if need be.

r.


/edit

thanks to a fairly long earch at rsc, i was able to locate a tip that got rid of the fringing issue - simply use color 51,51,51 (r,g,B) as the backgroundcolor to be made transparent later. for the fence i did, this works well enough, but i guess once i will be into the trees, quite literally even, a single transparent color won't do anymore. i'm guessing i would need 16 colors for that, so a real alpha-transparency map will be needed.
is there anybody out there who can shed some light on the workings of that?

or if possible, if someone has a detailed description of the .mip-file format, i may get it in my head to unearth my old programming tools and write a converter myself. it's been know to have happened before and after all a dosbased tool isn't that hard to write...



dangermouse EDIT: Changed title of thread to attract attention.

Edited by dangermouse, 26 August 2006 - 10:26 AM.


#2 Phil Neville

Phil Neville

    Senior Member

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 135 posts
  • Gender:Male
  • Location:England

Posted 26 August 2006 - 08:33 PM

Create alpha map (has to be 4-bit) then save it with the same name as the Bmp for the fence (which has to be 16-bit)  but with '_ti' on the end, eg. if the fence Bmp is called Fence.Bmp (it's possible!  :rolleyes: ) then the alpha map will be called Fence_ti.Bmp. Then convert to Fence.Bmp to Mip with WinMip and save as type5.

#3 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 9,718 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 27 August 2006 - 07:09 AM

Thank you Phil for the hint  :thumbup:
I was never able to create type5 mips, now I will :P
Ciao! :)

Done these tracks and working on others.


#4 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,163 posts
  • Gender:Male
  • Location:Krautlandia

Posted 27 August 2006 - 11:57 AM

great many thanks for that tip, phil.

so, since i managed to make the fence and the barriers with just the basic 51, 51, 51 background color trick, i went to try out this transparency mapping bit. and surprise surprise it works. great!. well not 100% great, but just some strange things happened. attached is an image i just took inside gpl. it shows a part of the laguna seca track that i am in the process of retexturing. notice they hay bales weird transparency behaviour...

Posted Image

sorry this is about 170k full size jpeg (quality 4 though, so it's quite bad).

pasted in the bottom right corner are the actual texture and the transparency map that winmip took and made into a single mip-file. so far so good. also please notice that the texture is 24bit - photoshop (even cs) has its way of taking the option to save as 16bit, ignore it and still save 24bit files. if i chose to convert that file with irfanview to be 8bit, winmip would crash on clicking the transparency button, once type 5 is selected. hm.
the alpha-map is a simple circular black to white gradient saved as a 4bit .bmp.

any suggestions?
from the looks of it, gpl doesn't accept all values for transparency. some are taken as completely see-through, others are really with their approximate percentage of opacity given by the white / black value.

#5 Phil Neville

Phil Neville

    Senior Member

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 135 posts
  • Gender:Male
  • Location:England

Posted 27 August 2006 - 01:57 PM

View Postsky, on Aug 27 2006, 06:57 PM, said:

from the looks of it, gpl doesn't accept all values for transparency. some are taken as completely see-through, others are really with their approximate percentage of opacity given by the white / black value.

That's about right. When you make your transparency map always remember that the black part will be see-through and the white part will be solid, anything in between will be...er...in between :). Don't worry about the 24-bit Bmps, WinMip converts them to 16-bit when it makes the Mip.

Welcome back Ginetto!  :wave: Good holiday?

#6 Phil Neville

Phil Neville

    Senior Member

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 135 posts
  • Gender:Male
  • Location:England

Posted 27 August 2006 - 06:44 PM

Another thing that might interest you...If you are using 7 sub-images, you will never see your mip in all it's 2048x1024 glory unless you park your car right next to it. From the track you are probably seeing a 512x256 sub-image (something that Hi-Res fans don't often consider)

#7 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 9,718 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 28 August 2006 - 12:53 AM

View PostPhil Neville, on Aug 27 2006, 09:57 PM, said:

Welcome back Ginetto!  :wave: Good holiday?

Thank you Phil :thumbup:
Really cool :bandana1:  been in San Diego an Cabo San Lucas :rolleyes:
...Refreshing :P

Done these tracks and working on others.


#8 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,163 posts
  • Gender:Male
  • Location:Krautlandia

Posted 28 August 2006 - 10:06 AM

View PostPhil Neville, on Aug 28 2006, 02:44 AM, said:

That's about right. When you make your transparency map always remember that the black part will be see-through and the white part will be solid, anything in between will be...er...in between . Don't worry about the 24-bit Bmps, WinMip converts them to 16-bit when it makes the Mip.

Another thing that might interest you...If you are using 7 sub-images, you will never see your mip in all it's 2048x1024 glory unless you park your car right next to it. From the track you are probably seeing a 512x256 sub-image (something that Hi-Res fans don't often consider)

ok, on the first one... though i find the behaviour of that particular texture with its corresponding alpha-map a little strange. after that try, i took one of the main asphalt textures and made an alpha-map for it. the entire track would be white with numerals from 0-9 then A-F on it. 0 was solid white, F was solid black. then i made a mip of the two, put it in the laguna directory and voila.. the track was completely see through, just the parts of the numerals were partly seethrough - just the way from completely seethrough (white, 0) to solid (black, F). so it apparently works just as it should.
so that leaves me to investigate what went wrong with that haystack mip ;)

anyway, i did a few trees, though with solid one color backgrounds and no 16 color alphamaps - and they look awesome :D - though i've only put one of them in yet. the others will follow tonight.


oh and what you wrote about the 7 sub-images... really. what size texture do i see then or rather which subimage? say i'm using the behind car view for driving (which i actually only use to marvel at the graphics ;) ), would i then see the 7th sub-image, the biggest map, right under the car? that would be enough for me really.
also what would you recommend? i mean, if i can save filesize and will not see the difference in mips anyway, why not? so what is the setting that works best - oh and i actually do play in 1600x1200 (direct x7).

thanks for all the tips so far!

more will follow, i know, especially on the poly-editing and object adding to tracks front :)

#9 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 9,718 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 28 August 2006 - 11:19 AM

Thw subimages are one the half of the other, so if you have 7 subimgs, depending on the graphic setting you have, every given distance yo'll see the half of the size texture.
This may explain the weird behaviour of your mip; try to set 0 subimgs to that mip and see if is more shadowy.
The less subimages you have, the more your pc will work, the less FPS you will have; it depends on your system specs.
Try to keep more subs as possible.
For Example:
I've seen that the monaco rocks 2 has all the mips setted to 0 subimages, I changed them to the default values (that reduces the textures to 8 pixels at the fartest), and I don't notice any degrade in quality ( I play at 1024), but the FPS now is much more!

As per default in D3D using 256x256 mips you'll use a value of 3 for the asphalt if doesn't reproduce any line, 1 for the dirt stripe on the sides of the asphalt (usually used for the lines...)
basically the far you go from the asphalt the more subimgs you'll keep.

Just do some tries and you'll find out the best compromise for your system.
If you're thinking for a public release, keep in mind the "average" power of the computers around...

Ciao! :)

Edited by Ginetto, 28 August 2006 - 11:25 AM.

Done these tracks and working on others.


#10 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,163 posts
  • Gender:Male
  • Location:Krautlandia

Posted 28 August 2006 - 03:53 PM

thanks for the input..

so far i'm doing the stuff for my own good - yes ignorant fool, i know.
once i am fully satisfied with the looks of it on my system, i will start thinking and working on optimising it. like for example my redesign of reims: it is a long way from done, especially since i have started on redoing the entire pitlane textures and some logos are really hard to find in a good resolution or a pain in the .. to redraw from scratch. and that track is already in the triple figure megabytes and it isn't even halfway done.
no way will any sane body download that, no matter how good it may be looking (well i would, but then again, i'm a graphics addict, not to say nut, which would also be justifieable). though, as it is the working directory, there's probably lots of older texture revisions in it.
still, with reims i actual offered to send a version, once i think it is final, for approval purposes to the allam brothers (the original creators). if they consider it acceptable, i will release it to the public. but since some of my textures have improved while working on laguna seca, i may be going back and replace them in reims as well.

one issue i have with textures is, especially with grass and dirt ones, that you see they are repeating. like there's recurring patterns. and i want to minimize that.. i will go at that again once i have the rest fairly well done. in the end it is probably a neverending story. what i notice though is that right now, i keep driving tracks solely for looking at spots that need improving or texturereplacement. going backwards, driving around in circles, all that.. the actual driving and improving times is put on the backburner now ;)


oh a question though:
what system do you think or consider to be a standard gpl-enthusiasts system? average graphicscard, memory and processing power would be appreciated. i've lost touch to the "basis" on that issue a long time ago... :(

#11 Phil Neville

Phil Neville

    Senior Member

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 135 posts
  • Gender:Male
  • Location:England

Posted 28 August 2006 - 04:58 PM

On the question of mip size/sub-images there is a very informative thread HERE

I know exactly what you mean about repeating patterns in textures, it annoys the hell out of me too. I've found that when working on a texture if I shrink it right down (just by zooming out)I can usually see any pattern developing and then take steps to stop it.

About average system specs, I haven't got a clue. There is definitely a lot less complaints about FPS than there used to be but whether this is because most GPLers have upgraded their PCs or because those with lower end systems just don't want to cause a fuss I don't know.

Good luck with your projects, I hope one day we will all be able to use them ( a Reims update would be especially welcome :thumbup: )

#12 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,163 posts
  • Gender:Male
  • Location:Krautlandia

Posted 29 August 2006 - 07:15 PM

thanks for the link. i skipped over the thread at work today.. hm nice shot of clemont ferrand in it (i guess it is cf). anyway.. interesting points brought up there. have to do some testing on it myself.

oh well, here's a few screenies. resized to 800x600, a tad sharpened to compensate for the loss of quality due to the resizing business. first three are of laguna seca as it is right now. question to those from around that area. is the grass color about right? the original track graphics were quite a lot more saturated, but the way i see it, the laguna seca racetrack is in a rather arid environment with mostly sand a pretty dry grass...  tbh a little more greenish would probably work better with my trees but i'd rather have it more realistic in terms of grey-greenishness

anyway, pic 1 shows the start finish area, with updated grass, banking, asphalt texture (see comment below, not mine, will try to do a more smoothish race-course one), guardrails and the trees in the upper right corner. the fence, mentioned in the posts above, is barely visible. pic 2 shows the downhill stretch after corkscrew with new trees, a new drainage ditch, the old tracktexture and some closer shots of two of the 4 new tree types - and me grounding the lotus while trying to get a good shot ;). shot 3, showcasing trees ...

Posted Image Posted Image Posted Image

these following few are of reims as it has been for about the last half year or so (where i didn't do anything). the grass textures in laguna and here are basically the same i think, just that laguna has been adjusted to less saturation and a slighlty more yellow/reddish tint vs blue/greenish in reims - too bad i don't really have any good color period reference images of reims. only pics i have are of what it looks like today or black and white (no asphalt coloring, grass color/shade etc...). the next to last shot of reims is showing where i started working on the pitlane. i think 3 or 4 of those banners have been remade - esso, dunlop, one of the big red ones and one other. the last shot is apparently using the 69 mod, part 1 - god i love it! the hedge is my doing as well. but oooooh so bad.. the top of the hedge doesn't have its own texture, but uses the grassy one - that's one of the things i would like to remedy by putting an additional row of polies on top of the hedge with a new texture... (details like that, that annoy me ;))

Posted Image Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

please note that the asphalt in laguna seca is a based upon the texture used in the kyalami high res update - author unknown as far as i know :( (for the asphalt, not the rest of the update). the reims asphalt is entirely my own doing. taking photographs of local streets, pasting them together, make them into something that can be used and doesn't show any repeating patterns (yay - something to be done to the grassy bits, too). the grass was done like that, too. about 2 days each for both those textures.

while i'm at it.. whenever i start doing something like this.. i get carried away. i want to add additional polygons to the original track just to put some more textures on it, like flowery bits on grassy stretches - as seen in the default lfs2 track on the uphill stretch towards start finish. just something to loosen the track up a bit, some basically useless detail - useless for racing ;)... yes i'm eyecandy addicted and i don't usually like the "dead" look of most 3d based games. with all textures just being slap bang against each other, like a concrete wall sprouts of a grass texture - no transition between the two, just a hard straight edge - green vs grey, no dirt on the wall - too clean, sort of. i rather like a more dirty, worn look - as if it has been used or been subject to weather and all that... oh well.. if i start on this... we'll be here for a while.. eheh

any criticsm / comments appreciated. pointers or reference shots of the actual period also gladly appreciated

#13 luna

luna

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPip
  • 189 posts
  • Gender:Male

Posted 29 August 2006 - 10:40 PM

:thumbup:

CanAms at Laguna Seca

#14 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,163 posts
  • Gender:Male
  • Location:Krautlandia

Posted 30 August 2006 - 03:34 PM

according to that pic/pics there, laguna is surrounded mostly by sandy bits with a few bushes of grass.. that is almost what i expected. well almost. i do remember it being mostly dry grass with a dirt strip between the actual track and the runoff areas that are somewhat grassy.

oh btw.. i would like to create track graphics as shown in the lemans track by the virtual lm team. that is unbelievably good. i'd like to have that kind of detail for gpl :)

/edit

sidenote... i have recently converted some of my reims-track textures to 1/2 and 1/4 size, that is 1024x1024 and later 512x512. after that i started testing it, with the smallest size... while i didn't notice any changes in fps - not that i would have expected that to happen anyway, i did notice that it looks awful to my eyes. of course, this is only true, if you use the behind car camera - something i only do to marvel at the graphics, while driving i apparently revert back to cockpit view. so then i went to 1024x1024 textures and although the experience was more satisfying, i still didn't like it that much. sure it was better than 512x512, but it can't keep up with the full shebang textures. and this although i made an honest effort at getting the smaller sized textures to look sharper, by adding a bit of unsharp mask (best sharpener photoshop has to offer). it just isn't the same.
needs to be said though, that cockpit view wise it hardly makes a difference, as you only see the full detail in the few places where you can see between the cockpit and the suspension / tires. still, i'd prefer hires over mid-or "lowres" (yes, i consider 512x512 lowres ;) ) textures.


/edit 2

my local harddisk kinda died... but that isn't much of a problem as i tend to work on a network drive on my server. that way the local machine can die or foul up whatever it likes and however often it may feel necessary ;) to do so.. the data stays alright. so all my work is still there, just not the track-directory and the last gpl-install. but that isn't much of a bother either, as all the original files are still in the "work" directory (see above).

Edited by sky, 07 September 2006 - 07:58 AM.