提交 878dca08 编写于 作者: S sunag

fix normal doubleSided

上级 a1be22fa
...@@ -45,7 +45,7 @@ NormalNode.prototype.generate = function ( builder, output ) { ...@@ -45,7 +45,7 @@ NormalNode.prototype.generate = function ( builder, output ) {
builder.requires.normal = true; builder.requires.normal = true;
result = builder.isShader( 'vertex' ) ? 'normal' : 'vObjectNormal'; result = 'normal';
break; break;
...@@ -59,7 +59,7 @@ NormalNode.prototype.generate = function ( builder, output ) { ...@@ -59,7 +59,7 @@ NormalNode.prototype.generate = function ( builder, output ) {
case NormalNode.VIEW: case NormalNode.VIEW:
result = 'normal'; result = 'vNormal';
break; break;
......
...@@ -114,7 +114,7 @@ BumpMapNode.prototype.generate = function ( builder, output ) { ...@@ -114,7 +114,7 @@ BumpMapNode.prototype.generate = function ( builder, output ) {
var derivativeHeight = builder.include( BumpMapNode.Nodes.dHdxy_fwd ), var derivativeHeight = builder.include( BumpMapNode.Nodes.dHdxy_fwd ),
perturbNormalArb = builder.include( BumpMapNode.Nodes.perturbNormalArb ); perturbNormalArb = builder.include( BumpMapNode.Nodes.perturbNormalArb );
this.normal = this.normal || new NormalNode( NormalNode.VIEW ); this.normal = this.normal || new NormalNode();
this.position = this.position || new PositionNode( PositionNode.VIEW ); this.position = this.position || new PositionNode( PositionNode.VIEW );
var derivativeHeightCode = derivativeHeight + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' + var derivativeHeightCode = derivativeHeight + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' +
......
...@@ -68,7 +68,7 @@ NormalMapNode.prototype.generate = function ( builder, output ) { ...@@ -68,7 +68,7 @@ NormalMapNode.prototype.generate = function ( builder, output ) {
var perturbNormal2Arb = builder.include( NormalMapNode.Nodes.perturbNormal2Arb ); var perturbNormal2Arb = builder.include( NormalMapNode.Nodes.perturbNormal2Arb );
this.normal = this.normal || new NormalNode( NormalNode.VIEW ); this.normal = this.normal || new NormalNode();
this.position = this.position || new PositionNode( PositionNode.VIEW ); this.position = this.position || new PositionNode( PositionNode.VIEW );
this.uv = this.uv || new UVNode(); this.uv = this.uv || new UVNode();
......
...@@ -764,7 +764,7 @@ ...@@ -764,7 +764,7 @@
var color = new THREE.ColorNode( 0xFFFFFF ); var color = new THREE.ColorNode( 0xFFFFFF );
var viewZ = new THREE.Math2Node( var viewZ = new THREE.Math2Node(
new THREE.NormalNode( THREE.NormalNode.VIEW ), new THREE.NormalNode(),
new THREE.Vector3Node( 0, 0, - intensity ), new THREE.Vector3Node( 0, 0, - intensity ),
THREE.Math2Node.DOT THREE.Math2Node.DOT
); );
...@@ -1045,7 +1045,7 @@ ...@@ -1045,7 +1045,7 @@
var color = new THREE.CubeTextureNode( cubemap ); var color = new THREE.CubeTextureNode( cubemap );
var viewZ = new THREE.Math2Node( var viewZ = new THREE.Math2Node(
new THREE.NormalNode( THREE.NormalNode.VIEW ), new THREE.NormalNode(),
new THREE.Vector3Node( 0, 0, - 1 ), new THREE.Vector3Node( 0, 0, - 1 ),
THREE.Math2Node.DOT THREE.Math2Node.DOT
); );
...@@ -1690,7 +1690,7 @@ ...@@ -1690,7 +1690,7 @@
var fur = new THREE.FloatNode( .5 ); var fur = new THREE.FloatNode( .5 );
var posDirection = new THREE.Math1Node( new THREE.PositionNode( THREE.PositionNode.VIEW ), THREE.Math1Node.NORMALIZE ); var posDirection = new THREE.Math1Node( new THREE.PositionNode( THREE.PositionNode.VIEW ), THREE.Math1Node.NORMALIZE );
var norDirection = new THREE.Math1Node( new THREE.NormalNode( THREE.NormalNode.VIEW ), THREE.Math1Node.NORMALIZE ); var norDirection = new THREE.Math1Node( new THREE.NormalNode(), THREE.Math1Node.NORMALIZE );
var viewZ = new THREE.Math2Node( var viewZ = new THREE.Math2Node(
posDirection, posDirection,
...@@ -1874,7 +1874,7 @@ ...@@ -1874,7 +1874,7 @@
// LINE // LINE
var posDirection = new THREE.Math1Node( new THREE.PositionNode( THREE.PositionNode.VIEW ), THREE.Math1Node.NORMALIZE ); var posDirection = new THREE.Math1Node( new THREE.PositionNode( THREE.PositionNode.VIEW ), THREE.Math1Node.NORMALIZE );
var norDirection = new THREE.Math1Node( new THREE.NormalNode( THREE.NormalNode.VIEW ), THREE.Math1Node.NORMALIZE ); var norDirection = new THREE.Math1Node( new THREE.NormalNode(), THREE.Math1Node.NORMALIZE );
var viewZ = new THREE.Math2Node( var viewZ = new THREE.Math2Node(
posDirection, posDirection,
...@@ -2534,6 +2534,9 @@ ...@@ -2534,6 +2534,9 @@
} }
// set material // set material
mtl.side = THREE.DoubleSide;
mesh.material = mtl; mesh.material = mtl;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册