提交 4361a31b 编写于 作者: M Mr.doob

Revert "WebGLRenderer: Ignore map alpha in opaque materials."

This reverts commit 84c16ed8.
上级 d2c57142
......@@ -84,7 +84,6 @@ import skinning_vertex from './ShaderChunk/skinning_vertex.glsl.js';
import skinnormal_vertex from './ShaderChunk/skinnormal_vertex.glsl.js';
import specularmap_fragment from './ShaderChunk/specularmap_fragment.glsl.js';
import specularmap_pars_fragment from './ShaderChunk/specularmap_pars_fragment.glsl.js';
import transparent_fragment from './ShaderChunk/transparent_fragment.glsl.js';
import tonemapping_fragment from './ShaderChunk/tonemapping_fragment.glsl.js';
import tonemapping_pars_fragment from './ShaderChunk/tonemapping_pars_fragment.glsl.js';
import uv_pars_fragment from './ShaderChunk/uv_pars_fragment.glsl.js';
......@@ -215,7 +214,6 @@ export var ShaderChunk = {
skinnormal_vertex: skinnormal_vertex,
specularmap_fragment: specularmap_fragment,
specularmap_pars_fragment: specularmap_pars_fragment,
transparent_fragment: transparent_fragment,
tonemapping_fragment: tonemapping_fragment,
tonemapping_pars_fragment: tonemapping_pars_fragment,
uv_pars_fragment: uv_pars_fragment,
......
......@@ -2,6 +2,7 @@ export default /* glsl */`
#ifdef ALPHATEST
if ( diffuseColor.a < ALPHATEST ) discard;
diffuseColor.a = 1.0;
#endif
`;
export default /* glsl */`
#ifndef TRANSPARENT
diffuseColor.a = 1.0;
#endif
`;
......@@ -35,14 +35,13 @@ void main() {
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
#include <specularmap_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
// accumulation (baked indirect lighting only)
#ifdef USE_LIGHTMAP
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
......
......@@ -48,7 +48,6 @@ void main() {
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
#include <specularmap_fragment>
#include <emissivemap_fragment>
......
......@@ -34,7 +34,6 @@ void main() {
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
......
......@@ -45,7 +45,6 @@ void main() {
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
......
......@@ -85,7 +85,6 @@ void main() {
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
#include <roughnessmap_fragment>
#include <metalnessmap_fragment>
#include <normal_fragment_begin>
......
......@@ -43,7 +43,6 @@ void main() {
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
......
......@@ -20,7 +20,6 @@ void main() {
#include <map_particle_fragment>
#include <color_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
outgoingLight = diffuseColor.rgb;
......
......@@ -21,7 +21,6 @@ void main() {
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <transparent_fragment>
outgoingLight = diffuseColor.rgb;
......
......@@ -623,7 +623,6 @@ function WebGLProgram( renderer, cacheKey, parameters ) {
( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '',
parameters.dithering ? '#define DITHERING' : '',
parameters.transparent ? '#define TRANSPARENT' : '',
( parameters.outputEncoding || parameters.mapEncoding || parameters.matcapEncoding || parameters.envMapEncoding || parameters.emissiveMapEncoding || parameters.lightMapEncoding ) ?
ShaderChunk[ 'encodings_pars_fragment' ] : '', // this code is required here because it is used by the various encoding/decoding function defined below
......
......@@ -49,7 +49,7 @@ function WebGLPrograms( renderer, extensions, capabilities ) {
"numDirLightShadows", "numPointLightShadows", "numSpotLightShadows",
"shadowMapEnabled", "shadowMapType", "toneMapping", 'physicallyCorrectLights',
"alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking", "dithering",
"sheen", "transparent"
"sheen"
];
function getShaderObject( material, shaderID ) {
......@@ -260,7 +260,6 @@ function WebGLPrograms( renderer, extensions, capabilities ) {
numClipIntersection: nClipIntersection,
dithering: material.dithering,
transparent: material.transparent,
shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,
shadowMapType: renderer.shadowMap.type,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册