mirror of https://github.com/bjornbytes/lovr.git
Change cofactor/normal matrix to mat3;
This means per-draw uniform data is 128 bytes now!
This commit is contained in:
parent
e9d61bd254
commit
6862b8c970
|
@ -29,7 +29,7 @@ struct Camera {
|
|||
|
||||
struct Draw {
|
||||
mat4 transform;
|
||||
mat4 normalMatrix;
|
||||
mat3 normalMatrix;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
|
@ -155,7 +155,7 @@ layout(location = 14) in vec3 Tangent;
|
|||
#ifdef GL_VERTEX_SHADER
|
||||
#define DrawID gl_BaseInstance
|
||||
#define Transform Draws[DrawID].transform
|
||||
#define NormalMatrix mat3(Draws[DrawID].normalMatrix)
|
||||
#define NormalMatrix Draws[DrawID].normalMatrix
|
||||
#define PassColor Draws[DrawID].color
|
||||
#define ClipFromLocal (ViewProjection * Transform)
|
||||
#define ClipFromWorld (ViewProjection)
|
||||
|
|
|
@ -173,7 +173,7 @@ struct Font {
|
|||
|
||||
typedef struct {
|
||||
float transform[16];
|
||||
float cofactor[16];
|
||||
float cofactor[12];
|
||||
float color[4];
|
||||
} DrawData;
|
||||
|
||||
|
@ -4722,7 +4722,7 @@ static void bindBundles(Pass* pass, Draw* draw, Shader* shader) {
|
|||
mat4_cofactor(cofactor);
|
||||
|
||||
memcpy(pass->drawData->transform, transform, 64);
|
||||
memcpy(pass->drawData->cofactor, cofactor, 64);
|
||||
memcpy(pass->drawData->cofactor, cofactor, 48);
|
||||
memcpy(pass->drawData->color, pass->pipeline->color, 16);
|
||||
pass->drawData++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue