-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fixed Matrix Multiplication Shaders #12349
base: main
Are you sure you want to change the base?
Changes from all commits
8e24055
fbba27b
8196a22
10dc76c
c077b52
766b189
e214560
6b2eccf
88e11a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ out vec4 positionEC; | |
void main() | ||
{ | ||
positionEC = czm_modelView * position; | ||
vec4 positionEC = czm_modelView * position; | ||
gl_Position = czm_projection * positionEC; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this change. Now we are redeclaring |
||
gl_Position = czm_projection * positionEC; | ||
|
||
czm_vertexLogDepth(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ void main() | |
vec4 p = vec4(u_radii * position, 1.0); | ||
|
||
v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates | ||
gl_Position = czm_modelViewProjection * p; // position in clip coordinates | ||
|
||
vec4 positionEC = czm_modelView * position; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is now multiplying by vec4 pEC = czm_modelView * p;
v_positionEC = pEC.xyz; |
||
gl_Position = czm_projection * positionEC; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With the change from the previous comment, this line could be: gl_Position = czm_projection * pEC; |
||
// With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums | ||
// and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the | ||
// ellipsoid (does not write depth) that was rendered in the farther frustum. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,7 +114,8 @@ vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinate | |
float yPositionFraction = get2DYPositionFraction(textureCoordinates); | ||
vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); | ||
vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); | ||
return czm_modelViewProjection * morphPosition; | ||
vec4 positionEC = czm_modelView * position; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is significantly changing the output. For a consistent result, this could be: vec4 positionEC = czm_modelView * morphPosition; However, we may want to avoid using the |
||
return czm_projection * positionEC; | ||
} | ||
|
||
#ifdef QUANTIZATION_BITS12 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,7 +237,11 @@ describe( | |
vs += "in vec4 position;"; | ||
vs += "void main()"; | ||
vs += "{"; | ||
vs += " gl_Position = czm_modelViewProjection * position;"; | ||
vs = ` | ||
gl_Position = czm_modelViewProjection * position; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a copy-pasting error. |
||
vec4 positionEC = czm_modelView * position; | ||
gl_Position = czm_projection * positionEC; | ||
`; | ||
vs += closestFrustum | ||
? " gl_Position.z = clamp(gl_Position.z, gl_DepthRange.near, gl_DepthRange.far);" | ||
: ""; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q
was not declared. The first use of it should include the type: