Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions docs/api/en/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ <h3>[property:Float opacity]</h3>
Default is *1.0*.
</p>

<h3>[property:Float overdraw]</h3>
<p>
Amount of triangle expansion at draw time.
This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer].
*0.5* tends to give good results across browsers. Default is *0*.
</p>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think 'we' should do that. That is the responsibility of the maintainers of those docs.

<h3>[property:Boolean polygonOffset]</h3>
<p>
Whether to use polygon offset. Default is *false*. This corresponds to the *GL_POLYGON_OFFSET_FILL* WebGL feature.
Expand Down
1 change: 0 additions & 1 deletion docs/scenes/js/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ function guiMaterial( gui, mesh, material, geometry ) {
// folder.add( material, 'polygonOffsetFactor' );
// folder.add( material, 'polygonOffsetUnits' );
folder.add( material, 'alphaTest', 0, 1 );
// folder.add( material, 'overdraw', 0, 5 );
folder.add( material, 'visible' );
folder.add( material, 'side', constants.side ).onChange( needsUpdate( material, geometry ) );

Expand Down
2 changes: 1 addition & 1 deletion examples/misc_lights_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
// Spheres

geometry = new THREE.SphereBufferGeometry( 100, 16, 8 );
material = new THREE.MeshPhongMaterial( { color: 0xffffff, flatShading: true, overdraw: 0.5, shininess: 0 } );
material = new THREE.MeshPhongMaterial( { color: 0xffffff, flatShading: true, shininess: 0 } );

for ( var i = 0; i < 30; i ++ ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/misc_ubiquity_test2.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
texture.wrapT = THREE.RepeatWrapping;

var geometry = new THREE.BoxBufferGeometry( 150, 150, 150, 4, 4, 4 );
var material = new THREE.MeshBasicMaterial( { map: texture, overdraw: 0.5 } );
var material = new THREE.MeshBasicMaterial( { map: texture } );

mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
Expand Down
4 changes: 2 additions & 2 deletions examples/software_geometry_earth.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

var geometry = new THREE.SphereBufferGeometry( 200, 20, 20 );

var material = new THREE.MeshLambertMaterial( { map: texture, overdraw: 0.5 } );
var material = new THREE.MeshLambertMaterial( { map: texture } );
var mesh = new THREE.Mesh( geometry, material );
group.add( mesh );

Expand Down Expand Up @@ -103,7 +103,7 @@
var texture = new THREE.CanvasTexture( canvas );

var geometry = new THREE.PlaneBufferGeometry( 300, 300, 3, 3 );
var material = new THREE.MeshBasicMaterial( { map: texture, overdraw: 0.5 } );
var material = new THREE.MeshBasicMaterial( { map: texture } );

var mesh = new THREE.Mesh( geometry, material );
mesh.position.y = - 250;
Expand Down
2 changes: 1 addition & 1 deletion examples/software_sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
// Cube with texture
var loader = new THREE.TextureLoader();
var map = loader.load( 'textures/brick_diffuse.jpg' );
texCube = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { map: map, overdraw: 0.5 } ) );
texCube = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { map: map } ) );
texCube.position.set( - 300, 0, 0 );
scene.add( texCube );

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_effects_peppersghost.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );

var material = new THREE.MeshBasicMaterial( { vertexColors: THREE.VertexColors, overdraw: 0.5 } );
var material = new THREE.MeshBasicMaterial( { vertexColors: THREE.VertexColors } );

for ( var i = 0; i < 10; i ++ ) {

Expand Down
14 changes: 14 additions & 0 deletions src/Three.Legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,20 @@ Object.defineProperties( Material.prototype, {

}
},

overdraw: {
get: function () {

console.warn( 'THREE.Material: .overdraw has been removed.' );

},
set: function () {

console.warn( 'THREE.Material: .overdraw has been removed.' );

}
},

wrapRGB: {
get: function () {

Expand Down
9 changes: 0 additions & 9 deletions src/materials/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ function Material() {
this.alphaTest = 0;
this.premultipliedAlpha = false;

this.overdraw = 0; // Overdrawn pixels (typically between 0 and 1) for fixing antialiasing gaps in CanvasRenderer

this.visible = true;

this.userData = {};
Expand Down Expand Up @@ -118,11 +116,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

currentValue.copy( newValue );

} else if ( key === 'overdraw' ) {

// ensure overdraw is backwards-compatible with legacy boolean type
this[ key ] = Number( newValue );

} else {

this[ key ] = newValue;
Expand Down Expand Up @@ -349,8 +342,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
this.alphaTest = source.alphaTest;
this.premultipliedAlpha = source.premultipliedAlpha;

this.overdraw = source.overdraw;

this.visible = source.visible;
this.userData = JSON.parse( JSON.stringify( source.userData ) );

Expand Down