一:渲染状态
RenderState负责渲染状态,构造函数如下
function RenderState(renderState) {
const rs = defaultValue(renderState, defaultValue.EMPTY_OBJECT);
const cull = defaultValue(rs.cull, defaultValue.EMPTY_OBJECT);
const polygonOffset = defaultValue(
rs.polygonOffset,
defaultValue.EMPTY_OBJECT
);
const scissorTest = defaultValue(rs.scissorTest, defaultValue.EMPTY_OBJECT);
const scissorTestRectangle = defaultValue(
scissorTest.rectangle,
defaultValue.EMPTY_OBJECT
);
const depthRange = defaultValue(rs.depthRange, defaultValue.EMPTY_OBJECT);
const depthTest = defaultValue(rs.depthTest, defaultValue.EMPTY_OBJECT);
const colorMask = defaultValue(rs.colorMask, defaultValue.EMPTY_OBJECT);
const blending = defaultValue(rs.blending, defaultValue.EMPTY_OBJECT);
const blendingColor = defaultV