Skip to content

Commit

Permalink
Editor: Removed gammaInput/gammaOutput settings and set gammaOutput t…
Browse files Browse the repository at this point in the history
…rue by default.
  • Loading branch information
mrdoob committed Feb 28, 2019
1 parent 72c90fc commit 6c27538
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 48 deletions.
2 changes: 0 additions & 2 deletions editor/examples/arkanoid.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"type": "App"
},
"project": {
"gammaInput": true,
"gammaOutput": true,
"shadows": true,
"vr": false
},
Expand Down
2 changes: 0 additions & 2 deletions editor/examples/camera.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"type": "App"
},
"project": {
"gammaInput": true,
"gammaOutput": true,
"shadows": true,
"vr": false
},
Expand Down
2 changes: 0 additions & 2 deletions editor/examples/particles.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"type": "App"
},
"project": {
"gammaInput": true,
"gammaOutput": true,
"shadows": true,
"vr": false
},
Expand Down
2 changes: 0 additions & 2 deletions editor/examples/pong.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"type": "App"
},
"project": {
"gammaInput": true,
"gammaOutput": true,
"shadows": true,
"vr": false
},
Expand Down
2 changes: 0 additions & 2 deletions editor/examples/shaders.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"type": "App"
},
"project": {
"gammaInput": true,
"gammaOutput": true,
"shadows": true,
"vr": false
},
Expand Down
2 changes: 0 additions & 2 deletions editor/js/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ var Config = function () {

'project/renderer': 'WebGLRenderer',
'project/renderer/antialias': true,
'project/renderer/gammaInput': false,
'project/renderer/gammaOutput': false,
'project/renderer/shadows': true,

'project/vr': false,
Expand Down
2 changes: 0 additions & 2 deletions editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,6 @@ Editor.prototype = {

metadata: {},
project: {
gammaInput: this.config.getKey( 'project/renderer/gammaInput' ),
gammaOutput: this.config.getKey( 'project/renderer/gammaOutput' ),
shadows: this.config.getKey( 'project/renderer/shadows' ),
vr: this.config.getKey( 'project/vr' )
},
Expand Down
33 changes: 5 additions & 28 deletions editor/js/Sidebar.Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,45 +119,22 @@ Sidebar.Project = function ( editor ) {
} );
rendererPropertiesRow.add( rendererShadows );

rendererPropertiesRow.add( new UI.Break() );

// Renderer / Gamma input

var rendererGammaInput = new UI.THREE.Boolean( config.getKey( 'project/renderer/gammaInput' ), strings.getKey( 'sidebar/project/gammainput' ) ).onChange( function () {

config.setKey( 'project/renderer/gammaInput', this.getValue() );
updateRenderer();

} );
rendererPropertiesRow.add( rendererGammaInput );

// Renderer / Gamma output

var rendererGammaOutput = new UI.THREE.Boolean( config.getKey( 'project/renderer/gammaOutput' ), strings.getKey( 'sidebar/project/gammaoutput' ) ).onChange( function () {

config.setKey( 'project/renderer/gammaOutput', this.getValue() );
updateRenderer();

} );
rendererPropertiesRow.add( rendererGammaOutput );

container.add( rendererPropertiesRow );

//

function updateRenderer() {

createRenderer( rendererType.getValue(), rendererAntialias.getValue(), rendererShadows.getValue(), rendererGammaInput.getValue(), rendererGammaOutput.getValue() );
createRenderer( rendererType.getValue(), rendererAntialias.getValue() );

}

function createRenderer( type, antialias, shadows, gammaIn, gammaOut ) {
function createRenderer( type, antialias, shadows ) {

rendererPropertiesRow.setDisplay( type === 'WebGLRenderer' ? '' : 'none' );

var renderer = new rendererTypes[ type ]( { antialias: antialias} );
renderer.gammaInput = gammaIn;
renderer.gammaOutput = gammaOut;
var renderer = new rendererTypes[ type ]( { antialias: antialias } );

if ( shadows && renderer.shadowMap ) {

renderer.shadowMap.enabled = true;
Expand All @@ -169,7 +146,7 @@ Sidebar.Project = function ( editor ) {

}

createRenderer( config.getKey( 'project/renderer' ), config.getKey( 'project/renderer/antialias' ), config.getKey( 'project/renderer/shadows' ), config.getKey( 'project/renderer/gammaInput' ), config.getKey( 'project/renderer/gammaOutput' ) );
createRenderer( config.getKey( 'project/renderer' ), config.getKey( 'project/renderer/antialias' ), config.getKey( 'project/renderer/shadows' ) );

return container;

Expand Down
4 changes: 0 additions & 4 deletions editor/js/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ var Strings = function ( config ) {
'sidebar/project/renderer': 'Renderer',
'sidebar/project/antialias': 'antialias',
'sidebar/project/shadows': 'shadows',
'sidebar/project/gammainput': 'γ input',
'sidebar/project/gammaoutput': 'γ output',

'sidebar/settings': 'Settings',
'sidebar/settings/language': 'Language',
Expand Down Expand Up @@ -485,8 +483,6 @@ var Strings = function ( config ) {
'sidebar/project/renderer': '渲染器',
'sidebar/project/antialias': '抗锯齿',
'sidebar/project/shadows': '阴影',
'sidebar/project/gammainput': 'γ输入',
'sidebar/project/gammaoutput': 'γ输出',

'sidebar/settings': '设置',
'sidebar/settings/language': '语言',
Expand Down
1 change: 1 addition & 0 deletions editor/js/Viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ var Viewport = function ( editor ) {

renderer.autoClear = false;
renderer.autoUpdateScene = false;
renderer.gammaOutput = true;
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( container.dom.offsetWidth, container.dom.offsetHeight );

Expand Down
3 changes: 1 addition & 2 deletions editor/js/libs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ var APP = {
this.load = function ( json ) {

renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.gammaOutput = true;
renderer.setClearColor( 0x000000 );
renderer.setPixelRatio( window.devicePixelRatio );

var project = json.project;

if ( project.gammaInput ) renderer.gammaInput = true;
if ( project.gammaOutput ) renderer.gammaOutput = true;
if ( project.shadows ) renderer.shadowMap.enabled = true;
if ( project.vr ) renderer.vr.enabled = true;

Expand Down

0 comments on commit 6c27538

Please sign in to comment.