Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Field Researcher
Original Poster
#1 Old 7th May 2020 at 10:08 PM
Default solid texture appears semi-transparent on slave object
I've been working on recolors of the bistro set that came with Seasons, and at first that sounded like a straightforward process... but of course i didn't go as smoothly as planned. My idea was to make a metal tabletop with cutouts matching the frame color. I got it to look as i intended for the table, but for some reason on the matching chair the exact same texture appears semi-transparent and the frame underneath is visible through parts that should be solid. This is particularily noticeable on the white recolor, a bit less with darker colors.
(another weird thing is that this apparently only happens when the chair is inside a room, but not outdoor as you can see on the screenshot with the green chair)
I should also mention that i have a CEP-extra installed so that the chair seat pulls its textures from the tabletop (https://sims2artists.com/index.php?topic=5238.0) so I am sure that both the table and chair use the same TXTR and TXMT

So I read Pixelhate's TXMT guide once again , and I also found this very old thread which seems to deal with the same issue I am having, it gave me some idea of what is happening but not really how to fix it. I tried setting the alpha blend mode to none to use binary transparency, and technically it works but as I expected it also makes the cutout edges all jagged and ugly (see last picture) :/

I guess the problem comes from the chair mesh itself and/or the CEP-extra but i don't know what to do about it... Anyone has an idea how to fix that? Or any tips for nicer-looking edges with binary transparency? I'm not the most experienced with texturing so this is a lot of trial and error
Screenshots
Advertisement
Mad Poster
#2 Old 7th May 2020 at 11:46 PM Last edited by simmer22 : 7th May 2020 at 11:59 PM.
If you just want a cutout effect but no transparency, don't use blend (set "stdMatAlphaBlendMode" to none), and instead set "stdMatAlphaTestEnabled" to 1. This allows for cutouts, but doesn't cause weird transparency. This setting can be used on the entire mesh, and won't cause any strange effects like the Blend setting does. You may want to make sure the TXMT settings match.

You'll also want to use DXT3 or DXT5 for the textures, because this gives much better alpha edges (Import and DXT1 give a worse result). DXT5 could be best, as this allows for the smoothest alpha transitions (I've noticed some improvement compared to DXT3 when using transparency and cutouts). DDS files could perhaps also work (but I've had mixed results there).

In some cases it could be the mesh, but most likely not.

Blend does weird things to the mesh, and is best used with transparency only (glass-like effects). If you want to use the Blend setting, make sure you separate the mesh so you only use that setting on the particular parts of the mesh you want to have transparent textures. You also need to layer the mesh properly, because if not, there can be some strange flickering effects because the transparent parts think they're supposed to layer in front or behind when it's the other way around. I've never quite gotten it to work properly with partly opaque textures.
Field Researcher
Original Poster
#3 Old 8th May 2020 at 12:44 PM Last edited by Monsieur_Oshima : 11th May 2020 at 10:26 PM.
Thanks for the reply!

Quote: Originally posted by simmer22
If you just want a cutout effect but no transparency, don't use blend (set "stdMatAlphaBlendMode" to none), and instead set "stdMatAlphaTestEnabled" to 1.

This is what i've done in my last attempt, and right now i'm using DXT3 but I haven't tried DXT5, I'll see if i get a better result.

Quote: Originally posted by simmer22
You also need to layer the mesh properly, because if not, there can be some strange flickering effects because the transparent parts think they're supposed to layer in front or behind when it's the other way around. I've never quite gotten it to work properly with partly opaque textures.

They were talking about this in the thread i linked but this is the part i didn't quite get, is the layering set in the GMDC? What makes me think that the issue could be with the mesh is the fact that the texture works fine on the table, and only the chair shows this weird semi-transparency. I don't really have control over the mesh though since it is a game object and not my own CC. Unless i go all the way with default replacements which was not really what I intended initially

[Update] I have tried DXT5 and it smoothes the edges slightly better, but only when zoomed in very closely... otherwise I didn't notice any difference. I tried changing the StdMatAlpharefValue, or editing the texture itself but didn't manage to get a satisfying result. No matter how i look at it I can't seem to figure a way around the aliased edges with binary transparency

Something I noticed though is that if i remove the CEP-extra file and create a standalone recolor for the chair, it works fine. So my guess is that the CEP-extra changes something that determines how the seat subset is rendered? I could remove it entirely and make separate recolors for the table and chair, but that would break the recolors i already have, including some which i wanted mine to match... [Update 2] turns out I was wrong about that ... I checked again and standalone chair recolors have the same problem
Back to top