Multisample causes model skin wraparound
Posted: Mon Apr 03, 2017 23:43
I'm just putting this here to see if anything can be done about it. If it needs a bug report, I'll do it but I suspect it's just a rounding error or some such that people will just have to be aware of.
With Multisample on the OpenGL preferences at any setting other than "off" some models of a particular type show unwanted artefacts. The attached file should show it.
Picture of the map:
The model uses planes to make the leaves/branches of a tree. The skin is UV mapped to the model so that the planes use most of the space available. With multisampling on though, it looks like the skin is wrapping around and the bottom edge of the skin (the trunk of the tree) is being mapped to the top of the plane. Hard to explain. Here, have a picture.
As you can see, the top of the frame for the plane is very close to the top of the graphic, but it isn't right at the top (although it is less than a pixel I think) as you can see here.
In some models, I have also noticed a similar effect on the sides (basically the same setup but the trunk graphic is at the side rather than at the bottom of the image). In that case, you get vertical artefacts beyond the branches rather than horizontal ones above the tree.
I noticed this when playing my Burghead mod. You can see the star-shaped artefacts above some of the trees and vertical ones beside the tall pine tree on the right.
It is fixable from the modder's side. If I move the UV mapping around so that there are a couple of pixels between where the mesh is and the edge of the skin graphic, the issue goes away but, clearly, there are models "in the wild" where this issue can manifest. While messing around with a few models by other people and models from other games, I've found quite a few occasions where this crops up. I plan on doing a bug-fix release of Burghead before too long so I've already addressed all the models there.
So, is it something that can be addressed engine-side or is it just something for modders to be aware of?
With Multisample on the OpenGL preferences at any setting other than "off" some models of a particular type show unwanted artefacts. The attached file should show it.
Picture of the map:
The model uses planes to make the leaves/branches of a tree. The skin is UV mapped to the model so that the planes use most of the space available. With multisampling on though, it looks like the skin is wrapping around and the bottom edge of the skin (the trunk of the tree) is being mapped to the top of the plane. Hard to explain. Here, have a picture.
As you can see, the top of the frame for the plane is very close to the top of the graphic, but it isn't right at the top (although it is less than a pixel I think) as you can see here.
In some models, I have also noticed a similar effect on the sides (basically the same setup but the trunk graphic is at the side rather than at the bottom of the image). In that case, you get vertical artefacts beyond the branches rather than horizontal ones above the tree.
I noticed this when playing my Burghead mod. You can see the star-shaped artefacts above some of the trees and vertical ones beside the tall pine tree on the right.
It is fixable from the modder's side. If I move the UV mapping around so that there are a couple of pixels between where the mesh is and the edge of the skin graphic, the issue goes away but, clearly, there are models "in the wild" where this issue can manifest. While messing around with a few models by other people and models from other games, I've found quite a few occasions where this crops up. I plan on doing a bug-fix release of Burghead before too long so I've already addressed all the models there.
So, is it something that can be addressed engine-side or is it just something for modders to be aware of?