mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-31 12:22:18 +00:00
speed cubemap
This commit is contained in:
parent
95d9a2601a
commit
58201b2745
1 changed files with 5 additions and 1 deletions
|
|
@ -197,6 +197,7 @@ class MarbleWorld extends Scheduler {
|
|||
var _loadingLength:Int = 0;
|
||||
|
||||
var _resourcesLoaded:Int = 0;
|
||||
var _cubemapNeedsUpdate:Bool = true;
|
||||
|
||||
var textureResources:Array<Resource<h3d.mat.Texture>> = [];
|
||||
var soundResources:Array<Resource<Sound>> = [];
|
||||
|
|
@ -1139,6 +1140,8 @@ class MarbleWorld extends Scheduler {
|
|||
if (!this.rewinding && Settings.optionsSettings.rewindEnabled)
|
||||
this.rewindManager.recordFrame();
|
||||
|
||||
_cubemapNeedsUpdate = true;
|
||||
|
||||
this.updateTexts();
|
||||
}
|
||||
|
||||
|
|
@ -1147,7 +1150,8 @@ class MarbleWorld extends Scheduler {
|
|||
asyncLoadResources();
|
||||
if (this.playGui != null && _ready)
|
||||
this.playGui.render(e);
|
||||
if (this.marble != null && this.marble.cubemapRenderer != null && _ready) {
|
||||
if (this.marble != null && this.marble.cubemapRenderer != null && _cubemapNeedsUpdate && _ready) {
|
||||
_cubemapNeedsUpdate = false;
|
||||
this.marble.cubemapRenderer.position.load(this.marble.getAbsPos().getPosition());
|
||||
this.marble.cubemapRenderer.render(e, 0.002);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue