[DiscordArchive] i thought fading m2 don't write to zbuff, so the object (or terrain?) behind it is not occluded and
[DiscordArchive] i thought fading m2 don't write to zbuff, so the object (or terrain?) behind it is not occluded and
Archived author: 4bhorrent • Posted: 2023-05-15T11:22:33.038000+00:00
Original source
i thought fading m2 don't write to zbuff, so the object (or terrain?) behind it is not occluded and can "shine" through?
or did i get the concept wrong?
Archived author: Deamon • Posted: 2023-05-15T11:29:38.558000+00:00
Original source
It's little different.
When you render transparent object, what essentially happens is this: the color that already exists in g-buffer gets blended with the color provided by transparent object and it's alpha. So to render transparent object properly, you first need to render all objects behind that transparent object. It's one of major headaches in gamedev.
So what usually done is this: first engine renders all opaque objects. And then it renders meshes of transparent objects, sorted from farthest to nearest to camera. Transparent objects usually are rendered with turned off "writing to zbuffer". But "z-test" is still turned on