Properties node: name each shader param by its shader (#66)
game-maker / suite (push) Successful in 8m23s
game-maker / suite (push) Successful in 8m23s
The + Property menu of the Properties node offered every shader's params for every sprite. Each shader row now carries its shader name, and a name shared by two shaders lists both: "brightness (Adjust colors, Neon glow)". Sprite-owned rows stay unlabelled. The note hangs off a map keyed by the def object, not by the name -- a sprite property and a shader param may share a name (#63), and keying by name would label the wrong row. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
05f7a2745e
commit
5c1c3c6fd6
5 files changed
+103
-13
No files matched your search
@@ -13,7 +13,12 @@ import type { ShaderAsset } from '../../src/core/model/Asset';
|
||||
import { isPlaceableType } from '../../src/core/model/AssetTypes';
|
||||
import { findAssetOf } from '../../src/core/model/Project';
|
||||
import { assetDeviates, objectDeviates } from '../../src/core/properties/deviation';
|
||||
import { schemaFor, schemaForAsset, schemaForObject } from '../../src/core/properties/PropertySchema';
|
||||
import {
|
||||
allShaderParamRows,
|
||||
schemaFor,
|
||||
schemaForAsset,
|
||||
schemaForObject,
|
||||
} from '../../src/core/properties/PropertySchema';
|
||||
import { resolveSceneObjectProps } from '../../src/core/properties/resolve';
|
||||
import {
|
||||
nextPropertyName,
|
||||
@@ -166,6 +171,21 @@ describe('shaderParamDefs', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('allShaderParamRows', () => {
|
||||
it('offers one row per name, naming every shader that declares it', () => {
|
||||
const f = makeProject();
|
||||
const adjust = shaderEditor(f, 'Adjust colors');
|
||||
adjust.add(SHADER_PROPERTY, property('brightness'));
|
||||
const neon = shaderEditor(f, 'Neon glow');
|
||||
neon.add(SHADER_PROPERTY, property('brightness'));
|
||||
neon.add(SHADER_PROPERTY, property('glow'));
|
||||
expect(allShaderParamRows(f.project).map((row) => `${row.def.key} (${row.shaders.join(', ')})`)).toEqual([
|
||||
'brightness (Adjust colors, Neon glow)',
|
||||
'glow (Neon glow)',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('compileShader', () => {
|
||||
it('compiles the Adjust colors graph to a fragment with one uniform per property', () => {
|
||||
const f = makeProject();
|
||||
|
||||
Reference in new issue
Block a user