TeamRizu / OutFox

The Bug Reporting Repository for OutFox LTS 0.4, Alpha V and Steam Early Access Builds
https://projectoutfox.com
Apache License 2.0
187 stars 3 forks source link

[Unexpected Behavior] ActorFrameTexture's zbuffer/vertex normals behavior is incorrect. #373

Closed MrThatKid closed 10 months ago

MrThatKid commented 3 years ago

What you're using

I'm working with models in ActorFrameTextures, and I noticed that the way it displays is inconsistent with how it would display outside of an ActorFrameTexture. (I remember hearing something about vertex normals being inverted in AFTs)

This is replicatable in SM5.0.12, so it's an upstream bug, too.

For example, I'm going to use an audio tape model found in Puurokulho's "Private Caller" file. cassette.zip

Here's the code one would put into a layer (with the model parts in the same folder):

Def.ActorFrameTexture{
    InitCommand= function(self)
        self:SetWidth(SCREEN_WIDTH):SetHeight(SCREEN_HEIGHT)
        :EnableDepthBuffer(true):EnableAlphaBuffer(true):Create()
        help = self
    end,
    Def.ActorFrame{
        OnCommand= function(self) self:fov(60) end,
        Def.Model{
            OnCommand= function(self)
                self:zoom(1):Center():zbuffer(true):wag():addx(-160)
                :effectmagnitude(10,20,0)
                :effectclock('bgm')
                :effectperiod(10)
            end,
            Meshes= "cass_inside.txt",
            Materials= "cass_inside.txt",
            Bones= "cass_inside.txt",
        },
    }
},
Def.ActorFrame{
    OnCommand= function(self) self:fov(60) end,
    Def.Model{
        OnCommand= function(self)
            self:zoom(1):Center():zbuffer(true):wag():addx(160)
            :effectmagnitude(10,20,0)
            :effectclock('bgm')
            :effectperiod(10)
        end,
        Meshes= "cass_inside.txt",
        Materials= "cass_inside.txt",
        Bones= "cass_inside.txt",
    },
},
Def.Sprite{
    OnCommand= function(self)
        self:SetTexture(help:GetTexture()):Center()
    end,
},

Here's what it looks like: (left = AFT sprite, right = model outside of AFT) 2021-07-22_133953

Expected behavior

I'd expect both to look pretty similar instead of zfighting.

Scraticus commented 10 months ago

Fixed in 042!