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

fix missing material annotation for some uniforms

- causing unnecessary uniform updates
parent b69f62c9
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf ...@@ -7,6 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf
## [Unreleased] ## [Unreleased]
- Bind shared textures only once per pass, not for each render item - Bind shared textures only once per pass, not for each render item
- Fix missing 'material' annotation for some uniforms, causing unnecessary uniform updates
- Remove use of ``isnan`` in impostor shaders, not needed and causing slowdown - Remove use of ``isnan`` in impostor shaders, not needed and causing slowdown
## [v3.11.0] - 2022-07-04 ## [v3.11.0] - 2022-07-04
......
...@@ -23,12 +23,12 @@ export const CylindersSchema = { ...@@ -23,12 +23,12 @@ export const CylindersSchema = {
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
padding: ValueSpec('number'), padding: ValueSpec('number'),
uDoubleSided: UniformSpec('b'), uDoubleSided: UniformSpec('b', 'material'),
dIgnoreLight: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'),
dXrayShaded: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
uBumpFrequency: UniformSpec('f'), uBumpFrequency: UniformSpec('f', 'material'),
uBumpAmplitude: UniformSpec('f'), uBumpAmplitude: UniformSpec('f', 'material'),
}; };
export type CylindersSchema = typeof CylindersSchema export type CylindersSchema = typeof CylindersSchema
export type CylindersValues = Values<CylindersSchema> export type CylindersValues = Values<CylindersSchema>
......
/** /**
* Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Alexander Rose <alexander.rose@weirdbyte.de>
*/ */
...@@ -26,7 +26,7 @@ export const DirectVolumeSchema = { ...@@ -26,7 +26,7 @@ export const DirectVolumeSchema = {
uTransform: UniformSpec('m4'), uTransform: UniformSpec('m4'),
uGridDim: UniformSpec('v3'), uGridDim: UniformSpec('v3'),
tTransferTex: TextureSpec('image-uint8', 'alpha', 'ubyte', 'linear'), tTransferTex: TextureSpec('image-uint8', 'alpha', 'ubyte', 'linear'),
uTransferScale: UniformSpec('f'), uTransferScale: UniformSpec('f', 'material'),
dGridTexType: DefineSpec('string', ['2d', '3d']), dGridTexType: DefineSpec('string', ['2d', '3d']),
uGridTexDim: UniformSpec('v3'), uGridTexDim: UniformSpec('v3'),
......
/** /**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Alexander Rose <alexander.rose@weirdbyte.de>
*/ */
...@@ -20,7 +20,7 @@ export const LinesSchema = { ...@@ -20,7 +20,7 @@ export const LinesSchema = {
aEnd: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0),
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
dLineSizeAttenuation: DefineSpec('boolean'), dLineSizeAttenuation: DefineSpec('boolean'),
uDoubleSided: UniformSpec('b'), uDoubleSided: UniformSpec('b', 'material'),
dFlipSided: DefineSpec('boolean'), dFlipSided: DefineSpec('boolean'),
}; };
export type LinesSchema = typeof LinesSchema export type LinesSchema = typeof LinesSchema
......
...@@ -18,13 +18,13 @@ export const MeshSchema = { ...@@ -18,13 +18,13 @@ export const MeshSchema = {
aNormal: AttributeSpec('float32', 3, 0), aNormal: AttributeSpec('float32', 3, 0),
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
dFlatShaded: DefineSpec('boolean'), dFlatShaded: DefineSpec('boolean'),
uDoubleSided: UniformSpec('b'), uDoubleSided: UniformSpec('b', 'material'),
dFlipSided: DefineSpec('boolean'), dFlipSided: DefineSpec('boolean'),
dIgnoreLight: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'),
dXrayShaded: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
uBumpFrequency: UniformSpec('f'), uBumpFrequency: UniformSpec('f', 'material'),
uBumpAmplitude: UniformSpec('f'), uBumpAmplitude: UniformSpec('f', 'material'),
meta: ValueSpec('unknown') meta: ValueSpec('unknown')
} as const; } as const;
export type MeshSchema = typeof MeshSchema export type MeshSchema = typeof MeshSchema
......
...@@ -194,7 +194,7 @@ export const SizeSchema = { ...@@ -194,7 +194,7 @@ export const SizeSchema = {
uSizeTexDim: UniformSpec('v2'), uSizeTexDim: UniformSpec('v2'),
tSize: TextureSpec('image-uint8', 'rgb', 'ubyte', 'nearest'), tSize: TextureSpec('image-uint8', 'rgb', 'ubyte', 'nearest'),
dSizeType: DefineSpec('string', ['uniform', 'attribute', 'instance', 'group', 'groupInstance']), dSizeType: DefineSpec('string', ['uniform', 'attribute', 'instance', 'group', 'groupInstance']),
uSizeFactor: UniformSpec('f'), uSizeFactor: UniformSpec('f', 'material'),
} as const; } as const;
export type SizeSchema = typeof SizeSchema export type SizeSchema = typeof SizeSchema
export type SizeValues = Values<SizeSchema> export type SizeValues = Values<SizeSchema>
...@@ -273,11 +273,11 @@ export const BaseSchema = { ...@@ -273,11 +273,11 @@ export const BaseSchema = {
dClipObjectCount: DefineSpec('number'), dClipObjectCount: DefineSpec('number'),
dClipVariant: DefineSpec('string', ['instance', 'pixel']), dClipVariant: DefineSpec('string', ['instance', 'pixel']),
uClipObjectType: UniformSpec('i[]'), uClipObjectType: UniformSpec('i[]', 'material'),
uClipObjectInvert: UniformSpec('b[]'), uClipObjectInvert: UniformSpec('b[]', 'material'),
uClipObjectPosition: UniformSpec('v3[]'), uClipObjectPosition: UniformSpec('v3[]', 'material'),
uClipObjectRotation: UniformSpec('v4[]'), uClipObjectRotation: UniformSpec('v4[]', 'material'),
uClipObjectScale: UniformSpec('v3[]'), uClipObjectScale: UniformSpec('v3[]', 'material'),
aInstance: AttributeSpec('float32', 1, 1), aInstance: AttributeSpec('float32', 1, 1),
/** /**
......
...@@ -20,12 +20,12 @@ export const SpheresSchema = { ...@@ -20,12 +20,12 @@ export const SpheresSchema = {
elements: ElementsSpec('uint32'), elements: ElementsSpec('uint32'),
padding: ValueSpec('number'), padding: ValueSpec('number'),
uDoubleSided: UniformSpec('b'), uDoubleSided: UniformSpec('b', 'material'),
dIgnoreLight: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'),
dXrayShaded: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
uBumpFrequency: UniformSpec('f'), uBumpFrequency: UniformSpec('f', 'material'),
uBumpAmplitude: UniformSpec('f'), uBumpAmplitude: UniformSpec('f', 'material'),
}; };
export type SpheresSchema = typeof SpheresSchema export type SpheresSchema = typeof SpheresSchema
export type SpheresValues = Values<SpheresSchema> export type SpheresValues = Values<SpheresSchema>
......
/** /**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Alexander Rose <alexander.rose@weirdbyte.de>
*/ */
...@@ -24,13 +24,13 @@ export const TextSchema = { ...@@ -24,13 +24,13 @@ export const TextSchema = {
tFont: TextureSpec('image-uint8', 'alpha', 'ubyte', 'linear'), tFont: TextureSpec('image-uint8', 'alpha', 'ubyte', 'linear'),
padding: ValueSpec('number'), padding: ValueSpec('number'),
uBorderWidth: UniformSpec('f'), uBorderWidth: UniformSpec('f', 'material'),
uBorderColor: UniformSpec('v3'), uBorderColor: UniformSpec('v3', 'material'),
uOffsetX: UniformSpec('f'), uOffsetX: UniformSpec('f', 'material'),
uOffsetY: UniformSpec('f'), uOffsetY: UniformSpec('f', 'material'),
uOffsetZ: UniformSpec('f'), uOffsetZ: UniformSpec('f', 'material'),
uBackgroundColor: UniformSpec('v3'), uBackgroundColor: UniformSpec('v3', 'material'),
uBackgroundOpacity: UniformSpec('f'), uBackgroundOpacity: UniformSpec('f', 'material'),
}; };
export type TextSchema = typeof TextSchema export type TextSchema = typeof TextSchema
export type TextValues = Values<TextSchema> export type TextValues = Values<TextSchema>
......
...@@ -19,13 +19,13 @@ export const TextureMeshSchema = { ...@@ -19,13 +19,13 @@ export const TextureMeshSchema = {
tNormal: TextureSpec('texture', 'rgb', 'float', 'nearest'), tNormal: TextureSpec('texture', 'rgb', 'float', 'nearest'),
dFlatShaded: DefineSpec('boolean'), dFlatShaded: DefineSpec('boolean'),
uDoubleSided: UniformSpec('b'), uDoubleSided: UniformSpec('b', 'material'),
dFlipSided: DefineSpec('boolean'), dFlipSided: DefineSpec('boolean'),
dIgnoreLight: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'),
dXrayShaded: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
uBumpFrequency: UniformSpec('f'), uBumpFrequency: UniformSpec('f', 'material'),
uBumpAmplitude: UniformSpec('f'), uBumpAmplitude: UniformSpec('f', 'material'),
meta: ValueSpec('unknown') meta: ValueSpec('unknown')
}; };
export type TextureMeshSchema = typeof TextureMeshSchema export type TextureMeshSchema = typeof TextureMeshSchema
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment