molstar
Version:
A comprehensive macromolecular library.
26 lines • 2.07 kB
JavaScript
/**
* Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextureMeshRenderable = exports.TextureMeshSchema = void 0;
var tslib_1 = require("tslib");
var renderable_1 = require("../renderable");
var render_item_1 = require("../webgl/render-item");
var schema_1 = require("./schema");
var shader_code_1 = require("../shader-code");
var mol_util_1 = require("../../mol-util");
exports.TextureMeshSchema = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, schema_1.BaseSchema), { uGeoTexDim: (0, schema_1.UniformSpec)('v2', 'buffered'), tPosition: (0, schema_1.TextureSpec)('texture', 'rgb', 'float', 'nearest'), tGroup: (0, schema_1.TextureSpec)('texture', 'alpha', 'float', 'nearest'), tNormal: (0, schema_1.TextureSpec)('texture', 'rgb', 'float', 'nearest'), dFlatShaded: (0, schema_1.DefineSpec)('boolean'), dDoubleSided: (0, schema_1.DefineSpec)('boolean'), dFlipSided: (0, schema_1.DefineSpec)('boolean'), dIgnoreLight: (0, schema_1.DefineSpec)('boolean'), dXrayShaded: (0, schema_1.DefineSpec)('boolean'), dGeoTexture: (0, schema_1.DefineSpec)('boolean') });
function TextureMeshRenderable(ctx, id, values, state, materialId) {
var schema = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, schema_1.GlobalUniformSchema), schema_1.GlobalTextureSchema), schema_1.InternalSchema), exports.TextureMeshSchema);
var internalValues = {
uObjectId: mol_util_1.ValueCell.create(id),
};
var shaderCode = shader_code_1.MeshShaderCode;
var renderItem = (0, render_item_1.createGraphicsRenderItem)(ctx, 'triangles', shaderCode, schema, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, values), internalValues), materialId);
return (0, renderable_1.createRenderable)(renderItem, values, state);
}
exports.TextureMeshRenderable = TextureMeshRenderable;
//# sourceMappingURL=texture-mesh.js.map
;