PDA

View Full Version : Transparent curtains on cheaper shower


Nan
2nd Oct 2008, 07:41 PM
I was trying to make a shower (the cheaper one : Clean Water Shower System) with a transparent curtain, using mike19' tutorial here (http://www.modthesims2.com/showthread.php?t=220244&highlight=transparency).
That is, change the stdMatAlphaBlendMode from none to blend, and the texture format from DTX1 to DTX3 (the format is already DTX3 on this shower).

I already applied this tutorial with success to the expensive tub/shower (sorry, it was some time ago and I don't remember it's english name).

The tricky part is that I wanted to import the alpha channel with the image using the NVIDIA DXT building (I can't remember if that's what I did the fist time with the tub/shower), but I didn't know how to do the alpha channel in Paint Shop Pro (7).

I found a technique (or so I think) to modify the alpha channel of the texture by experimenting, so if someone can tell me if it's right :
I first made the alpha as a separate image, and then introduced it in my texture using a mask from new image, and then I saved the mask in alpha channel, using the default one. I then removed the mask without merging it in the image.

After that the alpha seemed right in PSP, and it looked right in SimPE too (with the white & grey squares to show the transparency)

But it gives a bad result in game, see pictures attached. In fact, the shower is entirely transparent on certain angles. I can't be more specific than that, sorry. You'll have to watch the pictures attached and mayby look at the recolor in your game if you want.

That's why I attached the package itself, if it is of any use to someone. I've also included the texture I used to recolor the shower in the rar, because the image was too big to be attached.

I hope there's a (simple) solution, but it's an object that doesn't have a choice of colors without CEP, and so I wonder if it could be the reason why it doesn't work properly.

I use the latest versions of SimPE and CEP, the ones updated for AL (V0.72 and V9.0).

HystericalParoxysm
2nd Oct 2008, 08:04 PM
Try putting stdMatAlphaBlendMode back on "none" - it's "blend" that's the problem, making it go all wonky like that. "Blend" doesn't work well on anything that will have any sort of overlap between mesh parts. Changing it to DXT3 and changing the texture should be enough to do the transparency on its own, I think.

Nan
2nd Oct 2008, 09:09 PM
Well thank you for your quick answer. I didn't think of doing what you suggested because it was clearly specified in the tutorial that the property was to be set to blend for this to work.

Anyway, I've tried it setting it back on none and reimporting the texture, and indeed the shower is not transparent anymore, but the curtain isn't either. Gasp !

Echo
3rd Oct 2008, 01:17 AM
Like HP said, blend doesn't work at all well on objects where parts visually overlap each other. There are a couple of work-arounds, depending on what sort of transparency you actually need.

The first option is that you can set stdMatAlphaBlendMode to 'none' and stdMatAlphaTestEnabled to '1'. This will allow alpha 'cutouts' in your texture. That means that a part can be completely opaque, and another part can be completely transparent, but you can't have translucent areas (so nothing like glass, which you can see but can also see through).

The second option is to break the object down into a bunch of subsets, so that there is no way for one 'blend' subset to overlap any part of itself. If you were making a cube, for example, each of the six faces would have to have its own subset with its own texture. This makes recolouring very problematic, and isn't very good object design, but will sometimes work.

The third way is that you use solid colour texture images (with no alpha), then set alpha transparency on the TXMT. This is how glass is normally handled in the game. It creates a uniform transparency across the entire subset, so you can't have some areas more transparent than others, but it handles overlap well even in the most complicated objects (like translucent glass vases). Off the top of my head I can't remember the settings for it, but if you grab a glass object and use its TXMT in place of yours you'll get that effect. If you have trouble finding one that works, let me know and I'll put one up here when I get home. :)

Nan
4th Oct 2008, 11:00 PM
Thank you very much Echo, but wow... It's beginning to look not as simple as I want to/can handle.

If I've understood correctly what you've said, the third method looks like it's the better way to make that shower. The first one isn't applicable, as I don't want an entirely transparent curtain, and as for the second one, it looks as/more difficult as the third one, and less satisfactory.

For the third solution, again if I've understood correctly, I'm supposed to clone the shower, then in a 3D program, separate the shape in 2 subsets, one for the 4 sides with tiles and one containing the curtain only. And then in SimPE, change the attributes of the to-be-transluscent subset so that it matches one of the windows.

Sorry if it's not clear enough, but I've never created any new object, nor really use a 3D program (a few trials at modifying a Maxis' clothes mesh) and so first of all I don't know how to make subsets.

But I've looked at the beginners tutorial yesterday (the V2.1 for Wings 3D), in which the example object is a table; and at page 27, it says that after designing the table legs, we must merge the four of them; does it means that if they haven't been merged, they would have make 4 subsets ? If it is so, then maybe it's something I can try; open the shower in Wings 3D, then try and separate the two parts. The rest of the procedure being detailed step by step, I think I can handle it.
It's a lot more challenging that I intended to do initialy, but I'm on vacation, and so I've got time to try, after all...

But if it's not that (and unless it's easier than what I thought), I'd rather give it up and make an opaque curtain, then I will make my translucent curtains on the expensive tub/shower, and it will be enough for the time being.

Echo
6th Oct 2008, 01:55 AM
Yep, that's it exactly! :D Wings has an option which separates parts, something like "separate" or "break apart". You can try that, then re-group the various pieces into the right arrangement. :)