Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regex to remove leading underscore from shader identifiers #286

Merged
merged 1 commit into from
May 30, 2017
Merged

Add regex to remove leading underscore from shader identifiers #286

merged 1 commit into from
May 30, 2017

Conversation

shehzan10
Copy link
Member

This fixes attributes names that have leading underscores, ex. _batchid, which then cause attribute names to be a__batchid.
The double underscore is reserved in GLSL and is not allowed for identifiers.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 93.823% when pulling e1526b2 on shehzan10:leading-underscore-fix into 3449df8 on AnalyticalGraphicsInc:master.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: change "" to ''

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. My bad. Copy paste mistake. Fixed in the same commit.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 93.823% when pulling d812a19 on shehzan10:leading-underscore-fix into 3449df8 on AnalyticalGraphicsInc:master.

@lilleyse
Copy link
Contributor

Looks good!

@lilleyse lilleyse merged commit 6a8239e into CesiumGS:master May 30, 2017
@shehzan10 shehzan10 deleted the leading-underscore-fix branch July 18, 2017 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants