Skip to content

reduce factor by which we are scaling texture coordinates - #4770

Merged
mollymerp merged 1 commit into
masterfrom
texture-pos-scaling
Jul 25, 2017
Merged

mollymerp merged 1 commit into
masterfrom
texture-pos-scaling

Conversation

@mollymerp

Copy link
Copy Markdown
Contributor

reduce factor by which we are scaling texture coordinates in the buffer to 8192 to match EXTENT

per chat w @kkaefer – he arbitrarily chose 32767 to scale texture coordinates back in 2013 and we don't really need that much precision. this makes some of the math we need to do for terrain rendering a lot easier and doesn't cause any rendering degradation ✌️

I'll put up the corresponding native PR ASAP.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

@mollymerp mollymerp added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label May 31, 2017
@mollymerp
mollymerp requested a review from kkaefer May 31, 2017 14:12
Comment thread src/shaders/debug.vertex.glsl Outdated
gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);
// we are using Int16 for texture position coordinates to give us enough precision for
// fractional coordinates. we use 8192 to scale the texture coordinates in the buffer
// as an arbitrarily high number to preserve adequare precision when rendering

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo: adequare

// fractional coordinates. we use 8192 to scale the texture coordinates in the buffer
// as an arbitrarily high number to preserve adequare precision when rendering
// this is also the same value as the EXTENT we are using for our tile buffer pos coordinates,
// so math for modifying either is consistent.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Can we please have some capitalization and periods ;)

@mollymerp
mollymerp force-pushed the texture-pos-scaling branch from f325451 to d5023c4 Compare June 8, 2017 17:18
@mollymerp
mollymerp force-pushed the texture-pos-scaling branch 2 times, most recently from f3008e9 to 8ce5400 Compare July 11, 2017 19:11
…fer to 8192 to match EXTENT

grammar 🚓

fix lint errors after rebase

fix temp collisionBoxArray
@mollymerp
mollymerp force-pushed the texture-pos-scaling branch from 8ce5400 to 26fd553 Compare July 24, 2017 23:41
@mollymerp
mollymerp merged commit 93a9922 into master Jul 25, 2017
@mollymerp
mollymerp deleted the texture-pos-scaling branch July 25, 2017 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants