Render same scene to a second WebGLRenderer causes textures to disappear? and Gl_invalid_enum

I’m updating my geometry to buffer geometry, but now when I render to a new window (passing my scene to it), it only renders points and lines, but not any polygons…
I noticed that I get these in the console:

[.WebGL-18B4EBC8] GL_INVALID_ENUM: Enum is not currently supported.

But I’m unsure if it is related… Why would changing the geometry to buffergeometry cause the renderer to stop rendering?? They render fine to my main window, but the second window I open won’t render the scene completely except for the points and lines in it… The lines and points show, but no polygon surfaces…

anybody have any ideas as to what is happening???

How are you passing the scene to another window?

I use nw.js and I open a new window first like so:

        global.stuff.renderWindow ='render.html',{
			icon: "c3dicon.png",
			"always_on_top": false,
			title: 'Render',
			position: 'center',
			width: global.stuff.config.renderCameraWidth,
			height: global.stuff.config.renderCameraHeight,
			show: true
		}, function(new_win){
			new_win.on('loaded', function(){ = el.value;
				new_win.window.render.mainWindow = mainwin;

In the render.html…

	<div id="renderDiv" class="bgChecker"></div>
	<input type="file" id="saveRender" nwsaveas accept=".png" onchange="" style="display:none;">
	<button onclick="render.saveRender()" class="rounded" style="position:absolute; top: 4px; left: 4px;">Save</button>

<script type="module">
	import * as THREE from './build/three.module.js';
	window.THREE = THREE;

<script type="text/javascript" src="render.js" defer></script>

and in the render.js…

var render = new renderData();
function renderData(){;	//the ID of the camera we will be rendering
this.renderer = new THREE.WebGLRenderer( { alpha: true } ); = null;
this.cameraP = new THREE.PerspectiveCamera();
this.cameraO = new THREE.OrthographicCamera();

this.mainWindow = null;
this.renderDiv = null;

this.imageData;		//used for saving out the render

this.init = function(){
	this.renderer.autoClear = false;
	this.renderDiv = document.getElementById("renderDiv"); = global.stuff.config.renderCameraWidth + 'px'; = global.stuff.config.renderCameraHeight + 'px';
	var w = global.stuff.config.renderCameraWidth, h = global.stuff.config.renderCameraHeight;
	this.renderer.setSize( w, h );
	if( == 'Default'){
		if( = this.cameraO;
		else = this.cameraP;;
	}else{ = parseInt(;
		for(var i=0; i<; i++){
			if([i] =={
				if([i] == 'PerspectiveCamera') = this.cameraP;
				else = this.cameraO;
	} = w / h;
	if( == 'OrthographicCamera'){
		var ratioWidth = w / this.mainWindow.window.innerWidth;
		var ratioHeight = h / this.mainWindow.window.innerHeight; *= ratioWidth; *= ratioWidth; *= ratioHeight; *= ratioHeight;
	this.renderer.setClearColor( new THREE.Color( global.stuff.config.renderCameraBackgroundColor ), global.stuff.config.renderCameraBackgroundTransparency );
	var rememberCameraVisible = global.stuff.skybox.activeSkybox.visible;
	if( global.stuff.config.renderCameraSkybox ){
		global.stuff.skybox.activeSkybox.visible = true;
		this.renderer.clear();                     // clear buffers
		this.renderer.render( global.stuff.skybox.sceneSky, );
		this.renderer.clearDepth();                // clear depth buffer
		this.renderer.clear();                     // clear buffers
	this.renderer.render( global.stuff.scene, );
	this.imageData = this.renderer.domElement.toDataURL('image/png').replace(/data:image\/png;base64,/, '');
	global.stuff.skybox.activeSkybox.visible = rememberCameraVisible;

this.saveRender = function(){
} = function(e){
	var fpath = e.files[0].path;
	e.value = '';
	var fs = require('fs');
	fs.writeFile(fpath, this.imageData, 'base64', function(err) {
		if(err) {
		} else {
			console.log("The file was saved: "+fpath);


It renders the scene, because I can see the lines and points being rendered to the canvas, however, there aren’t any polygons/faces… when I do a console.log of the scene, it shows that it has all the data of the objects… so I don’t know why they aren’t all being rendered…

It worked before I started migrating my geometry to buffer geometry… I also changed to using modules… but that is all that I changed, and now it won’t render the complete scene…

any help would be appreciated because I have no clue what could be the problem.

The left side is what it looks in the main window, and the right side is what it looks like in the new window…

I think maybe the buffer isn’t being passed to the second webrendere? I’m not sure…
I found this : Rendering the same scene to two different renderers. · Issue #189 · mrdoob/three.js · GitHub
But that is very old and closed issue, so maybe the issue has returned?

Could you create a jsfiddle that reproduces the issue?