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
4 changes: 4 additions & 0 deletions docs/api/en/constants/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ <h2>Side</h2>
THREE.FrontSide
THREE.BackSide
THREE.DoubleSide
THREE.TwoPassDoubleSide
</code>
<p>
Defines which side of faces will be rendered - front, back or both.
Default is [page:Constant FrontSide].
</p>
<p>
[page:Materials TwoPassDoubleSide] will renderer double-sided transparent materials in two passes in back-front order to mitigate transparency artifacts.
</p>

<h2>Blending Mode</h2>
<code>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ <h3>[property:Integer side]</h3>
<p>
Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
Other options are [page:Materials THREE.BackSide], [page:Materials THREE.DoubleSide] or [page:Materials THREE.TwoPassDoubleSide].
</p>

<h3>[property:Boolean toneMapped]</h3>
Expand Down
4 changes: 4 additions & 0 deletions docs/api/fr/constants/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ <h2>Côté</h2>
THREE.FrontSide
THREE.BackSide
THREE.DoubleSide
THREE.TwoPassDoubleSide
</code>
<p>
Définit quel côté des faces sera rendu - avant, arrière ou les deux.
La valeur par défaut est [page:Constant FrontSide].
</p>
<p>
[page:Materials TwoPassDoubleSide] will renderer double-sided transparent materials in two passes in back-front order to mitigate transparency artifacts.
</p>

<h2>Mode de fusion</h2>
<code>
Expand Down
4 changes: 4 additions & 0 deletions docs/api/it/constants/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ <h2>Lato (Side)</h2>
THREE.FrontSide
THREE.BackSide
THREE.DoubleSide
THREE.TwoPassDoubleSide
</code>
<p>
Definisce quale lato delle facce sarà visualizzato - frontale, retro o entrambi.
Il valore predefinito è [page:Constant FrontSide].
</p>
<p>
[page:Materials TwoPassDoubleSide] will renderer double-sided transparent materials in two passes in back-front order to mitigate transparency artifacts.
</p>

<h2>Modalità Blending</h2>
<code>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/it/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h3>[property:Integer side]</h3>
<p>
Definisce quale lato delle facce sarà visualizzato - frontale, posteriore o entrambi.
Il valore predefinito è [page:Materials THREE.FrontSide].
Altre opzioni sono [page:Materials THREE.BackSide] e [page:Materials THREE.DoubleSide].
Altre opzioni sono [page:Materials THREE.BackSide], [page:Materials THREE.DoubleSide] e [page:Materials THREE.TwoPassDoubleSide].
</p>

<h3>[property:Boolean toneMapped]</h3>
Expand Down
1 change: 1 addition & 0 deletions docs/api/ko/constants/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h2>측면</h2>
THREE.FrontSide
THREE.BackSide
THREE.DoubleSide
THREE.TwoPassDoubleSide
</code>
<p>
어느 측면(앞,뒤 혹은 둘 다)이 렌더링 될 지 정의합니다.
Expand Down
4 changes: 4 additions & 0 deletions docs/api/pt-br/constants/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ <h2>Lado (Side)</h2>
THREE.FrontSide
THREE.BackSide
THREE.DoubleSide
THREE.TwoPassDoubleSide
</code>
<p>
Define qual lado das faces será renderizado - frente, verso ou ambos.
O padrão é [page:Constant FrontSide].
</p>
<p>
[page:Materials TwoPassDoubleSide] will renderer double-sided transparent materials in two passes in back-front order to mitigate transparency artifacts.
</p>

<h2>Modo de Mesclagem (Blending Mode)</h2>
<code>
Expand Down
4 changes: 4 additions & 0 deletions docs/api/zh/constants/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ <h2>面</h2>
THREE.FrontSide
THREE.BackSide
THREE.DoubleSide
THREE.TwoPassDoubleSide
</code>
<p>
定义了哪一边的面将会被渲染 —— 正面,或是反面,还是两个面都渲染。
默认值是[page:Constant FrontSide](只渲染正面)。
</p>
<p>
[page:Materials TwoPassDoubleSide] will renderer double-sided transparent materials in two passes in back-front order to mitigate transparency artifacts.
</p>

<h2>混合模式</h2>
<code>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h3>[property:Integer shadowSide]</h3>

<h3>[property:Integer side]</h3>
<p> 定义将要渲染哪一面 - 正面,背面或两者。
默认为[page:Materials THREE.FrontSide]。其他选项有[page:Materials THREE.BackSide][page:Materials THREE.DoubleSide]。
默认为[page:Materials THREE.FrontSide]。其他选项有[page:Materials THREE.BackSide], [page:Materials THREE.DoubleSide] 和 [page:Materials THREE.TwoPassDoubleSide]。
</p>

<h3>[property:Boolean toneMapped]</h3>
Expand Down
3 changes: 2 additions & 1 deletion editor/js/Sidebar.Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ function SidebarMaterial( editor ) {
const materialSideOptions = {
0: 'Front',
1: 'Back',
2: 'Double'
2: 'Double',
3: 'TwoPassDouble'
};

const materialSide = new SidebarMaterialConstantProperty( editor, 'side', strings.getKey( 'sidebar/material/side' ), materialSideOptions );
Expand Down
Binary file modified examples/screenshots/webgl_buffergeometry_instancing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const VSMShadowMap = 3;
export const FrontSide = 0;
export const BackSide = 1;
export const DoubleSide = 2;
export const TwoPassDoubleSide = 3;
export const NoBlending = 0;
export const NormalBlending = 1;
export const AdditiveBlending = 2;
Expand Down
4 changes: 2 additions & 2 deletions src/objects/Mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Ray } from '../math/Ray.js';
import { Matrix4 } from '../math/Matrix4.js';
import { Object3D } from '../core/Object3D.js';
import { Triangle } from '../math/Triangle.js';
import { DoubleSide, BackSide } from '../constants.js';
import { BackSide, FrontSide } from '../constants.js';
import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js';
import { BufferGeometry } from '../core/BufferGeometry.js';

Expand Down Expand Up @@ -276,7 +276,7 @@ function checkIntersection( object, material, raycaster, ray, pA, pB, pC, point

} else {

intersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point );
intersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );

}

Expand Down
10 changes: 5 additions & 5 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
REVISION,
BackSide,
DoubleSide,
TwoPassDoubleSide,
FrontSide,
RGBAFormat,
HalfFloatType,
Expand Down Expand Up @@ -828,7 +828,7 @@ function WebGLRenderer( parameters = {} ) {

function prepare( material, scene, object ) {

if ( material.transparent === true && material.side === DoubleSide ) {
if ( material.transparent === true && material.side === TwoPassDoubleSide ) {

material.side = BackSide;
material.needsUpdate = true;
Expand All @@ -838,7 +838,7 @@ function WebGLRenderer( parameters = {} ) {
material.needsUpdate = true;
getProgram( material, scene, object );

material.side = DoubleSide;
material.side = TwoPassDoubleSide;

} else {

Expand Down Expand Up @@ -1310,7 +1310,7 @@ function WebGLRenderer( parameters = {} ) {

material.onBeforeRender( _this, scene, camera, geometry, object, group );

if ( material.transparent === true && material.side === DoubleSide ) {
if ( material.transparent === true && material.side === TwoPassDoubleSide ) {

material.side = BackSide;
material.needsUpdate = true;
Expand All @@ -1320,7 +1320,7 @@ function WebGLRenderer( parameters = {} ) {
material.needsUpdate = true;
_this.renderBufferDirect( camera, scene, geometry, material, object, group );

material.side = DoubleSide;
material.side = TwoPassDoubleSide;

} else {

Expand Down