Skip to content

Commit

Permalink
Add regex to remove leading underscore from shader identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
shehzan10 committed May 30, 2017
1 parent 3449df8 commit e1526b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/processModelMaterialsCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,9 @@ function ensureSemanticExistenceForPrimitive(gltf, primitive) {
var accessorId = attributes[semantic];
var accessor = accessors[accessorId];
var lowerCase = semantic.toLowerCase();
lowerCase = lowerCase.replace(/^_*/g, ""); // Remove all starting _ from name. GLSL does not allow __ double underscores
var attributeName = 'a_' + lowerCase;

technique.parameters[lowerCase] = {
semantic: semantic,
type: accessor.componentType
Expand Down

0 comments on commit e1526b2

Please sign in to comment.