Smooth light source
Redbeanw44602 opened this issue · 1 comments
Redbeanw44602 commented
When the light source moves, the light appears to be flickering.
Possible reasons
- If the latter light source block is created before the former one, it is possible that rendering causes the intensity of light to overlap. When the previous light source block is destroyed, the field of view will suddenly become "dim".
- If the light source block of the latter is not yet fully created before the destruction of the former light source, there will be a brief moment where no light source is available.
Possible solutions
Change the way "destruction" is carried out: Currently, destruction is instantaneous (lightLevel 15 -> 0). An ideal way to destroy light source blocks would be a gradual process (lightLevel 15->12->9->6->3->0). This could possibly be achieved by continuously sending multiple UpdateBlockPacket, but the final effect is unknown. It may require re-implementing the lightMgr.
The downside of doing this is also obvious: it's not friendly to low-end devices and server bandwidth. Therefore, individual switches should be provided for each player and a main switch for the server.
KobeBryant114514 commented
感觉这个问题可以参考optifine,给一个动态光源的刷新速度的配置项。
比如说
- 高品质: 每tick刷新
- 流畅: 每500ms(约10tick)刷新