- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Object Creation >
- The alpha "blend" mode bleed
- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Object Creation >
- The alpha "blend" mode bleed
Posts: 11,682
Thanks: 9680 in 11 Posts
I have made one object, which is one colour all over, and meant to be solid, and it's solid from one view and transparent from the other even though it's symmetrical! Is there some secret in the normals? I feel as if we should investigate this more deeply as it's becoming a real nuisance
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 11,682
Thanks: 9680 in 11 Posts
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Edit - you said that the object was supposed to be solid? Why is it set to blend?
Posts: 11,682
Thanks: 9680 in 11 Posts
No it didn't work for me. But the weird thing is, *some parts* of the same group are not behaving that way - my lock box always appears as in front of the other parts. If you have that in the foreground, it blocks view of all the other parts. If you have it in the background, it bleeds through.
Just noticed your edit: The subset is a whole load of bits of door furniture, like letterboxes and stained glass. It's blend cos of the glass.
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 11,682
Thanks: 9680 in 11 Posts
The real reason I started this thread was to explore some subtlety of when and how it happens, because I noticed that not all the parts were behaving the same. I have an identical handle both sides of the door, in the same subset. But one of those handles is see through while the other is not. There has to be something in the mesh...
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 547
Thanks: 17356 in 49 Posts
Charmed Sims Archives Gorgeous Clothing, Furnishings and more.
Two great sites ALL FREE NOW!!!
Posts: 11,682
Thanks: 9680 in 11 Posts
So do I set the opacity level higher for the ones I want solid? At the moment it is a ridiculously high number like 4294967295
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 11,682
Thanks: 9680 in 11 Posts
All I know is I have a north handle and a south handle which were made by maxis. The north handle is opaque while the south handle is transparent. There is nothing different about the way they are set in SimPE, and they share a material in SimPE.
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
This problrm isn't really a "bug", I think it is just a fact of 3d game rendering in general - but either way, it has existed since the original Sims2 game.
The basic rules:
* Any semi-transparent mesh group can never be made in such a way that you would be able to look through it and see another part of the same group.
You will notice that Maxis meshes with semi-transparent parts are always things like a tabletop, microwave door window, etc - basically a flat plane, a sphere, or some other shape that will completely hide the rest of itself from any viewing angle.
* Also it is impossible to get a truly "solid" part on the same group with a semi-transparent part. Even when the alpha is all-white, it will still have that same glitch if the parts of the same mesh group ever overlap each other. So, parts that must be truly solid will have to be in a different group than any semi-transparent parts.
* Then there is the "solid-alpha" option, if it suits your object - where the alpha works only as if it were all black and white - in other words, you can use this to change the shape of a part (or make something disappear completely), but no semi-transparency at all. Not as flexible, but the advantage is that it is as easy to do as a simple, solid, part.
================================
So each semi-transparent part that will overlap another is going to have to be in a different mesh group.
The "opacity" setting in SimPE is kind of mis-named - it really doesn't affect the opacity (transparency) of the part at all, it tells the game in which order the parts are to be layered. The lowest Opacity numbered part is the one closest to the center, next lowest is the next one out (and will look OK if the first part is seen through it), and so on.
Anyway, to make it possible to recolor many such parts, you might be able to use the "slave subset" thecnique. I've never had occasion to do that, and it looks rather complicated, but it might be what you are looking for.
Posts: 11,682
Thanks: 9680 in 11 Posts
I did think of some workarounds for the object I am actually creating, so I am not exactly stuck anyway, but this strange effect is niggling me and I *feel* as if there should be a way to stop it properly :D
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 4,403
Thanks: 10660 in 115 Posts
Posts: 11,682
Thanks: 9680 in 11 Posts
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 4,403
Thanks: 10660 in 115 Posts
Posts: 11,682
Thanks: 9680 in 11 Posts
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Thanks Dr Pixel. I have read in another post that you can get more colourable parts with a slave subset, but I wasn't sure how to understand that, because beds have covers that are slave subsets but I am not aware that a bed can have two colourable parts to its frame? I mean, however would it be displayed in the catalogue anyway? |
The bed/covers thing is a different technique, where two (or more) different objects can share the exact same textures (in the case of beds, one bed covers recolor will work for every bed in the game, but each bed frame uses only it's own independant recolors.)
The "slave subset" is a method where two (maybe more?) different mesh groups will share the same recolor option while still acting as independant groups - that is, they can use different material definition files, different transparency settings, etc - but they are linked together into one of the recolor options. So when you change that one color option, the materials for both these groups will change together. In other words, they act as if they were a single mesh group, they are not independantly re-colorable, the color of both will change at the same time.
For example, let's say you are making a table and you want the legs to be dull, the top shiny, and the glass transparent - but you want these all to be re-colorable.
You can do this by making the mesh with three groups - the top, the legs, and the glass insert in the top.
Then you would make two of the groups re-colorable (probably the top and the glass) and make the third (the legs) a slave of the top.
Now the user could change the color of the top - and at the same time the color of the legs would also change.
In the catalog, it would show as the usual two color options, since the "slave" group isn't really an extra color option, it is always forced to go along with the top's color option.
Posts: 11,682
Thanks: 9680 in 11 Posts
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 547
Thanks: 17356 in 49 Posts
Here's my notes on adding them to an object. No guarentees about comprehensiveness or completeness.
-----
Import new mesh with slave subsets
Create slave texture (If multistate item, create texture for each state)
Clone Texture
change name
click fix tgi
commit
Create Slave material Definition (if multistate item, create material definition for each state)
Clone material Definition (TXMT)
Rename (See Note below)
Click Fix TGI
Commit
Modify stdMatBaseTextureName to point to new texturename minus the _txtr
On File List modify the filename to point to new texture name minus the _txtr
on cMaterialDefinition tab modify the Description to be the filename minus the _txmt (might not need to do this??)
Create Material Override for SlaveSubset (if multistate item, create material override for each state)
Clone MMAT (If this is a multistate item clone an existing mmat for the same material state)
Click on Resource tab
Modify the Instance to be 1 higher than previous MMAT, commit.
click on plugin tab.
Modify the subsetName to be new slavesubset
Modify the name to be the new txmt name minus the _txmt
Commit.
Update Shape (SHPE)
Click on Parts Tab
Modify any subsets/txmt as needed
Click add to add an entry for the new slave subset.
Enter new subset name
Enter new material definition file minus the _txmt
Click Commit
Update the Geometric Node (GMND)
Click on Edit Blocks Tab
Add a cDataListExtension
If a cCopyRight block exists move the new cDataListExtension so it is above the CopyRight block in the list.
On the content tab, select the 0x0 initial gmnd node from the list.
click on the cObjectGraphNode
Click on Add in the Datalist extension Reference
Click on the newly added reference.
Change the index to be 1 higher than exists.
Change Enabled to be 0x01
In the blocklist, select the new unnamed cDataListExtension.
Change the name to tsDesignModeSlaveSubsets
Change the type to string and click add.
Click on the new string in the items list.
Change the name to be the master subset name
Change the string to be the slave subset name. (This can actually be a comma delimited string of multiple subset names).
Click Commit.
Select the tsDesignModeEnabled from the block list.
Verify it has 1 or 2 entries and they are the master subsets. -- These must be the subsets listed in the material overides.
If desired add the slavesubset to the tsNoShadow with a value of 0.
Save
Run Fix Integrity.
Run SceneGrapher -- check for any missing texture links. Fix as needed.
If this is an item that is multi state, ie lamp on/off, or counter dirty/clean you will
also need to modify the text lists.
STR (0x88 Material Names)
add string index for <slavesubset> for each material state (clean/dirty on/off)
Modify the matching Material Overides
set the objectStateIndex = the new index in the Material Names(0x88) string list
STR (0x87 Model - Mesh Groups)
add string index for <slavesubset>
NOTE on Material Definition Names: Sims2 looks for slave texture names in a specific format. For instance:
If you have the mesh group
countertop (master)
|__countertrim (slave)
|__decor (slave)
counterfinish
If your master material definition name is:
##0x1C050000!counternouveau-[snowstorm-12.7.2005-1516a]_countertop_copper_dirty
Then your slave material definition names would be
##0x1C050000!counternouveau-[snowstorm-12.7.2005-1516a]_counterttrim_copper_dirty
##0x1C050000!counternouveau-[snowstorm-12.7.2005-1516a]_decor_copper_dirty
Even if you create and link the files properly, but do not use this format, Sims will not find your texture.
You can see this if you check the texture logs file.
Clone MMAT (If 2nd MMAT doesn't exist)
If clone modify the Instance to be 1 higher than previous MMAT, commit.
Modify the subsetName to be new subset
Modify the name to be the new txmt name minus the _txmt
commit.
Charmed Sims Archives Gorgeous Clothing, Furnishings and more.
Two great sites ALL FREE NOW!!!
Posts: 11,682
Thanks: 9680 in 11 Posts
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 11,682
Thanks: 9680 in 11 Posts
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 403
Thanks: 48431 in 74 Posts
Usaully when we want a trasparency we build the texture in DXT3 ( or5) format and we set in the TXMT the stdMatAlphaBlendMode in blend mode.
It's too difficult for me to explain why and the difference, but there is another way to make trasparency and they work fine with all the types of mesh, even if they have different subset: solid and trasparency.
Build your texture as usually in DXT3 format. Then in the TXMT set stdMatAlphaBlendMode to "none" and set stdMatAlphaTestEnabled to "1" ( make it enable). See the different in the game.
Hope this help you.
If you like my creations, you may consider to make a little donation to support my site and my modding activity.
MaryLou's Sims 2 World - MaryLou Sims 2 Forum (Italiano)
Posts: 11,682
Thanks: 9680 in 11 Posts
Anyway the door is working fine now, I just await the clarification of the MMAT confusion, but it looks like I must have guessed right anyway
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Posts: 547
Thanks: 17356 in 49 Posts
The other thing about slavesubsets is that SimPE Object Workshop broke sometime around 0.48, such that it doesn't make recolors properly if you have more than one slave to a master. It does work fine on one slave for one master though for sure.
Charmed Sims Archives Gorgeous Clothing, Furnishings and more.
Two great sites ALL FREE NOW!!!
Posts: 11,682
Thanks: 9680 in 11 Posts
If I do put it in the tsdesignmodenabled list, the part does not appear in the game at all.
I'm pretty stuck here really.
"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Who Posted
|