View Full Version : Partially Transparent Texture
Subsim modder 32
01-02-10, 02:45 PM
Hello,
I have added an alpha channel to a texture map (NSS_GESubSenzors_T01.dds). The alpha channel has a small black area, where the T01 texture should become transparent. In S3D I have activated the option "Disablez-buffer write + enable alpha blend". When I start the game all parts with this map are partially transparent, and I can only see the specular mask. My question is, how I can make textures transparent?
Thank you
keltos01
01-02-10, 02:56 PM
Hello,
I have added an alpha channel to a texture map (NSS_GESubSenzors_T01.dds). The alpha channel has a small black area, where the T01 texture should become transparent. In S3D I have activated the option "Disablez-buffer write + enable alpha blend". When I start the game all parts with this map are partially transparent, and I can only see the specular mask. My question is, how I can make textures transparent?
Thank you
so you have created glass ?
:up:
keltos
DarkFish
01-02-10, 03:32 PM
Everything should work the way you describe. Check if it shows up transparent in S3D, if it does it should do so in game too.
However, there's a small 'bug' in SH4 which messes up the colors of semi-transparent objects. To get the colors right again, add a UnifiedRenderController to every object using the transparent texture.
Subsim modder 32
01-02-10, 04:19 PM
I have added a UnifiedRenderController to my object, and now the transparecy looks ok, but the z-buffers seams to be work not correct: Any Idea?
http://img196.imageshack.us/img196/1511/type205050.jpg
DarkFish
01-02-10, 05:23 PM
I have added a UnifiedRenderController to my object, and now the transparecy looks ok, but the z-buffers seams to be work not correct: Any Idea?well, the z-buffer looks fine to me. Z-buffer doesnt say anything about transparency. The Z-buffer determines in what order the objects are drawn, so if it would not be disabled objects would be drawn in the wrong order, resulting in the transparent object rendered completely wrong, probably becoming completely invisible for the most part.
So far the 3d rendering lesson:)
Your problem has to do with only the outside of the texture being rendered, check the "two-sided (cull none)" box to make it work
Subsim modder 32
01-02-10, 05:47 PM
The objects are drawn in the wrong order. It is not clear from the picture, I know, but the first object is the snorkel head and behind it the radar antenna follows. On the picture, the parts are in the wrong order!
The two sided setting haven't improved anything. Some more faces are drawn now, but that's as far as it goes.
As told before, to activate the transparecy I have activated the feature "Disable z-buffer write + enable alpha blend".
For me it says: If I want to have transparent objects then the z-buffer has to be "disabled". But what can I do with this strange displayed parts?
Subsim modder 32
01-02-10, 07:29 PM
I have found a solution for me:
- I have exported the transparent verticles separately as one object and added it to my modified FUMO_65 as SchnorchelGitter (eng. snorkel grid).
- The other objects have the original texture map
- The marked "NSS_GESubSenzors1_T01.tga" texture map is the only one with the "Disable z-buffer write + enable alpha blend" function enabled.
(This texture map also has a NSS_GESubSenzors1_O01.tga attached)
- As DarkFish told me, I have added a UnifiedRenderController to the transparent grid object, so that the transparency is shown now correctly
- Using the two sided option for the texture brings the problem with the z-buffer back to the grid object, so I deactivated it again
Thanks for the help DarkFish
http://img263.imageshack.us/img263/7251/type205051.jpg
DarkFish
01-02-10, 08:50 PM
glad it works now!
generally speaking, it is indeed best to cut the model up into smaller pieces if you want only specific vertices to be transparent.
the two-sided setting was for another problem I saw in the screenshot you posted: only the front polygons of the grill are rendered.
Looks good by the way:up:
skwasjer
01-03-10, 07:40 AM
Just like to add that you have some control over the render (sort) order in which objects are drawn.
* The alphablend flag basically implies that the object should be rendered after objects that have this flag disabled. It does not always happen however depending on the tree structure. See next points.
* The game sorts objects based on the materials that it uses. Objects that share a material are rendered in the same pass, before switching to the next material. So, the order of the materials in the DAT matter.
* In case objects use the same material, the order of the nodes in the DAT is the order in which they are rendered.
With this in mind, some issues can be solved by moving nodes around. I generally put transparent objects last in my node hierarchy. This is important because the zbuffer should be completely filled with all solid objects that should be seen in the background, before it can render transparent objects over them. If not done, then you can end up with solid objects over transparent ones, which may not be the result you are after.
Similarly, putting all transparent materials after non-transparent ones helps.
NB: In case of referenced objects (from a library) you would put the placeholder node at the bottom.
Hope this clears a few things up...
Subsim modder 32
01-05-10, 05:50 AM
The last thing I would have expected is, that the order of the objects/nodes plays a role. Thank you skwasjer for the background information.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.