Skip to content

Commit

Permalink
fix(Texture): don't downsample internal textures, like jorge
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed Oct 13, 2023
1 parent a537163 commit 53e363d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,14 @@ export class Texture extends ThreeJsTextue {
const image = await getSharpInstance(originalSource)

let quality = 100
if (settings.variant !== 'premium' && !this.filename.endsWith('[icon].bmp')) {

const needsDownsampling = !(
settings.variant === 'premium' ||
this.isInternalAsset ||
this.filename.endsWith('[icon].bmp')
)

if (needsDownsampling) {
quality = 70

let maxWidth = 128
Expand Down Expand Up @@ -213,7 +220,13 @@ export class Texture extends ThreeJsTextue {

let newSize = powerOfTwo
let quality = 100
if (settings.variant !== 'premium' && !this.filename.endsWith('[icon].bmp')) {

const needsDownsampling = !(
settings.variant === 'premium' ||
this.isInternalAsset ||
this.filename.endsWith('[icon].bmp')
)
if (needsDownsampling) {
newSize = Math.max(128, newSize)
quality = 70
}
Expand Down

0 comments on commit 53e363d

Please sign in to comment.