propertiesJson method
Builds a stable, sorted JSON object for generated shader properties.
Implementation
String propertiesJson() {
final sortedEntries = floatProperties.entries.toList()
..sort((a, b) => a.key.compareTo(b.key));
final sortedSamplers = samplerProperties.toList()..sort();
final ordered = <String, dynamic>{
for (final entry in sortedEntries) entry.key: entry.value.toJson(),
for (final sampler in sortedSamplers) sampler: {
'type': 'sampler2D',
},
};
return const JsonEncoder.withIndent(' ').convert(ordered);
}