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

WebGLRenderer: Allow precision per material. Fixes #6378.

上级 bc815c1d
......@@ -32,6 +32,8 @@ THREE.Material = function () {
this.colorWrite = true;
this.precision = null; // override the renderer's default precision for this material
this.polygonOffset = false;
this.polygonOffsetFactor = 0;
this.polygonOffsetUnits = 0;
......@@ -196,6 +198,8 @@ THREE.Material.prototype = {
this.depthTest = source.depthTest;
this.depthWrite = source.depthWrite;
this.precision = source.precision;
this.polygonOffset = source.polygonOffset;
this.polygonOffsetFactor = source.polygonOffsetFactor;
this.polygonOffsetUnits = source.polygonOffsetUnits;
......
......@@ -1882,10 +1882,23 @@ THREE.WebGLRenderer = function ( parameters ) {
var maxLightCount = allocateLights( lights );
var maxShadows = allocateShadows( lights );
var maxBones = allocateBones( object );
var precision = _precision;
if ( material.precision !== null ) {
precision = state.getMaxPrecision( material.precision );
if ( precision !== material.precision ) {
console.warn( 'THREE.WebGLRenderer.initMaterial:', material.precision, 'not supported, using', precision, 'instead.' );
}
}
var parameters = {
precision: _precision,
precision: precision,
supportsVertexTextures: _supportsVertexTextures,
map: !! material.map,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册