logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Alphablend + Mesh issue (Read 605 times)
SteadZ
Full Member
***
Offline


UMS Captain

Posts: 143
Location: Huddersfield, England
Joined: Sep 10th, 2012
Gender: Male
Alphablend + Mesh issue
Mar 10th, 2018 at 9:58pm
Print Post  
Hi there guys,
I've made a new tree mesh which makes use of an alphablend skin, but with alphablend on I get random holes appearing in my mesh and overlapping issues:

Alphablend ON:

Alphablend OFF:


This happens both as a StaticMesh and LODMesh, and the holes are only visible when looking at an angle other than directly from the side.

Don't know if this is an "unfixable" issue, but thought I'd ask anyway Smiley

PS: Hope this is the right section...

.......
SZ
.......
  


Back to top
IP Logged
 
gopostal
Betatester
Offline


Hack coder

Posts: 808
Joined: Jul 31st, 2008
Gender: Male
Re: Alphablend + Mesh issue
Reply #1 - Mar 11th, 2018 at 3:43am
Print Post  
The editor renders things funny all the time. How does it look actually in-game?
  

I don't want to give the end away
but we're all going to die one day
Back to top
 
IP Logged
 
SteadZ
Full Member
***
Offline


UMS Captain

Posts: 143
Location: Huddersfield, England
Joined: Sep 10th, 2012
Gender: Male
Re: Alphablend + Mesh issue
Reply #2 - Mar 11th, 2018 at 2:54pm
Print Post  
I managed to fix the problem with the holes (that was related to me setting the whole mesh to 2-sided, I then went into UnrealFX and manually set ONLY the leaf polys to 2-sided) but the overlapping mesh problem still happens, both in the editor and in-game. There is no issue however if I change the mesh from STY_AlphaBlend to STY_Masked.

I've also noticed that lighting ignores AlphaBlend when a mesh is set to bShadowCast, whereas if you set to Masked instead a "real" shadow is produced.

.......
SZ
.......
  


Back to top
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7686
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Alphablend + Mesh issue
Reply #3 - Mar 12th, 2018 at 6:57am
Print Post  
to avoid any problems like these with shadows there is an option to provide a "ShadowMesh". This way you can even add more complex or visually better fitting shadows for them.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Feralidragon
Full Member
***
Offline



Posts: 192
Location: Lisbon - Portugal
Joined: Jul 24th, 2008
Gender: Male
Re: Alphablend + Mesh issue
Reply #4 - Mar 12th, 2018 at 3:05pm
Print Post  
UT99 also has a similar issue (which I am not sure if it has been fixed in Unreal), not with STY_AlphaBlend (because it doesn't have it), but between STY_Masked and STY_Translucent: if you have 2 meshes, each one as masked and another as translucent, the masked one will be rendered on top of the translucent one every time.

A similar thing happens between STY_Modulated and STY_Translucent, however the translucent mesh gets rendered on top instead.


This is a bug in the render itself, and the nature of these bugs lead me to believe that somewhat the rendering of these meshes are split into "rendering groups" or "layers" (if that's a thing... idk), and somewhat once one of them is rendered, their Z-buffering is forgotten or ignored by the other ones, and the only one being consistently considered is any rendering without any blend applied whatsoever.

It's very annoying, but at the same time allows for some neat effects sometimes, which I exploited for a few things like smoke effects, more realistic clouds, even the very thing you can see in my signature image.
  
Back to top
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7686
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Alphablend + Mesh issue
Reply #5 - Mar 12th, 2018 at 3:13pm
Print Post  
I think what you describe is the classical z-sorting issue, which is pretty much explained here:

https://www.khronos.org/opengl/wiki/Transparency_Sorting

In Unreal alphablend makes this situation even more tricky and I added sorting for it. There is no "full" solution for that as you can read in this article, but it can be managed most of the time. Back then they did not really sort masked and translucent if I recall correctly, probably because this was a real expensive thing on a machine like a PII-233.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Feralidragon
Full Member
***
Offline



Posts: 192
Location: Lisbon - Portugal
Joined: Jul 24th, 2008
Gender: Male
Re: Alphablend + Mesh issue
Reply #6 - Mar 12th, 2018 at 4:01pm
Print Post  
I see... that explains it, thanks for the link. Smiley

My followup question would be "how do newer engines deal with it so perfectly", but then when I think about it, they have a higher polycount in which that kind of sorting would work better, and in reality, amidst all the features and whatnot engines have introduced, transparency is still the same, and I would dare to say even simpler nowadays given that only alpha blending is used most of the time, with everything else being a fragment shader and nothing more, which is easier to do and looks better than using additive blending and others of the sort, so I would argue that we actually see less transparency in newer engines than in old ones, so this problem pretty much "disappeared".

Would I be wrong making this statement?
  
Back to top
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7686
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Alphablend + Mesh issue
Reply #7 - Mar 12th, 2018 at 4:14pm
Print Post  
I do not play that many "modern" games, but if you really watch out for such problems, you'll find them usually.
There are quite some new and exciting rendering methods which do reduce these cases and avoid them to some degree, so I think your statement does make sense.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo