Skip to content
Open
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
1 change: 0 additions & 1 deletion examples/jsm/effects/OutlineEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class OutlineEffect {
' #include <tonemapping_fragment>',
' #include <colorspace_fragment>',
' #include <fog_fragment>',
' #include <premultiplied_alpha_fragment>',

'}'

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/lines/LineMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ ShaderLib[ 'line' ] = {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}
`
Expand Down
1 change: 0 additions & 1 deletion examples/jsm/materials/LDrawConditionalLineMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class LDrawConditionalLineMaterial extends ShaderMaterial {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}
`,

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/materials/MeshGouraudMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ const GouraudShader = {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}`
Expand Down
Binary file modified examples/screenshots/webgl_loader_ldraw.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_materials_blending.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion examples/webgl_watch.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
metalness: 0, roughness: 0,
iridescence: 0.3,
clearcoat: 1.0,
blending: THREE.AdditiveBlending
blending: THREE.AdditiveBlending,
premultipliedAlpha: true
} );

ready = true;
Expand Down
1 change: 0 additions & 1 deletion manual/en/indexed-textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ <h1>Indexed Textures for Picking and Color</h1>
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include &lt;envmap_fragment&gt;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include &lt;premultiplied_alpha_fragment&gt;
#include &lt;tonemapping_fragment&gt;
#include &lt;colorspace_fragment&gt;
#include &lt;fog_fragment&gt;
Expand Down
1 change: 0 additions & 1 deletion manual/fr/indexed-textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ <h1>Textures Indexées pour la Sélection et la Couleur</h1>
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include &lt;envmap_fragment&gt;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include &lt;premultiplied_alpha_fragment&gt;
#include &lt;tonemapping_fragment&gt;
#include &lt;colorspace_fragment&gt;
#include &lt;fog_fragment&gt;
Expand Down
1 change: 0 additions & 1 deletion manual/ja/indexed-textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ <h1>圧縮テクスチャのピッキングとカラー</h1>
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include &lt;envmap_fragment&gt;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include &lt;premultiplied_alpha_fragment&gt;
#include &lt;tonemapping_fragment&gt;
#include &lt;colorspace_fragment&gt;
#include &lt;fog_fragment&gt;
Expand Down
1 change: 0 additions & 1 deletion manual/ko/indexed-textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ <h1>피킹과 색상에 인덱스 텍스처 사용하기</h1>
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include &lt;envmap_fragment&gt;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include &lt;premultiplied_alpha_fragment&gt;
#include &lt;tonemapping_fragment&gt;
#include &lt;colorspace_fragment&gt;
#include &lt;fog_fragment&gt;
Expand Down
1 change: 0 additions & 1 deletion manual/zh/indexed-textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ <h1>使用纹理索引来拾取和着色</h1>
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include &lt;envmap_fragment&gt;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include &lt;premultiplied_alpha_fragment&gt;
#include &lt;tonemapping_fragment&gt;
#include &lt;colorspace_fragment&gt;
#include &lt;fog_fragment&gt;
Expand Down
12 changes: 12 additions & 0 deletions src/renderers/shaders/ShaderChunk/opaque_fragment.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,17 @@ diffuseColor.a = 1.0;
diffuseColor.a *= material.transmissionAlpha;
#endif
#ifdef PREMULTIPLIED_ALPHA
// Convert to sRGB, apply premultiplied alpha, convert back to linear.
// This ensures correct blending in sRGB framebuffers.
vec3 srgb = sRGBTransferOETF( vec4( outgoingLight, 1.0 ) ).rgb;
srgb *= diffuseColor.a;
gl_FragColor = vec4( sRGBTransferEOTF( vec4( srgb, 1.0 ) ).rgb, diffuseColor.a );
#else
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#endif
`;
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/linedashed.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>

}
`;
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/meshbasic.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}
Expand Down
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/meshlambert.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}
Expand Down
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/meshmatcap.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}
Expand Down
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/meshphong.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}
Expand Down
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/meshphysical.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}
Expand Down
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/meshtoon.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>

}
Expand Down
1 change: 0 additions & 1 deletion src/renderers/shaders/ShaderLib/points.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>

}
`;