Skip to content

Commit

Permalink
Merge pull request #18108 from Mugen87/dev29
Browse files Browse the repository at this point in the history
WebGLRenderer: Remove gammaInput.
  • Loading branch information
mrdoob authored Dec 10, 2019
2 parents 2fb36e6 + ecd7443 commit b686968
Show file tree
Hide file tree
Showing 56 changed files with 84 additions and 356 deletions.
5 changes: 0 additions & 5 deletions docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ <h3>[property:Object extensions]</h3>
<h3>[property:Float gammaFactor]</h3>
<p>Default is *2*. </p>


<h3>[property:Boolean gammaInput]</h3>
<p>If set, then it expects that all textures and colors are premultiplied gamma. Default is *false*.</p>


<h3>[property:Boolean gammaOutput]</h3>
<p>If set, then it expects that all textures and colors need to be outputted in premultiplied gamma. Default is *false*.</p>

Expand Down
5 changes: 0 additions & 5 deletions docs/api/zh/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ <h3>[property:Object extensions]</h3>
<h3>[property:Float gammaFactor]</h3>
<p>默认是 *2*. </p>


<h3>[property:Boolean gammaInput]</h3>
<p>如果设置,那么所有的纹理和颜色都会预乘gamma。 默认值是*false*.</p>


<h3>[property:Boolean gammaOutput]</h3>
<p>如果设置, 那么它期望所有纹理和颜色需要乘以gamma输出。 默认值*false*.</p>

Expand Down
4 changes: 0 additions & 4 deletions editor/js/libs/tern-threejs/threejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4661,10 +4661,6 @@
"!type": "bool",
"!doc": "Defines whether the renderer should auto update objects. Default is true."
},
"gammaInput": {
"!type": "bool",
"!doc": "Default is false. If set, then it expects that all textures and colors are premultiplied gamma."
},
"gammaOutput": {
"!type": "bool",
"!doc": "Default is false. If set, then it expects that all textures and colors need to be outputted in premultiplied gamma."
Expand Down
1 change: 1 addition & 0 deletions examples/js/misc/MD2Character.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ THREE.MD2Character = function () {
textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
textures[ i ].mapping = THREE.UVMapping;
textures[ i ].name = textureUrls[ i ];
textures[ i ].encoding = THREE.sRGBEncoding;

}

Expand Down
1 change: 1 addition & 0 deletions examples/js/misc/MD2CharacterComplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ THREE.MD2CharacterComplex = function () {
textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
textures[ i ].mapping = THREE.UVMapping;
textures[ i ].name = textureUrls[ i ];
textures[ i ].encoding = THREE.sRGBEncoding;

}

Expand Down
4 changes: 3 additions & 1 deletion examples/jsm/misc/MD2Character.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
MeshLambertMaterial,
Object3D,
TextureLoader,
UVMapping
UVMapping,
sRGBEncoding
} from "../../../build/three.module.js";
import { MD2Loader } from "../loaders/MD2Loader.js";

Expand Down Expand Up @@ -232,6 +233,7 @@ var MD2Character = function () {
textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
textures[ i ].mapping = UVMapping;
textures[ i ].name = textureUrls[ i ];
textures[ i ].encoding = sRGBEncoding;

}

Expand Down
4 changes: 3 additions & 1 deletion examples/jsm/misc/MD2CharacterComplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
MeshLambertMaterial,
Object3D,
TextureLoader,
UVMapping
UVMapping,
sRGBEncoding
} from "../../../build/three.module.js";
import { MD2Loader } from "../loaders/MD2Loader.js";
import { MorphBlendMesh } from "../misc/MorphBlendMesh.js";
Expand Down Expand Up @@ -527,6 +528,7 @@ var MD2CharacterComplex = function () {
textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
textures[ i ].mapping = UVMapping;
textures[ i ].name = textureUrls[ i ];
textures[ i ].encoding = sRGBEncoding;

}

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ NodeBuilder.prototype = {

getTextureEncodingFromMap: function ( map, gammaOverrideLinear ) {

gammaOverrideLinear = gammaOverrideLinear !== undefined ? gammaOverrideLinear : this.context.gamma && ( this.renderer ? this.renderer.gammaInput : false );
gammaOverrideLinear = gammaOverrideLinear !== undefined ? gammaOverrideLinear : this.context.gamma;

var encoding;

Expand All @@ -970,7 +970,7 @@ NodeBuilder.prototype = {

}

// add backwards compatibility for WebGLRenderer.gammaInput/gammaOutput parameter, should probably be removed at some point.
// add backwards compatibility for WebGLRenderer.gammaOutput parameter, should probably be removed at some point.
if ( encoding === LinearEncoding && gammaOverrideLinear ) {

encoding = GammaEncoding;
Expand Down
3 changes: 2 additions & 1 deletion examples/misc_exporter_collada.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( canvasWidth, canvasHeight );
renderer.gammaInput = true;
renderer.gammaOutput = true;
container.appendChild( renderer.domElement );

Expand All @@ -88,6 +87,7 @@
var textureMap = new THREE.TextureLoader().load( 'textures/uv_grid_opengl.jpg' );
textureMap.wrapS = textureMap.wrapT = THREE.RepeatWrapping;
textureMap.anisotropy = 16;
textureMap.encoding = THREE.sRGBEncoding;

// REFLECTION MAP
var path = "textures/cube/pisa/";
Expand All @@ -98,6 +98,7 @@
];

textureCube = new THREE.CubeTextureLoader().load( urls );
textureCube.encoding = THREE.sRGBEncoding;

// MATERIALS
var materialColor = new THREE.Color();
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_animation_cloth.html
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@
groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
groundTexture.repeat.set( 25, 25 );
groundTexture.anisotropy = 16;
groundTexture.encoding = THREE.sRGBEncoding;

var groundMaterial = new THREE.MeshLambertMaterial( { map: groundTexture } );

Expand Down Expand Up @@ -561,7 +562,6 @@

container.appendChild( renderer.domElement );

renderer.gammaInput = true;
renderer.gammaOutput = true;

renderer.shadowMap.enabled = true;
Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_buffergeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.gammaInput = true;
renderer.gammaOutput = true;

container.appendChild( renderer.domElement );
Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_buffergeometry_drawrange.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.gammaInput = true;
renderer.gammaOutput = true;

container.appendChild( renderer.domElement );
Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_buffergeometry_lines.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.gammaInput = true;
renderer.gammaOutput = true;

container.appendChild( renderer.domElement );
Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_buffergeometry_lines_indexed.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.gammaInput = true;
renderer.gammaOutput = true;

container.appendChild( renderer.domElement );
Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_buffergeometry_uint.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.gammaInput = true;
renderer.gammaOutput = true;

container.appendChild( renderer.domElement );
Expand Down
3 changes: 2 additions & 1 deletion examples/webgl_geometry_teapot.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( canvasWidth, canvasHeight );
renderer.gammaInput = true;
renderer.gammaOutput = true;
container.appendChild( renderer.domElement );

Expand All @@ -82,6 +81,7 @@
var textureMap = new THREE.TextureLoader().load( 'textures/uv_grid_opengl.jpg' );
textureMap.wrapS = textureMap.wrapT = THREE.RepeatWrapping;
textureMap.anisotropy = 16;
textureMap.encoding = THREE.sRGBEncoding;

// REFLECTION MAP
var path = "textures/cube/pisa/";
Expand All @@ -92,6 +92,7 @@
];

textureCube = new THREE.CubeTextureLoader().load( urls );
textureCube.encoding = THREE.sRGBEncoding;

// MATERIALS
var materialColor = new THREE.Color();
Expand Down
6 changes: 1 addition & 5 deletions examples/webgl_lensflares.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,8 @@
renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );

//

renderer.gammaInput = true;
renderer.gammaOutput = true;
container.appendChild( renderer.domElement );

//

Expand Down
3 changes: 1 addition & 2 deletions examples/webgl_lightningstrike.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.gammaInput = true;
renderer.gammaOutput = true;

container.appendChild( renderer.domElement );
Expand Down Expand Up @@ -419,6 +417,7 @@
var textureCube = new THREE.CubeTextureLoader().load( urls );
textureCube.format = THREE.RGBFormat;
textureCube.mapping = THREE.CubeReflectionMapping;
textureCube.encoding = THREE.sRGBEncoding;

var sphereMaterial = new THREE.MeshPhysicalMaterial( {
transparent: true,
Expand Down
3 changes: 0 additions & 3 deletions examples/webgl_lights_hemisphere.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );

renderer.gammaInput = true;
renderer.gammaOutput = true;

renderer.shadowMap.enabled = true;

// STATS
Expand Down
5 changes: 4 additions & 1 deletion examples/webgl_lights_physical.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
map.wrapT = THREE.RepeatWrapping;
map.anisotropy = 4;
map.repeat.set( 10, 24 );
map.encoding = THREE.sRGBEncoding;
floorMat.map = map;
floorMat.needsUpdate = true;

Expand Down Expand Up @@ -147,6 +148,7 @@
map.wrapT = THREE.RepeatWrapping;
map.anisotropy = 4;
map.repeat.set( 1, 1 );
map.encoding = THREE.sRGBEncoding;
cubeMat.map = map;
cubeMat.needsUpdate = true;

Expand All @@ -170,13 +172,15 @@
textureLoader.load( "textures/planets/earth_atmos_2048.jpg", function ( map ) {

map.anisotropy = 4;
map.encoding = THREE.sRGBEncoding;
ballMat.map = map;
ballMat.needsUpdate = true;

} );
textureLoader.load( "textures/planets/earth_specular_2048.jpg", function ( map ) {

map.anisotropy = 4;
map.encoding = THREE.sRGBEncoding;
ballMat.metalnessMap = map;
ballMat.needsUpdate = true;

Expand Down Expand Up @@ -214,7 +218,6 @@

renderer = new THREE.WebGLRenderer();
renderer.physicallyCorrectLights = true;
renderer.gammaInput = true;
renderer.gammaOutput = true;
renderer.shadowMap.enabled = true;
renderer.toneMapping = THREE.ReinhardToneMapping;
Expand Down
3 changes: 1 addition & 2 deletions examples/webgl_lights_pointlights2.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
texture.repeat.set( 20, 10 );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.format = THREE.RGBFormat;
texture.encoding = THREE.sRGBEncoding;

// MATERIALS

Expand Down Expand Up @@ -133,8 +134,6 @@
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );

renderer.gammaInput = true;
renderer.gammaOutput = true;

// CONTROLS
Expand Down
1 change: 0 additions & 1 deletion examples/webgl_lights_rectarealight.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.gammaInput = true;
renderer.gammaOutput = true;
document.body.appendChild( renderer.domElement );

Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_lights_spotlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
document.body.appendChild( renderer.domElement );
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;

renderer.gammaInput = true;
renderer.gammaOutput = true;

scene = new THREE.Scene();
Expand Down
2 changes: 0 additions & 2 deletions examples/webgl_lights_spotlights.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@

renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;

renderer.gammaInput = true;
renderer.gammaOutput = true;

camera.position.set( 46, 22, - 21 );
Expand Down
Loading

0 comments on commit b686968

Please sign in to comment.