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

Adding support for ReflectionMapping (Spherical) to CanvasRenderer. Not done yet...

上级 0f52ae5a
......@@ -60,6 +60,7 @@
<script type="text/javascript" src="../src/renderers/renderables/RenderableLine.js"></script>
<script type="text/javascript" src="../src/extras/primitives/Sphere.js"></script>
<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
<script type="text/javascript" src="js/Stats.js"></script>
......@@ -132,7 +133,7 @@
objects = [];
geometry = new Sphere( 100, 16, 8 );
material = new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 1/*, shading: THREE.FlatShading*/ } );
material = new THREE.MeshBasicMaterial( { env_map: ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg', THREE.ReflectionMapping ) } );
for ( var i = 0; i < 10; i ++ ) {
......
......@@ -461,7 +461,7 @@ THREE.CanvasRenderer = function () {
if ( material instanceof THREE.MeshBasicMaterial ) {
if ( material.map ) {
if ( material.map && material.map.loaded ) {
texturePath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, material.map.image, element.uvs[ 0 ].u, element.uvs[ 0 ].v, element.uvs[ 1 ].u, element.uvs[ 1 ].v, element.uvs[ 2 ].u, element.uvs[ 2 ].v );
......@@ -476,12 +476,11 @@ THREE.CanvasRenderer = function () {
}
/*
if ( material.env_map ) {
if ( material.env_map && material.env_map.loaded ) {
if ( material.env_map.mapping == THREE.ReflectionMapping ) {
texturePath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, material.env_map.image, element.vertexNormalsWorld[ 0 ].x * 0.5 + 0.5, element.vertexNormalsWorld[ 0 ].y * 0.5 + 0.5, element.vertexNormalsWorld[ 1 ].x * 0.5 + 0.5, element.vertexNormalsWorld[ 1 ].y * 0.5 + 0.5, element.vertexNormalsWorld[ 2 ].x * 0.5 + 0.5, element.vertexNormalsWorld[ 2 ].y * 0.5 + 0.5 );
} else if ( material.env_map.mapping == THREE.RefractionMapping ) {
......@@ -490,7 +489,6 @@ THREE.CanvasRenderer = function () {
}
}
*/
} else if ( material instanceof THREE.MeshLambertMaterial ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册