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

GLES2 Can't alter projection matrix #23185

Closed
BastiaanOlij opened this issue Oct 20, 2018 · 1 comment · Fixed by #27798
Closed

GLES2 Can't alter projection matrix #23185

BastiaanOlij opened this issue Oct 20, 2018 · 1 comment · Fixed by #27798
Assignees
Milestone

Comments

@BastiaanOlij
Copy link
Contributor

Godot version:
Godot 3.1 commit 115885b

OS/device including version:
Windows 10, NVidia 1060 GTX

Issue description:
I'm using a trick in my VR version of my racing game tutorial where I alter the project matrix to overrule the Z-output of the projection matrix. This works fine with GLES3 but with GLES2 this gives an error:

ERROR: _display_error_with_code: SceneShaderGLES2: Vertex shader compilation failed:
0(465) : error C7563: assignment to uniform projection_matrix
0(466) : error C7563: assignment to uniform projection_matrix

Steps to reproduce:
Use this as a vertex shader:

void vertex() {
	// adjust our projection to place our resulting z at our near plane
	PROJECTION_MATRIX[2][2] = 0.0;
	PROJECTION_MATRIX[3][2] = -0.1;
}

Then try and use it in GLES2

Minimal reproduction project:
Try using:
https://github.com/BastiaanOlij/vehicle-demo
And switch to GLES2 renderer

@akien-mga akien-mga added this to the 3.1 milestone Oct 21, 2018
@BastiaanOlij
Copy link
Contributor Author

@reduz any suggestions on fixing this? If we can somehow detect the projection matrix is being assigned we could maybe trigger the use of a copy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants