Skip to content

Commit

Permalink
Merge pull request #520 from ninjadev/dvoje-fixes
Browse files Browse the repository at this point in the history
Dvoje fixes
  • Loading branch information
trondkla authored Jul 10, 2019
2 parents f887993 + ce9ba52 commit 4323c13
Show file tree
Hide file tree
Showing 7 changed files with 13,219 additions and 10,417 deletions.
4 changes: 4 additions & 0 deletions nin/backend/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ function watch(projectPath, cb) {
return;
}

if(path.endsWith('~')) {
return;
}

if (logFileChanges) {
console.log(chalk.yellow('Change in project detected: ') +
chalk.cyan(event) +
Expand Down
2 changes: 2 additions & 0 deletions nin/dasBoot/FullscreenRenderTargetPool.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class FullscreenRenderTargetPool {
this.renderTargets[this.used] = renderTarget;
}
this.used++;
renderTarget.texture.repeat.set(1, 1);
renderTarget.texture.offset.set(0, 0);
return renderTarget;
}

Expand Down
2 changes: 1 addition & 1 deletion nin/dasBoot/NodeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class NodeManager {

resize() {
for(var key in this.nodes) {
this.nodes[key].resize();
this.nodes[key].resize();
}
}

Expand Down
4 changes: 3 additions & 1 deletion nin/dasBoot/RootNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RootNode extends NIN.Node {
inputs: {screen: new NIN.TextureInput()}
});

this.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
this.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
this.scene = new THREE.Scene();
this.quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), null);
this.scene.add(this.quad);
Expand All @@ -26,6 +26,8 @@ class RootNode extends NIN.Node {
map: A
});
}
renderer.setRenderTarget(null);
renderer.clear();
renderer.render(this.scene, this.camera);

NIN.FullscreenRenderTargetPool.withdrawFullscreenRenderTargets();
Expand Down
5 changes: 4 additions & 1 deletion nin/dasBoot/ShaderNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class ShaderNode extends NIN.Node {

render(renderer) {
const renderTarget = NIN.FullscreenRenderTargetPool.getFullscreenRenderTarget();
renderer.render(this.scene, this.camera, renderTarget, true);
renderer.setRenderTarget(renderTarget);
renderer.clear();
renderer.render(this.scene, this.camera);
renderer.setRenderTarget(null);
this.outputs.render.setValue(renderTarget.texture);
}
}
Expand Down
5 changes: 4 additions & 1 deletion nin/dasBoot/THREENode.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class THREENode extends NIN.Node {

render(renderer) {
const renderTarget = NIN.FullscreenRenderTargetPool.getFullscreenRenderTarget();
renderer.render(this.scene, this.camera, renderTarget, true);
renderer.setRenderTarget(renderTarget);
renderer.clear();
renderer.render(this.scene, this.camera);
renderer.setRenderTarget(null);
this.outputs.render.setValue(renderTarget.texture);
}

Expand Down
Loading

0 comments on commit 4323c13

Please sign in to comment.