Fix and tidy code.

Fix camera background color not working (a call signature changed).
Fix render graph only recording the last camera
(by adding a synthetic root node to the graph).
This commit is contained in:
Ben Richards 2024-05-02 16:47:28 +12:00
parent 65e69a8369
commit f3d1da68a9
3 changed files with 14 additions and 6 deletions

View file

@ -2787,8 +2787,6 @@ var WebGLRenderer = new Class({
this.renderNodes.nodes.Camera.run(this.baseDrawingContext, children, camera);
// TODO: Debug batches
return;
// OLD CODE:

View file

@ -63,7 +63,7 @@ var Camera = new Class({
{
var bg = camera.backgroundColor;
var col = GetColor32(bg.red, bg.green, bg.blue, bg.alpha);
FillCamera.run(currentContext, camera, col);
FillCamera.run(currentContext, col);
}
// Draw children.

View file

@ -5,6 +5,7 @@
*/
var Class = require('../../../utils/Class');
var Events = require('../../events');
var BatchTexturedTintedRawQuads = require('./BatchTexturedTintedRawQuads');
var Camera = require('./Camera');
var FillCamera = require('./FillCamera');
@ -197,6 +198,18 @@ var RenderNodeManager = new Class({
{
this.debugGraph = null;
this.currentDebugNode = null;
// Insert a synthetic root node.
this.pushDebug('[Render Tree Root]');
this.renderer.once(
Events.POST_RENDER,
function ()
{
this.setDebug(false);
},
this
);
}
},
@ -252,9 +265,6 @@ var RenderNodeManager = new Class({
else
{
this.currentDebugNode = null;
// Stop recording the graph.
this.setDebug(false);
}
},