Skip to content
Snippets Groups Projects
Commit 7753a6ec authored by Alexander Rose's avatar Alexander Rose
Browse files

renderable schema cleanup

- use base schema in direct-volume schema
parent b8aafa1d
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util'; ...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util';
export const CylindersSchema = { export const CylindersSchema = {
...BaseSchema, ...BaseSchema,
...SizeSchema, ...SizeSchema,
aGroup: AttributeSpec('float32', 1, 0),
aStart: AttributeSpec('float32', 3, 0), aStart: AttributeSpec('float32', 3, 0),
aEnd: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0),
aMapping: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 3, 0),
......
...@@ -7,59 +7,20 @@ ...@@ -7,59 +7,20 @@
import { Renderable, RenderableState, createRenderable } from '../renderable'; import { Renderable, RenderableState, createRenderable } from '../renderable';
import { WebGLContext } from '../webgl/context'; import { WebGLContext } from '../webgl/context';
import { createGraphicsRenderItem } from '../webgl/render-item'; import { createGraphicsRenderItem } from '../webgl/render-item';
import { AttributeSpec, Values, UniformSpec, GlobalUniformSchema, InternalSchema, TextureSpec, ValueSpec, ElementsSpec, DefineSpec, InternalValues, GlobalTextureSchema } from './schema'; import { AttributeSpec, Values, UniformSpec, GlobalUniformSchema, InternalSchema, TextureSpec, ElementsSpec, DefineSpec, InternalValues, GlobalTextureSchema, BaseSchema } from './schema';
import { DirectVolumeShaderCode } from '../shader-code'; import { DirectVolumeShaderCode } from '../shader-code';
import { ValueCell } from '../../mol-util'; import { ValueCell } from '../../mol-util';
export const DirectVolumeSchema = { export const DirectVolumeSchema = {
uColor: UniformSpec('v3'), ...BaseSchema,
uColorTexDim: UniformSpec('v2'),
tColor: TextureSpec('image-uint8', 'rgb', 'ubyte', 'nearest'),
dColorType: DefineSpec('string', ['uniform', 'attribute', 'instance', 'group', 'groupInstance', 'vertex', 'vertexInstance']),
uMarkerTexDim: UniformSpec('v2'),
tMarker: TextureSpec('image-uint8', 'alpha', 'ubyte', 'nearest'),
uOverpaintTexDim: UniformSpec('v2'),
tOverpaint: TextureSpec('image-uint8', 'rgba', 'ubyte', 'nearest'),
dOverpaint: DefineSpec('boolean'),
uTransparencyTexDim: UniformSpec('v2'),
tTransparency: TextureSpec('image-uint8', 'alpha', 'ubyte', 'nearest'),
dTransparency: DefineSpec('boolean'),
transparencyAverage: ValueSpec('number'),
dClipObjectCount: DefineSpec('number'),
dClipVariant: DefineSpec('string', ['instance', 'pixel']),
uClippingTexDim: UniformSpec('v2'),
tClipping: TextureSpec('image-uint8', 'alpha', 'ubyte', 'nearest'),
dClipping: DefineSpec('boolean'),
uVertexCount: UniformSpec('i'),
uInstanceCount: UniformSpec('i'),
uGroupCount: UniformSpec('i'),
uInvariantBoundingSphere: UniformSpec('v4'),
aInstance: AttributeSpec('float32', 1, 1),
aTransform: AttributeSpec('float32', 16, 1),
drawCount: ValueSpec('number'),
instanceCount: ValueSpec('number'),
alpha: ValueSpec('number'),
matrix: ValueSpec('m4'),
transform: ValueSpec('float32'),
extraTransform: ValueSpec('float32'),
hasReflection: ValueSpec('boolean'),
boundingSphere: ValueSpec('sphere'),
invariantBoundingSphere: ValueSpec('sphere'),
aPosition: AttributeSpec('float32', 3, 0), aPosition: AttributeSpec('float32', 3, 0),
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
uAlpha: UniformSpec('f'), uColor: UniformSpec('v3'),
uColorTexDim: UniformSpec('v2'),
tColor: TextureSpec('image-uint8', 'rgb', 'ubyte', 'nearest'),
dColorType: DefineSpec('string', ['uniform', 'attribute', 'instance', 'group', 'groupInstance', 'vertex', 'vertexInstance']),
uIsoValue: UniformSpec('v2'), uIsoValue: UniformSpec('v2'),
uBboxMin: UniformSpec('v3'), uBboxMin: UniformSpec('v3'),
......
...@@ -15,9 +15,9 @@ import { InterpolationTypeNames } from '../../mol-geo/geometry/image/image'; ...@@ -15,9 +15,9 @@ import { InterpolationTypeNames } from '../../mol-geo/geometry/image/image';
export const ImageSchema = { export const ImageSchema = {
...BaseSchema, ...BaseSchema,
aGroup: AttributeSpec('float32', 1, 0),
aPosition: AttributeSpec('float32', 3, 0), aPosition: AttributeSpec('float32', 3, 0),
aUv: AttributeSpec('float32', 2, 0), aUv: AttributeSpec('float32', 2, 0),
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
uImageTexDim: UniformSpec('v2'), uImageTexDim: UniformSpec('v2'),
......
...@@ -14,6 +14,7 @@ import { LinesShaderCode } from '../shader-code'; ...@@ -14,6 +14,7 @@ import { LinesShaderCode } from '../shader-code';
export const LinesSchema = { export const LinesSchema = {
...BaseSchema, ...BaseSchema,
...SizeSchema, ...SizeSchema,
aGroup: AttributeSpec('float32', 1, 0),
aMapping: AttributeSpec('float32', 2, 0), aMapping: AttributeSpec('float32', 2, 0),
aStart: AttributeSpec('float32', 3, 0), aStart: AttributeSpec('float32', 3, 0),
aEnd: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0),
......
...@@ -13,6 +13,7 @@ import { ValueCell } from '../../mol-util'; ...@@ -13,6 +13,7 @@ import { ValueCell } from '../../mol-util';
export const MeshSchema = { export const MeshSchema = {
...BaseSchema, ...BaseSchema,
aGroup: AttributeSpec('float32', 1, 0),
aPosition: AttributeSpec('float32', 3, 0), aPosition: AttributeSpec('float32', 3, 0),
aNormal: AttributeSpec('float32', 3, 0), aNormal: AttributeSpec('float32', 3, 0),
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
......
...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util'; ...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util';
export const PointsSchema = { export const PointsSchema = {
...BaseSchema, ...BaseSchema,
...SizeSchema, ...SizeSchema,
aGroup: AttributeSpec('float32', 1, 0),
aPosition: AttributeSpec('float32', 3, 0), aPosition: AttributeSpec('float32', 3, 0),
dPointSizeAttenuation: DefineSpec('boolean'), dPointSizeAttenuation: DefineSpec('boolean'),
dPointFilledCircle: DefineSpec('boolean'), dPointFilledCircle: DefineSpec('boolean'),
......
...@@ -242,7 +242,6 @@ export const BaseSchema = { ...@@ -242,7 +242,6 @@ export const BaseSchema = {
...ClippingSchema, ...ClippingSchema,
aInstance: AttributeSpec('float32', 1, 1), aInstance: AttributeSpec('float32', 1, 1),
aGroup: AttributeSpec('float32', 1, 0),
/** /**
* final per-instance transform calculated for instance `i` as * final per-instance transform calculated for instance `i` as
* `aTransform[i] = matrix * transform[i] * extraTransform[i]` * `aTransform[i] = matrix * transform[i] * extraTransform[i]`
......
...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util'; ...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util';
export const SpheresSchema = { export const SpheresSchema = {
...BaseSchema, ...BaseSchema,
...SizeSchema, ...SizeSchema,
aGroup: AttributeSpec('float32', 1, 0),
aPosition: AttributeSpec('float32', 3, 0), aPosition: AttributeSpec('float32', 3, 0),
aMapping: AttributeSpec('float32', 2, 0), aMapping: AttributeSpec('float32', 2, 0),
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
......
...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util'; ...@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util';
export const TextSchema = { export const TextSchema = {
...BaseSchema, ...BaseSchema,
...SizeSchema, ...SizeSchema,
aGroup: AttributeSpec('float32', 1, 0),
aPosition: AttributeSpec('float32', 3, 0), aPosition: AttributeSpec('float32', 3, 0),
aMapping: AttributeSpec('float32', 2, 0), aMapping: AttributeSpec('float32', 2, 0),
aDepth: AttributeSpec('float32', 1, 0), aDepth: AttributeSpec('float32', 1, 0),
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
import { Renderable, RenderableState, createRenderable } from '../renderable'; import { Renderable, RenderableState, createRenderable } from '../renderable';
import { WebGLContext } from '../webgl/context'; import { WebGLContext } from '../webgl/context';
import { createGraphicsRenderItem } from '../webgl/render-item'; import { createGraphicsRenderItem } from '../webgl/render-item';
import { GlobalUniformSchema, BaseSchema, DefineSpec, Values, InternalSchema, InternalValues, UniformSpec, TextureSpec, GlobalTextureSchema } from './schema'; import { GlobalUniformSchema, BaseSchema, DefineSpec, Values, InternalSchema, InternalValues, UniformSpec, TextureSpec, GlobalTextureSchema, AttributeSpec } from './schema';
import { MeshShaderCode } from '../shader-code'; import { MeshShaderCode } from '../shader-code';
import { ValueCell } from '../../mol-util'; import { ValueCell } from '../../mol-util';
export const TextureMeshSchema = { export const TextureMeshSchema = {
...BaseSchema, ...BaseSchema,
aGroup: AttributeSpec('float32', 1, 0),
uGeoTexDim: UniformSpec('v2'), uGeoTexDim: UniformSpec('v2'),
/** texture has vertex positions in XYZ and group id in W */ /** texture has vertex positions in XYZ and group id in W */
tPositionGroup: TextureSpec('texture', 'rgba', 'float', 'nearest'), tPositionGroup: TextureSpec('texture', 'rgba', 'float', 'nearest'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment