accassid / dice-gen

A three.js based dice generator react app.
17 stars 7 forks source link

Complex fonts running out of memory #61

Open accassid opened 3 years ago

accassid commented 3 years ago

Steps to reproduce

The TextGeometry option object has a parameter for how much to simplify the font. We need some way to detect if a font is complex and dial up that parameter accordingly.

Vishara commented 3 years ago

I ran into this problem too, but I tried to identify the cause of the problem. So the following settings I could identify:

First Try (Error) Font: Hammersmith One Orientation Indicators: Size 0.6, Space 0.2 D20 Font Scale: 0.60

Success Try Font: Hammersmith One Orientation Indicators: Size 0.6, Space 0.4 (<-- Changed this) D20 Font Scale: 0.60

The download of the same D20 works without any problems. Also the download of the complete Set works as well with the indicator space of 0.4 or higher. 0.3 is bugged as well.

So perhaps its not the Font, rather then a combination of the space with a complex font.

Because I love this project and I'm also a web developer, I will try some more tests about this ;)

Vishara commented 3 years ago

Additional Info:

The following settings will create a strange behavier with the D6 dice... Font: Hammersmith One Orientation Indicators include on D6, Size: 0.6, Space: 0.6 D6 Font Scale: 1.30

image

Here you can see the strange gap, which is created by activating the orientation indicator. When you deactivate the indicator, you will get a perfect clean dice.

Perhaps the memory problem is caused by a wrong calculation of the orientation indicator. In this case there was enough memory but the calculation creates the gap. With other fonts you reach the memory limit and it will break.

Hope that helps :)