UNPKG

wonder.js

Version:
31 lines (27 loc) 2.1 kB
'use strict'; var IndexAllSourceTextureService$Wonderjs = require("../../../../record/all/texture/source/IndexAllSourceTextureService.js"); var IndexSourceTextureRenderService$Wonderjs = require("../../texture/source/IndexSourceTextureRenderService.js"); var MapUnitLightMaterialRenderService$Wonderjs = require("./MapUnitLightMaterialRenderService.js"); var BindAndUpdateMapMaterialRenderService$Wonderjs = require("../BindAndUpdateMapMaterialRenderService.js"); var OperateTypeArrayAllLightMaterialService$Wonderjs = require("../../../../record/all/material/light/OperateTypeArrayAllLightMaterialService.js"); function bindAndUpdate(gl, material, state) { var lightMaterialRecord = state[/* lightMaterialRecord */8]; var diffuseTextureIndex = OperateTypeArrayAllLightMaterialService$Wonderjs.getTextureIndex(material, lightMaterialRecord[/* diffuseTextureIndices */6]); var specularTextureIndex = OperateTypeArrayAllLightMaterialService$Wonderjs.getTextureIndex(material, lightMaterialRecord[/* specularTextureIndices */7]); var arrayBufferViewSourceTextureIndexOffset = IndexSourceTextureRenderService$Wonderjs.getArrayBufferViewSourceTextureIndexOffset(state); return BindAndUpdateMapMaterialRenderService$Wonderjs.bindAndUpdate(/* tuple */[ gl, material ], /* tuple */[ specularTextureIndex, IndexAllSourceTextureService$Wonderjs.getSourceTextureType(specularTextureIndex, arrayBufferViewSourceTextureIndexOffset) ], MapUnitLightMaterialRenderService$Wonderjs.setSpecularMapUnit, BindAndUpdateMapMaterialRenderService$Wonderjs.bindAndUpdate(/* tuple */[ gl, material ], /* tuple */[ diffuseTextureIndex, IndexAllSourceTextureService$Wonderjs.getSourceTextureType(diffuseTextureIndex, arrayBufferViewSourceTextureIndexOffset) ], MapUnitLightMaterialRenderService$Wonderjs.setDiffuseMapUnit, state)); } exports.bindAndUpdate = bindAndUpdate; /* IndexAllSourceTextureService-Wonderjs Not a pure module */