oUF

97.2k Downloads

portrait is causing heavy FPS dropping

fafaraway opened this issue · 3 comments

commented

normaly I have 120-150 FPS, but when I enter 40 people battleground, FPS drop to 30-50
I did alot testing, and found out the portrait element is causing this
when I disable portrait, FPS return to normal
is this normal or I miss something?

my portrait related code

local function PostUpdatePortrait(element, unit)
	element:SetDesaturation(1)
end

if C.unitframes.portrait then
	local Portrait = CreateFrame('PlayerModel', nil, self)
	Portrait:SetAllPoints(Health)
	Portrait:SetFrameLevel(Health:GetFrameLevel() - 1)
	Portrait:SetAlpha(C.unitframes.portraitAlpha)
	Portrait.PostUpdate = PostUpdatePortrait
	self.Portrait = Portrait
end
commented

You might want to tell us what unit frames you are putting those portraits on. 3D models in the 2D UI does come with a performance cost.

Is this player, target, all the raid frames, nameplates...what? :)

As a general rule I would avoid putting anything like this on frames there are very many of, like nameplates or raid frames. Only singular targets and smaller groupings like boss, arena, party works, really.

commented

@Goldpaw yes, I use this on party/raid frame, so I guess I should only use this on player/target frame 😭

commented

I do not have this issue with my party frames with 3D enabled. Show us or link us code we can overview.