groverburger / g3d

Simple and easy 3D engine for LÖVE.
MIT License
567 stars 35 forks source link

Fix shader compilation error #3

Closed FloatingBanana closed 4 years ago

FloatingBanana commented 4 years ago

I had some problems running the engine on an Android device. I got this error while creating a new scene:

Error

Cannot link shader program object:
L0001 The fragment matrix variable model_matrix_inverse does not match the vertex variable model_matrix_inverse.
The matrix stride does not match.
L0001 The fragment matrix variable model_matrix does not match the vertex variable model_matrix.
The matrix stride does not match.
L0001 The fragment matrix variable view does not match the vertex variable view.
The matrix stride does not match.

Traceback

[C]: in function 'newShader'
ss3d/engine.lua:229: in function 'newScene'
main.lua:3: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

Apparently, putting pixel shader and vertex shader in separated codes solves the problem.