0

i have PlaneGeometry square and same square exported from Blender under point light, and PlangeGeometry behaves strange - when point light gets real close to center of square the square gets darker. This is not happening with model square.

this is my geometry material setting:

var map = THREE.ImageUtils.loadTexture( "dirt.png");
map.wrapS = map.wrapT = THREE.RepeatWrapping;
map.anisotropy = 16;
var material = new THREE.MeshLambertMaterial( { ambient: 0xbbbbbb, map: map, side: THREE.DoubleSide } );
var object = new THREE.Mesh( new THREE.PlaneGeometry( SQUARE_SIZE, SQUARE_SIZE, 1, 1 ), material );

this is my imported model js excerpt:

"materials" : [ {
    "DbgColor" : 15658734,
    "DbgIndex" : 0,
    "DbgName" : "dirt",
    "blending" : "NormalBlending",
    "colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
    "colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
    "colorSpecular" : [0.5, 0.5, 0.5],
    "depthTest" : true,
    "depthWrite" : true,
    "mapDiffuse" : "dirt.png",
    "mapDiffuseWrap" : ["repeat", "repeat"],
    "shading" : "Lambert",
    "specularCoef" : 50,
    "transparency" : 1.0,
    "transparent" : false,
    "vertexColors" : false
}],

Can i make Plane geometry work like imported model?

pera
  • 882
  • 11
  • 21

1 Answers1

0

The reason this is happening is explained here: Three.js: What Is The Exact Difference Between Lambert and Phong?.

You have two choices:

  1. use MeshPhongMaterial instead, or
  2. increase the tessellation of your geometry like so:

    new THREE.PlaneGeometry( SQUARE_SIZE, SQUARE_SIZE, 10, 10 );

The first option is the better one.

three.js r.66

Community
  • 1
  • 1
WestLangley
  • 102,557
  • 10
  • 276
  • 276