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

Removed SphericalRefractionMapping. See #5622.

上级 71d971f3
......@@ -21,8 +21,7 @@
THREE.UVMapping<br />
THREE.CubeReflectionMapping<br />
THREE.CubeRefractionMapping<br />
THREE.SphericalReflectionMapping<br />
THREE.SphericalRefractionMapping
THREE.SphericalReflectionMapping
</div>
<h2>Wrapping Modes</h2>
......
......@@ -58,7 +58,7 @@
<h3>[method:todo loadTexture]([page:String url], [page:UVMapping mapping], [page:Function onLoad], [page:Function onError])</h3>
<div>
url -- the url of the texture<br />
mapping -- Can be an instance of [page:UVMapping THREE.UVMapping], [page:CubeReflectionMapping THREE.CubeReflectionMapping], [page:SphericalReflectionMapping THREE.SphericalReflectionMapping] or [page:SphericalRefractionMapping THREE.SphericalRefractionMapping]. Describes how the image is applied to the object.<br />Use undefined instead of null as a default value. See mapping property of [page:Texture texture] for more details.
mapping -- Can be an instance of [page:UVMapping THREE.UVMapping], [page:CubeReflectionMapping THREE.CubeReflectionMapping] or [page:SphericalReflectionMapping THREE.SphericalReflectionMapping]. Describes how the image is applied to the object.<br />Use undefined instead of null as a default value. See mapping property of [page:Texture texture] for more details.
onLoad -- callback function<br />
onError -- callback function
</div>
......
......@@ -26,7 +26,7 @@
height -- The height of the biggest mipmap <br />
format -- The format used in the mipmaps <br />
type -- The type used in the mipmaps <br />
mapping -- How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; THREE.SphericalReflectionMapping, a spherical reflection map projection; and THREE.SphericalRefractionMapping.<br />
mapping -- How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texels.<br />
......
......@@ -26,7 +26,7 @@
height -- The height of the image. <br />
format -- The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.<br />
type -- The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.<br />
mapping -- How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; THREE.SphericalReflectionMapping, a spherical reflection map projection; and THREE.SphericalRefractionMapping.<br />
mapping -- How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.<br />
......
......@@ -40,7 +40,7 @@
<h3>[property:object mapping]</h3>
<div>
How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; THREE.SphericalReflectionMapping, a spherical reflection map projection; and THREE.SphericalRefractionMapping.
How the image is applied to the object. An object type of THREE.UVMapping() is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.
</div>
<h3>[property:number wrapS]</h3>
......
......@@ -76,8 +76,7 @@
new THREE.MeshDepthMaterial( { overdraw: 0.5 } ),
new THREE.MeshNormalMaterial( { overdraw: 0.5 } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ) } ),
new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/envmap.png', THREE.SphericalReflectionMapping ), overdraw: 0.5 } ),
new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/envmap.png', THREE.SphericalRefractionMapping ), overdraw: 0.5 } )
new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/envmap.png', THREE.SphericalReflectionMapping ), overdraw: 0.5 } )
];
......
......@@ -728,25 +728,8 @@ THREE.CanvasRenderer = function ( parameters ) {
patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, material.envMap );
} else if ( mapping === THREE.SphericalRefractionMapping ) {
_normal.copy( element.vertexNormalsModel[ uv1 ] ).applyMatrix3( _normalViewMatrix );
_uv1x = - 0.5 * _normal.x + 0.5;
_uv1y = - 0.5 * _normal.y + 0.5;
_normal.copy( element.vertexNormalsModel[ uv2 ] ).applyMatrix3( _normalViewMatrix );
_uv2x = - 0.5 * _normal.x + 0.5;
_uv2y = - 0.5 * _normal.y + 0.5;
_normal.copy( element.vertexNormalsModel[ uv3 ] ).applyMatrix3( _normalViewMatrix );
_uv3x = - 0.5 * _normal.x + 0.5;
_uv3y = - 0.5 * _normal.y + 0.5;
patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, material.envMap );
}
} else {
_color.copy( material.color );
......
......@@ -72,11 +72,9 @@
if ( refract ) {
textureEquirec.mapping = THREE.EquirectangularRefractionMapping;
textureCube.mapping = THREE.CubeRefractionMapping;
textureSphere.mapping = THREE.SphericalRefractionMapping;
} else {
textureEquirec.mapping = THREE.EquirectangularReflectionMapping;
textureCube.mapping = THREE.CubeReflectionMapping;
textureSphere.mapping = THREE.SphericalReflectionMapping;
}
sphereMaterial.needsUpdate = true;
}
......
......@@ -120,11 +120,10 @@ THREE.UVMapping = 300;
THREE.CubeReflectionMapping = 301;
THREE.CubeRefractionMapping = 302;
THREE.SphericalReflectionMapping = 303;
THREE.SphericalRefractionMapping = 304;
THREE.EquirectangularReflectionMapping = 303;
THREE.EquirectangularRefractionMapping = 304;
THREE.EquirectangularReflectionMapping = 305;
THREE.EquirectangularRefractionMapping = 306;
THREE.SphericalReflectionMapping = 305;
// Wrapping modes
......
......@@ -4786,7 +4786,6 @@ THREE.WebGLRenderer = function ( parameters ) {
uniforms.combine.value = material.combine;
uniforms.useRefract.value = material.envMap && (
material.envMap.mapping === THREE.CubeRefractionMapping ||
material.envMap.mapping === THREE.SphericalRefractionMapping ||
material.envMap.mapping === THREE.EquirectangularRefractionMapping );
}
......
......@@ -85,21 +85,27 @@ THREE.WebGLProgram = ( function () {
}
var envMapTypeDefine = null;
if ( parameters.envMap ) {
switch ( material.envMap.mapping ) {
case THREE.CubeReflectionMapping:
case THREE.CubeRefractionMapping:
envMapTypeDefine = "ENVMAP_TYPE_CUBE";
break;
case THREE.SphericalReflectionMapping:
case THREE.SphericalRefractionMapping:
envMapTypeDefine = "ENVMAP_TYPE_SPHERE";
break;
case THREE.EquirectangularReflectionMapping:
case THREE.EquirectangularRefractionMapping:
envMapTypeDefine = "ENVMAP_TYPE_EQUIREC";
break;
case THREE.SphericalReflectionMapping:
envMapTypeDefine = "ENVMAP_TYPE_SPHERE";
break;
}
}
// console.log( "building new program " );
......
......@@ -151,8 +151,7 @@ def _mapping(index):
types = (constants.MAPPING_TYPES.UV,
constants.MAPPING_TYPES.CUBE_REFLECTION,
constants.MAPPING_TYPES.CUBE_REFRACTION,
constants.MAPPING_TYPES.SPHERICAL_REFLECTION,
constants.MAPPING_TYPES.SPHERICAL_REFRACTION)
constants.MAPPING_TYPES.SPHERICAL_REFLECTION)
return (types[index], types[index], types[index])
bpy.types.Texture.THREE_mapping = EnumProperty(
......
......@@ -29,8 +29,7 @@ MAPPING_TYPES = type('Mapping', (), {
'UV': 'UVMapping',
'CUBE_REFLECTION': 'CubeReflectionMapping',
'CUBE_REFRACTION': 'CubeRefractionMapping',
'SPHERICAL_REFLECTION': 'SphericalReflectionMapping',
'SPHERICAL_REFRACTION': 'SphericalRefractionMapping'
'SPHERICAL_REFLECTION': 'SphericalReflectionMapping'
})
JSON = 'json'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册